Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PriorityRange.cs
- SizeKeyFrameCollection.cs
- transactioncontext.cs
- StylusPointPropertyUnit.cs
- ScrollPattern.cs
- DataGridState.cs
- EventDescriptor.cs
- Viewport2DVisual3D.cs
- HashCryptoHandle.cs
- ReadOnlyPropertyMetadata.cs
- ConfigurationManagerInternalFactory.cs
- XmlParser.cs
- DataSourceControl.cs
- DesigntimeLicenseContext.cs
- IntSecurity.cs
- DescendantBaseQuery.cs
- TrustManagerPromptUI.cs
- RepeatButton.cs
- CodeArrayIndexerExpression.cs
- StandardCommands.cs
- BitmapSource.cs
- SQLChars.cs
- unsafeIndexingFilterStream.cs
- Queue.cs
- SQLBinaryStorage.cs
- SafeWaitHandle.cs
- PeerSecurityManager.cs
- TableAutomationPeer.cs
- IDReferencePropertyAttribute.cs
- ClientUrlResolverWrapper.cs
- NamespaceImport.cs
- FixedSOMLineRanges.cs
- MeshGeometry3D.cs
- BamlLocalizer.cs
- IsolatedStorageException.cs
- coordinatorfactory.cs
- XMLDiffLoader.cs
- Graphics.cs
- XmlSchemaSimpleContent.cs
- FullTextLine.cs
- ServiceModelConfigurationSectionCollection.cs
- ConfigurationErrorsException.cs
- SqlDuplicator.cs
- DispatchChannelSink.cs
- ELinqQueryState.cs
- InternalControlCollection.cs
- PropertyItem.cs
- Accessible.cs
- SchemaInfo.cs
- ListViewUpdateEventArgs.cs
- SubMenuStyle.cs
- future.cs
- Help.cs
- SpoolingTaskBase.cs
- prefixendpointaddressmessagefiltertable.cs
- ZoneMembershipCondition.cs
- Deflater.cs
- VisualStyleRenderer.cs
- TypeHelpers.cs
- Invariant.cs
- dbenumerator.cs
- DbDataRecord.cs
- ConvertEvent.cs
- LongMinMaxAggregationOperator.cs
- PageParser.cs
- DiscriminatorMap.cs
- DynamicDataManager.cs
- ScrollChangedEventArgs.cs
- SystemResourceHost.cs
- PerformanceCounterCategory.cs
- EventSinkActivityDesigner.cs
- SimpleWebHandlerParser.cs
- SqlNodeAnnotation.cs
- GridViewRowEventArgs.cs
- ContractNamespaceAttribute.cs
- StructuredTypeEmitter.cs
- WebServiceHandlerFactory.cs
- iisPickupDirectory.cs
- SqlMethodAttribute.cs
- BitmapVisualManager.cs
- GeneralTransformGroup.cs
- CharStorage.cs
- Zone.cs
- EnumValAlphaComparer.cs
- DataPagerFieldCommandEventArgs.cs
- SuppressMessageAttribute.cs
- ConfigurationValue.cs
- Annotation.cs
- QuaternionKeyFrameCollection.cs
- HierarchicalDataBoundControlAdapter.cs
- TextTreeRootTextBlock.cs
- NetworkStream.cs
- UpdateTracker.cs
- SystemColors.cs
- DescendentsWalkerBase.cs
- ProxyHelper.cs
- SizeKeyFrameCollection.cs
- SendActivityValidator.cs
- SystemException.cs
- SystemIcons.cs