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
- TextBoxAutoCompleteSourceConverter.cs
- ConfigXmlElement.cs
- NamedPipeTransportSecurity.cs
- DataControlCommands.cs
- DialogResultConverter.cs
- Keyboard.cs
- SubstitutionList.cs
- NonClientArea.cs
- PrimarySelectionAdorner.cs
- TemplateControlBuildProvider.cs
- TextSegment.cs
- OrthographicCamera.cs
- Command.cs
- Brush.cs
- SqlTriggerContext.cs
- WrapPanel.cs
- EndpointAddressElementBase.cs
- RSAOAEPKeyExchangeDeformatter.cs
- PersianCalendar.cs
- CryptoKeySecurity.cs
- GetWinFXPath.cs
- DataBoundLiteralControl.cs
- ImageCodecInfoPrivate.cs
- CurrentChangingEventManager.cs
- TabItemAutomationPeer.cs
- TimeSpanOrInfiniteConverter.cs
- XPathNodeIterator.cs
- CodeMemberField.cs
- HttpChannelHelper.cs
- Events.cs
- DBConnectionString.cs
- NestPullup.cs
- GridItem.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- BindingRestrictions.cs
- DocumentViewer.cs
- AutoResetEvent.cs
- InstanceCreationEditor.cs
- CancellationTokenRegistration.cs
- CFStream.cs
- Visual3D.cs
- Rotation3DAnimationBase.cs
- HtmlObjectListAdapter.cs
- AsyncDataRequest.cs
- ResourceDictionaryCollection.cs
- CodeCommentStatementCollection.cs
- DictionaryBase.cs
- BamlResourceContent.cs
- CodeIterationStatement.cs
- PointKeyFrameCollection.cs
- SystemDropShadowChrome.cs
- AppLevelCompilationSectionCache.cs
- OrthographicCamera.cs
- ContainerVisual.cs
- SystemIPAddressInformation.cs
- GroupByQueryOperator.cs
- AstTree.cs
- coordinator.cs
- CustomValidator.cs
- HandledMouseEvent.cs
- GB18030Encoding.cs
- ModelEditingScope.cs
- SpnEndpointIdentityExtension.cs
- NodeLabelEditEvent.cs
- PolygonHotSpot.cs
- LoginUtil.cs
- ControlPager.cs
- LinkLabel.cs
- EdmPropertyAttribute.cs
- DropDownHolder.cs
- Deflater.cs
- XmlAnyAttributeAttribute.cs
- PermissionRequestEvidence.cs
- InstanceLockQueryResult.cs
- Ref.cs
- XPathAncestorIterator.cs
- DefaultTraceListener.cs
- DataGridComponentEditor.cs
- SymbolEqualComparer.cs
- ElapsedEventArgs.cs
- XamlReaderConstants.cs
- OrderedDictionaryStateHelper.cs
- VerificationException.cs
- GroupDescription.cs
- QuotedStringFormatReader.cs
- MarshalDirectiveException.cs
- StatusBarItemAutomationPeer.cs
- DataFormats.cs
- ItemsChangedEventArgs.cs
- ProcessHostFactoryHelper.cs
- Page.cs
- CookieProtection.cs
- SafeLocalMemHandle.cs
- TypeConstant.cs
- documentsequencetextpointer.cs
- QueryCacheKey.cs
- remotingproxy.cs
- File.cs
- IsolatedStorage.cs
- ArgumentsParser.cs