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
- NetworkCredential.cs
- CodeAttributeDeclarationCollection.cs
- BamlWriter.cs
- HttpCapabilitiesBase.cs
- BitmapEffectInputData.cs
- PrivateFontCollection.cs
- X509RawDataKeyIdentifierClause.cs
- MonikerSyntaxException.cs
- SchemaSetCompiler.cs
- XamlInt32CollectionSerializer.cs
- MultitargetingHelpers.cs
- __Error.cs
- CellLabel.cs
- Int32Rect.cs
- GridViewUpdatedEventArgs.cs
- UniqueIdentifierService.cs
- EastAsianLunisolarCalendar.cs
- FrameSecurityDescriptor.cs
- PageAsyncTaskManager.cs
- InsufficientMemoryException.cs
- PrintDialog.cs
- SelectorAutomationPeer.cs
- TableRow.cs
- ListSourceHelper.cs
- _UriSyntax.cs
- _FtpDataStream.cs
- WebPartAuthorizationEventArgs.cs
- PersonalizationEntry.cs
- FixedBufferAttribute.cs
- XsdBuilder.cs
- ExceptionUtil.cs
- Floater.cs
- CompoundFileDeflateTransform.cs
- Point3D.cs
- TypeLoadException.cs
- OdbcEnvironment.cs
- Set.cs
- DefaultPrintController.cs
- UMPAttributes.cs
- BypassElement.cs
- GiveFeedbackEvent.cs
- XmlBindingWorker.cs
- TableLayoutStyle.cs
- RuleSettingsCollection.cs
- _LocalDataStoreMgr.cs
- SegmentInfo.cs
- DataGridCommandEventArgs.cs
- Single.cs
- TypeDelegator.cs
- XsdCachingReader.cs
- PartialArray.cs
- SafeNativeMethods.cs
- GenericAuthenticationEventArgs.cs
- TypeGeneratedEventArgs.cs
- Run.cs
- FunctionMappingTranslator.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- Directory.cs
- GlobalItem.cs
- IBuiltInEvidence.cs
- Transform3D.cs
- SpecularMaterial.cs
- RawStylusInput.cs
- FixedSOMTableCell.cs
- SemanticResolver.cs
- DataListCommandEventArgs.cs
- HttpRequestWrapper.cs
- FilteredReadOnlyMetadataCollection.cs
- EventLogTraceListener.cs
- SiteMapNode.cs
- SymbolPair.cs
- Panel.cs
- XmlEntity.cs
- Point3DAnimation.cs
- Validator.cs
- FixedSOMPageConstructor.cs
- BamlTreeNode.cs
- EnterpriseServicesHelper.cs
- WCFModelStrings.Designer.cs
- MultipartContentParser.cs
- DrawToolTipEventArgs.cs
- DeploymentExceptionMapper.cs
- DispatcherProcessingDisabled.cs
- PointCollection.cs
- MediaEntryAttribute.cs
- VsPropertyGrid.cs
- SimpleFileLog.cs
- ContextMenuStripActionList.cs
- Path.cs
- StrokeSerializer.cs
- StorageFunctionMapping.cs
- CommandLineParser.cs
- DataGridViewAccessibleObject.cs
- SvcMapFileLoader.cs
- HandleCollector.cs
- Types.cs
- XmlChildNodes.cs
- DataServiceRequest.cs
- CroppedBitmap.cs
- ClientConfigurationHost.cs