Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- PerformanceCounterTraceRecord.cs
- DataGridCell.cs
- ActivityXamlServices.cs
- SecurityDocument.cs
- PolicyException.cs
- DbConnectionPoolGroup.cs
- StreamWriter.cs
- PixelFormat.cs
- Win32Native.cs
- UserControlFileEditor.cs
- _NegoStream.cs
- RepeaterCommandEventArgs.cs
- AdornerLayer.cs
- ExpressionWriter.cs
- MimeObjectFactory.cs
- LOSFormatter.cs
- ImpersonateTokenRef.cs
- IdentifierCollection.cs
- UserPreferenceChangedEventArgs.cs
- HttpHandlersSection.cs
- CompatibleComparer.cs
- ProxyHelper.cs
- DataException.cs
- EventSinkHelperWriter.cs
- ACE.cs
- KernelTypeValidation.cs
- MailDefinition.cs
- Cell.cs
- SystemIPv6InterfaceProperties.cs
- XmlChoiceIdentifierAttribute.cs
- DatePickerAutomationPeer.cs
- PenContexts.cs
- ClientFormsAuthenticationMembershipProvider.cs
- SerializerDescriptor.cs
- PrimitiveXmlSerializers.cs
- NegatedCellConstant.cs
- FormatConvertedBitmap.cs
- CodeValidator.cs
- LineServices.cs
- XPathSelfQuery.cs
- WeakReadOnlyCollection.cs
- ImageAnimator.cs
- PersistencePipeline.cs
- CollectionViewGroup.cs
- SignatureGenerator.cs
- Journaling.cs
- AnyReturnReader.cs
- ColumnClickEvent.cs
- FunctionCommandText.cs
- DetailsViewCommandEventArgs.cs
- MessageBox.cs
- SingleConverter.cs
- ProtocolImporter.cs
- PreloadHost.cs
- Root.cs
- CodeDOMProvider.cs
- QueryExpr.cs
- SaveFileDialog.cs
- contentDescriptor.cs
- GridSplitter.cs
- XmlILConstructAnalyzer.cs
- MatrixCamera.cs
- DetailsViewInsertEventArgs.cs
- NativeMethods.cs
- WebWorkflowRole.cs
- CodeValidator.cs
- unsafenativemethodsother.cs
- RepeatButton.cs
- EventSourceCreationData.cs
- DesignerUtils.cs
- Error.cs
- RepeaterCommandEventArgs.cs
- ScrollBarRenderer.cs
- RegistryPermission.cs
- DataSvcMapFileSerializer.cs
- ContextBase.cs
- ChangeInterceptorAttribute.cs
- ResourcePool.cs
- WFItemsToSpacerVisibility.cs
- RSAPKCS1SignatureDeformatter.cs
- DecimalSumAggregationOperator.cs
- ProjectionPath.cs
- _SingleItemRequestCache.cs
- FacetValues.cs
- RequestFactory.cs
- XsltLibrary.cs
- GeometryGroup.cs
- HtmlTitle.cs
- ValueTypeFixupInfo.cs
- ArrangedElementCollection.cs
- StandardMenuStripVerb.cs
- _SSPISessionCache.cs
- XamlUtilities.cs
- ModifierKeysConverter.cs
- CollectionViewGroup.cs
- TemplateBamlTreeBuilder.cs
- CallbackValidator.cs
- TableChangeProcessor.cs
- TemplateAction.cs
- WebPartsSection.cs