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
- PermissionRequestEvidence.cs
- ExceptionRoutedEventArgs.cs
- MoveSizeWinEventHandler.cs
- DiscoveryInnerClientAdhocCD1.cs
- SecureUICommand.cs
- ScrollChangedEventArgs.cs
- PartialCachingControl.cs
- UniqueIdentifierService.cs
- FilterRepeater.cs
- DeflateStream.cs
- WinFormsUtils.cs
- ApplicationContext.cs
- cryptoapiTransform.cs
- SortDescriptionCollection.cs
- BindingExpressionUncommonField.cs
- MaxMessageSizeStream.cs
- CodeRegionDirective.cs
- CacheDependency.cs
- UrlRoutingHandler.cs
- CompilationLock.cs
- GraphicsContext.cs
- TokenBasedSet.cs
- DataAdapter.cs
- DrawingImage.cs
- DataGridViewTopRowAccessibleObject.cs
- ProxyHwnd.cs
- VBCodeProvider.cs
- ModuleConfigurationInfo.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- DebugView.cs
- IncrementalCompileAnalyzer.cs
- MenuItemCollection.cs
- StreamedWorkflowDefinitionContext.cs
- ConnectionPoint.cs
- SoapIgnoreAttribute.cs
- Axis.cs
- SqlConnectionManager.cs
- BitmapData.cs
- Storyboard.cs
- NotifyCollectionChangedEventArgs.cs
- codemethodreferenceexpression.cs
- NullableFloatAverageAggregationOperator.cs
- SQLBinaryStorage.cs
- LinqDataSourceContextData.cs
- EmptyEnumerator.cs
- HttpChannelHelper.cs
- Attributes.cs
- WindowsListBox.cs
- XmlDeclaration.cs
- SelectingProviderEventArgs.cs
- ServiceProviders.cs
- NativeCppClassAttribute.cs
- PreloadedPackages.cs
- XmlDocumentType.cs
- ModuleBuilderData.cs
- FastPropertyAccessor.cs
- WindowsGraphics.cs
- WebPartCloseVerb.cs
- RtfToXamlReader.cs
- ExtensionQuery.cs
- WriteTimeStream.cs
- DictionaryChange.cs
- AuthenticateEventArgs.cs
- ReadOnlyDictionary.cs
- QilLiteral.cs
- SelectionHighlightInfo.cs
- Command.cs
- DecoderBestFitFallback.cs
- TextBoxLine.cs
- ObjectConverter.cs
- BitmapFrameDecode.cs
- printdlgexmarshaler.cs
- UnsafeNativeMethods.cs
- ElementInit.cs
- GuidConverter.cs
- DefaultHttpHandler.cs
- EventHandlersStore.cs
- ToolStripSeparator.cs
- ToolStripSplitStackLayout.cs
- PointAnimationBase.cs
- TreeViewDesigner.cs
- CodePageUtils.cs
- XmlDocument.cs
- SignatureResourceHelper.cs
- HitTestResult.cs
- QilReference.cs
- TriggerCollection.cs
- HitTestFilterBehavior.cs
- SerializationEventsCache.cs
- XmlSerializerFactory.cs
- OneWayElement.cs
- DBDataPermissionAttribute.cs
- EventHandlerList.cs
- AnnotationResource.cs
- TextSelection.cs
- ExpandButtonVisibilityConverter.cs
- PriorityItem.cs
- ByteRangeDownloader.cs
- ReadOnlyMetadataCollection.cs
- Array.cs