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
- CqlParserHelpers.cs
- BaseParser.cs
- XPathNode.cs
- SqlGatherProducedAliases.cs
- OleDbParameterCollection.cs
- DependencyObjectPropertyDescriptor.cs
- SmtpTransport.cs
- InkCanvasFeedbackAdorner.cs
- LookupBindingPropertiesAttribute.cs
- DataGridViewButtonColumn.cs
- XPathException.cs
- MouseOverProperty.cs
- ClrPerspective.cs
- WeakRefEnumerator.cs
- SendMessageChannelCache.cs
- TrackBarRenderer.cs
- DiscoveryMessageSequence.cs
- ContainerVisual.cs
- ChildTable.cs
- XmlFileEditor.cs
- PrincipalPermission.cs
- DocumentViewerBase.cs
- ClassGenerator.cs
- SerialPinChanges.cs
- ExpressionBuilder.cs
- EpmContentDeSerializer.cs
- SoapSchemaExporter.cs
- AttributeCollection.cs
- QilParameter.cs
- FormView.cs
- TemplateBindingExpression.cs
- HashRepartitionStream.cs
- BamlRecordHelper.cs
- WorkflowPageSetupDialog.cs
- AnnotationHelper.cs
- RelAssertionDirectKeyIdentifierClause.cs
- HierarchicalDataTemplate.cs
- VerificationAttribute.cs
- Semaphore.cs
- ColumnBinding.cs
- TraceHwndHost.cs
- rsa.cs
- ValidatingPropertiesEventArgs.cs
- EventLogInternal.cs
- TaskHelper.cs
- UInt32Converter.cs
- GeneralTransformGroup.cs
- MsmqIntegrationProcessProtocolHandler.cs
- ScrollContentPresenter.cs
- SQLDateTimeStorage.cs
- Int64KeyFrameCollection.cs
- SqlCacheDependencyDatabase.cs
- TdsRecordBufferSetter.cs
- BindingListCollectionView.cs
- GenericUriParser.cs
- ListBox.cs
- WebServiceReceive.cs
- PolyBezierSegment.cs
- MetadataArtifactLoaderCompositeFile.cs
- BuildProvider.cs
- ConfigUtil.cs
- XPathDocument.cs
- CodeNamespace.cs
- WebFaultException.cs
- StringCollectionMarkupSerializer.cs
- Cursor.cs
- HttpApplication.cs
- MetadataArtifactLoaderResource.cs
- SafeCoTaskMem.cs
- BaseParaClient.cs
- InputBuffer.cs
- TimeSpanOrInfiniteConverter.cs
- PreviewControlDesigner.cs
- Column.cs
- FastEncoderWindow.cs
- StaticTextPointer.cs
- CreateDataSourceDialog.cs
- Deserializer.cs
- ColorPalette.cs
- ipaddressinformationcollection.cs
- XmlHierarchyData.cs
- SqlRowUpdatedEvent.cs
- ScriptRef.cs
- WindowsEditBoxRange.cs
- Attributes.cs
- DateTimeOffset.cs
- CompilerTypeWithParams.cs
- ToolStripSplitStackLayout.cs
- ProxyGenerationError.cs
- AddingNewEventArgs.cs
- Command.cs
- PageCatalogPart.cs
- ProtocolViolationException.cs
- Variable.cs
- LongSumAggregationOperator.cs
- QueryRewriter.cs
- AutoGeneratedField.cs
- Array.cs
- Overlapped.cs
- MenuItemStyle.cs