Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / 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. // // // 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StyleCollection.cs
- QilStrConcat.cs
- XPathScanner.cs
- ProjectionCamera.cs
- MsmqInputChannel.cs
- OLEDB_Enum.cs
- ToolStripDropDownClosingEventArgs.cs
- HostingEnvironment.cs
- TypeBuilder.cs
- HandlerFactoryWrapper.cs
- LogEntrySerialization.cs
- OdbcDataReader.cs
- XPathQilFactory.cs
- IncrementalHitTester.cs
- UserControl.cs
- XmlSchemaSimpleTypeRestriction.cs
- WebHostScriptMappingsInstallComponent.cs
- TailCallAnalyzer.cs
- TypeDependencyAttribute.cs
- StringToken.cs
- FragmentQuery.cs
- IssuedTokenParametersElement.cs
- ContractDescription.cs
- InvalidCommandTreeException.cs
- SoapSchemaMember.cs
- ListViewItem.cs
- MultiView.cs
- ResourceDisplayNameAttribute.cs
- AxWrapperGen.cs
- XmlSchemaSubstitutionGroup.cs
- BoundField.cs
- RadioButton.cs
- PngBitmapDecoder.cs
- ReadOnlyNameValueCollection.cs
- WizardForm.cs
- OciLobLocator.cs
- ObjectPersistData.cs
- SslStream.cs
- TrustSection.cs
- SystemIPInterfaceStatistics.cs
- WorkflowServiceBehavior.cs
- DescriptionAttribute.cs
- XPathAxisIterator.cs
- WindowsFormsHelpers.cs
- SimpleWebHandlerParser.cs
- InvokeGenerator.cs
- ProcessHost.cs
- CodeTypeDeclaration.cs
- RequestQueryParser.cs
- SymbolMethod.cs
- TemplatePartAttribute.cs
- CodeDirectionExpression.cs
- UshortList2.cs
- List.cs
- TriState.cs
- XmlSchemaException.cs
- MessageQueue.cs
- ToolConsole.cs
- AudioStateChangedEventArgs.cs
- KnownBoxes.cs
- InternalBase.cs
- TreeNodeBindingCollection.cs
- ImpersonateTokenRef.cs
- GrammarBuilderBase.cs
- TextRange.cs
- updatecommandorderer.cs
- DateTimeConstantAttribute.cs
- GridViewEditEventArgs.cs
- SmiEventSink.cs
- sqlser.cs
- precedingsibling.cs
- LogicalExpr.cs
- DataControlButton.cs
- TypeDefinition.cs
- SeparatorAutomationPeer.cs
- TranslateTransform.cs
- NotifyParentPropertyAttribute.cs
- SymLanguageVendor.cs
- Base64Encoding.cs
- Label.cs
- StsCommunicationException.cs
- CheckBoxPopupAdapter.cs
- SmtpNegotiateAuthenticationModule.cs
- DropShadowBitmapEffect.cs
- TraceSection.cs
- graph.cs
- ProfileModule.cs
- BrowserDefinition.cs
- BitmapEffectGeneralTransform.cs
- Size3DValueSerializer.cs
- UnsettableComboBox.cs
- AdRotator.cs
- ParallelDesigner.xaml.cs
- ResolveCriteriaCD1.cs
- MultiplexingFormatMapping.cs
- DataKeyPropertyAttribute.cs
- Range.cs
- ADMembershipUser.cs
- JsonQueryStringConverter.cs
- WebEventCodes.cs