Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Media / SafeNativeMethodsMilCoreApi.cs / 1 / 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, MIL_SCHEDULE_TYPE schedType) { return SafeNativeMethodsPrivate.MilCompositionEngine_InitializePartitionManager(nPriority, schedType); } ////// 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(); } ////// This code does not have a critical attribute since the rest of the partial class /// has the attribute (UnsafeNativeMethodsOther) /// [SuppressUnmanagedCodeSecurity] private static partial class SafeNativeMethodsPrivate { [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_InitializePartitionManager(int nPriority, MIL_SCHEDULE_TYPE schedType); [DllImport(DllImport.MilCore)] internal static extern int MilCompositionEngine_DeinitializePartitionManager(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SeekStoryboard.cs
- TranslateTransform3D.cs
- ColorConvertedBitmap.cs
- HandlerFactoryWrapper.cs
- ListMarkerLine.cs
- TextContainerChangeEventArgs.cs
- XmlDownloadManager.cs
- CompilationRelaxations.cs
- MessageFilterException.cs
- SerializationBinder.cs
- Rotation3DAnimation.cs
- SessionState.cs
- Parallel.cs
- FileUtil.cs
- CodeIdentifiers.cs
- LinqDataSource.cs
- ValueProviderWrapper.cs
- CanExecuteRoutedEventArgs.cs
- FastPropertyAccessor.cs
- XmlSiteMapProvider.cs
- PathGeometry.cs
- FamilyTypefaceCollection.cs
- SlipBehavior.cs
- NetworkStream.cs
- AssemblyCollection.cs
- Lasso.cs
- WindowsGraphicsWrapper.cs
- TypeReference.cs
- UriTemplate.cs
- DetailsViewDeleteEventArgs.cs
- AssociatedControlConverter.cs
- StagingAreaInputItem.cs
- Stacktrace.cs
- AnnotationAdorner.cs
- HTMLTagNameToTypeMapper.cs
- EndPoint.cs
- SecurityUniqueId.cs
- XmlSchemaElement.cs
- MetadataCollection.cs
- DbModificationClause.cs
- PointF.cs
- TreeView.cs
- ModelItemDictionaryImpl.cs
- CheckBoxAutomationPeer.cs
- BitmapMetadata.cs
- DeviceSpecificChoiceCollection.cs
- DataGridViewButtonColumn.cs
- VScrollProperties.cs
- SystemNetHelpers.cs
- SubclassTypeValidator.cs
- RelationshipEndMember.cs
- BoolLiteral.cs
- XmlReflectionMember.cs
- ReferenceService.cs
- FileSystemEnumerable.cs
- CheckBoxList.cs
- RuleSettingsCollection.cs
- WebBrowserEvent.cs
- Misc.cs
- PlatformCulture.cs
- SafePipeHandle.cs
- GlyphInfoList.cs
- PathTooLongException.cs
- EditorAttribute.cs
- TransformConverter.cs
- StringSource.cs
- BitmapCacheBrush.cs
- ImageAnimator.cs
- StoreAnnotationsMap.cs
- Opcode.cs
- SoapEnumAttribute.cs
- BitmapMetadataEnumerator.cs
- MDIControlStrip.cs
- DataTableCollection.cs
- FreeFormPanel.cs
- UpDownBase.cs
- PersonalizationProviderCollection.cs
- SiteOfOriginContainer.cs
- OperationParameterInfoCollection.cs
- AssemblyContextControlItem.cs
- ProtocolsConfiguration.cs
- DeviceContexts.cs
- MessagingActivityHelper.cs
- GridLength.cs
- COSERVERINFO.cs
- __TransparentProxy.cs
- UdpTransportSettings.cs
- QilInvokeEarlyBound.cs
- Semaphore.cs
- XpsFontSerializationService.cs
- XmlSchemaComplexType.cs
- NaturalLanguageHyphenator.cs
- EventLogPermissionEntryCollection.cs
- DependentList.cs
- EventLogPermissionEntryCollection.cs
- TileBrush.cs
- TransformerInfo.cs
- WithStatement.cs
- WindowsListViewGroup.cs
- DesignerEventService.cs