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
- ImmComposition.cs
- SafeRightsManagementPubHandle.cs
- EdmProviderManifest.cs
- LockCookie.cs
- PropertyMapper.cs
- Array.cs
- BitVector32.cs
- AuthenticateEventArgs.cs
- AssemblyInfo.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Content.cs
- PriorityChain.cs
- MasterPageBuildProvider.cs
- BoolExpr.cs
- ActiveDocumentEvent.cs
- EventSchemaTraceListener.cs
- PropertyGridView.cs
- NativeCppClassAttribute.cs
- FileUtil.cs
- TextLineResult.cs
- DebugView.cs
- EtwTrace.cs
- Timer.cs
- PingOptions.cs
- MemoryRecordBuffer.cs
- ClientEventManager.cs
- DefaultPropertyAttribute.cs
- Regex.cs
- RewritingSimplifier.cs
- TypeReference.cs
- MetadataUtil.cs
- oledbmetadatacollectionnames.cs
- NativeMethods.cs
- While.cs
- StylusShape.cs
- SqlDataSourceCache.cs
- DataServiceRequestArgs.cs
- GetPageNumberCompletedEventArgs.cs
- DeclaredTypeValidator.cs
- wgx_exports.cs
- DistinctQueryOperator.cs
- SplineQuaternionKeyFrame.cs
- TextTreeUndoUnit.cs
- Attributes.cs
- ProcessHostServerConfig.cs
- Comparer.cs
- BasicHttpSecurityElement.cs
- PropertyEmitterBase.cs
- MaskInputRejectedEventArgs.cs
- ExceptionCollection.cs
- MILUtilities.cs
- ToolStripSplitButton.cs
- TreeView.cs
- IsolatedStorageFilePermission.cs
- SpellerInterop.cs
- JapaneseLunisolarCalendar.cs
- ReservationNotFoundException.cs
- TdsParser.cs
- Simplifier.cs
- CommandHelpers.cs
- newinstructionaction.cs
- PropertyInfoSet.cs
- ColorAnimationUsingKeyFrames.cs
- MimeXmlImporter.cs
- EmptyEnumerable.cs
- ContextStaticAttribute.cs
- SHA1.cs
- KnowledgeBase.cs
- JsonStringDataContract.cs
- SerializableReadOnlyDictionary.cs
- XmlAttributeAttribute.cs
- DomNameTable.cs
- CatalogPartChrome.cs
- MemberRelationshipService.cs
- InputDevice.cs
- DesignerToolboxInfo.cs
- VisualStyleInformation.cs
- ShaderEffect.cs
- SelectionItemPatternIdentifiers.cs
- X509ClientCertificateAuthenticationElement.cs
- XmlDataCollection.cs
- RootBrowserWindowProxy.cs
- ScriptReferenceEventArgs.cs
- TrustLevelCollection.cs
- XmlSchemaDocumentation.cs
- WindowPattern.cs
- DBSqlParserTableCollection.cs
- GridViewPageEventArgs.cs
- ClientTargetCollection.cs
- SocketPermission.cs
- SplashScreenNativeMethods.cs
- DeliveryStrategy.cs
- XamlParser.cs
- AndCondition.cs
- KeyInfo.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- UrlSyndicationContent.cs
- SystemFonts.cs
- ValidationHelper.cs
- SymbolEqualComparer.cs