Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / SafeNativeMethodsMilCoreApi.cs / 1407647 / SafeNativeMethodsMilCoreApi.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // ABOUT THIS FILE: // -- This file contains native methods which are deemed SAFE for partial trust callers // -- These methods DO have the SuppressUnmanagedCodeSecurity attribute which means // stalk walks for unmanaged // code will stop with the immediate caler. // -- Put methods in here which are needed in partial trust scenarios // -- If you have questions about how to use this file, email avsee //----------------------------------------------------------------------------- namespace MS.Win32.PresentationCore { using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System; using System.Security; using System.Security.Permissions; using System.Collections; using System.IO; using System.Text; using System.Windows.Media.Composition; using Microsoft.Internal; using IComDataObject = System.Runtime.InteropServices.ComTypes.IDataObject; internal static partial class SafeNativeMethods { ////// TreatAsSafe: The security model here is that these APIs could be publicly exposed to partial trust /// callers - no risk. /// Critical: This code elevates priviliges by adding a SuppressUnmanagedCodeSecurity /// [SecurityCritical, SecurityTreatAsSafe] internal static int MilCompositionEngine_InitializePartitionManager(int nPriority) { return SafeNativeMethodsPrivate.MilCompositionEngine_InitializePartitionManager(nPriority); } ////// TreatAsSafe: The security model here is that these APIs could be publicly exposed to partial trust /// callers - no risk. /// Critical: This code elevates priviliges by adding a SuppressUnmanagedCodeSecurity /// [SecurityCritical, SecurityTreatAsSafe] internal static int MilCompositionEngine_DeinitializePartitionManager() { return SafeNativeMethodsPrivate.MilCompositionEngine_DeinitializePartitionManager(); } [SecurityCritical, SecurityTreatAsSafe] internal static long GetNextPerfElementId() { return SafeNativeMethodsPrivate.GetNextPerfElementId(); } ////// Critical - Uses SuppressUnmanagedCodeSecurityAttribute. /// [SuppressUnmanagedCodeSecurity, SecurityCritical(SecurityCriticalScope.Everything)] private static partial class SafeNativeMethodsPrivate { [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_InitializePartitionManager(int nPriority); [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_DeinitializePartitionManager(); [DllImport(DllImport.MilCore)] internal static extern long GetNextPerfElementId(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // ABOUT THIS FILE: // -- This file contains native methods which are deemed SAFE for partial trust callers // -- These methods DO have the SuppressUnmanagedCodeSecurity attribute which means // stalk walks for unmanaged // code will stop with the immediate caler. // -- Put methods in here which are needed in partial trust scenarios // -- If you have questions about how to use this file, email avsee //----------------------------------------------------------------------------- namespace MS.Win32.PresentationCore { using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System; using System.Security; using System.Security.Permissions; using System.Collections; using System.IO; using System.Text; using System.Windows.Media.Composition; using Microsoft.Internal; using IComDataObject = System.Runtime.InteropServices.ComTypes.IDataObject; internal static partial class SafeNativeMethods { ////// TreatAsSafe: The security model here is that these APIs could be publicly exposed to partial trust /// callers - no risk. /// Critical: This code elevates priviliges by adding a SuppressUnmanagedCodeSecurity /// [SecurityCritical, SecurityTreatAsSafe] internal static int MilCompositionEngine_InitializePartitionManager(int nPriority) { return SafeNativeMethodsPrivate.MilCompositionEngine_InitializePartitionManager(nPriority); } ////// TreatAsSafe: The security model here is that these APIs could be publicly exposed to partial trust /// callers - no risk. /// Critical: This code elevates priviliges by adding a SuppressUnmanagedCodeSecurity /// [SecurityCritical, SecurityTreatAsSafe] internal static int MilCompositionEngine_DeinitializePartitionManager() { return SafeNativeMethodsPrivate.MilCompositionEngine_DeinitializePartitionManager(); } [SecurityCritical, SecurityTreatAsSafe] internal static long GetNextPerfElementId() { return SafeNativeMethodsPrivate.GetNextPerfElementId(); } ////// Critical - Uses SuppressUnmanagedCodeSecurityAttribute. /// [SuppressUnmanagedCodeSecurity, SecurityCritical(SecurityCriticalScope.Everything)] private static partial class SafeNativeMethodsPrivate { [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_InitializePartitionManager(int nPriority); [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_DeinitializePartitionManager(); [DllImport(DllImport.MilCore)] internal static extern long GetNextPerfElementId(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripManager.cs
- PartitionedStream.cs
- ExpanderAutomationPeer.cs
- SymDocumentType.cs
- KeySplineConverter.cs
- XPathMessageFilterElement.cs
- UdpChannelFactory.cs
- DocobjHost.cs
- TextEditorDragDrop.cs
- PackagePartCollection.cs
- TaskFileService.cs
- TypeForwardedFromAttribute.cs
- DataServiceContext.cs
- DefaultTraceListener.cs
- ZoneMembershipCondition.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- CompositeScriptReference.cs
- VectorValueSerializer.cs
- TileBrush.cs
- OledbConnectionStringbuilder.cs
- EdmConstants.cs
- DataControlLinkButton.cs
- DataRowCollection.cs
- Light.cs
- BaseValidator.cs
- WebZone.cs
- FactoryGenerator.cs
- NameValueSectionHandler.cs
- WorkflowInstanceProxy.cs
- DataException.cs
- PeerNameResolver.cs
- CellQuery.cs
- MinimizableAttributeTypeConverter.cs
- DesignTimeVisibleAttribute.cs
- CommonDialog.cs
- WindowsListViewScroll.cs
- DataTableNewRowEvent.cs
- XmlFormatExtensionPrefixAttribute.cs
- ServicePoint.cs
- UserControlAutomationPeer.cs
- WpfSharedBamlSchemaContext.cs
- XmlSchemaInferenceException.cs
- CompensatableTransactionScopeActivityDesigner.cs
- StatusBarAutomationPeer.cs
- DependencyProperty.cs
- KnownIds.cs
- PageFunction.cs
- DateTime.cs
- Translator.cs
- PictureBox.cs
- HWStack.cs
- WebPartEventArgs.cs
- EventSinkHelperWriter.cs
- ToolStripScrollButton.cs
- SystemGatewayIPAddressInformation.cs
- MethodToken.cs
- ReachUIElementCollectionSerializer.cs
- XmlNodeReader.cs
- IdentityReference.cs
- FilterEventArgs.cs
- EnumBuilder.cs
- CellLabel.cs
- TraceSection.cs
- FileUtil.cs
- CompilerLocalReference.cs
- GenericsInstances.cs
- TdsValueSetter.cs
- LocationSectionRecord.cs
- ObjectItemLoadingSessionData.cs
- XmlIlVisitor.cs
- SurrogateSelector.cs
- FaultReason.cs
- WpfPayload.cs
- FlowDocumentFormatter.cs
- CompiledScopeCriteria.cs
- Baml2006KeyRecord.cs
- GPRECTF.cs
- ProbeMatchesCD1.cs
- XamlToRtfParser.cs
- ObfuscateAssemblyAttribute.cs
- Scene3D.cs
- HelpKeywordAttribute.cs
- ContainerParagraph.cs
- ByteStorage.cs
- SoapSchemaExporter.cs
- MulticastDelegate.cs
- ListBoxItemWrapperAutomationPeer.cs
- TextRangeEditLists.cs
- GeometryModel3D.cs
- SystemWebSectionGroup.cs
- SurrogateSelector.cs
- XmlNamespaceManager.cs
- DoubleCollection.cs
- PbrsForward.cs
- XmlAttributeCache.cs
- ResourceAssociationSetEnd.cs
- ValidatorCollection.cs
- DBDataPermissionAttribute.cs
- ActionMessageFilter.cs
- PaperSource.cs