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
- SecurityStandardsManager.cs
- _SslStream.cs
- SoapSchemaImporter.cs
- AxHost.cs
- ImageClickEventArgs.cs
- XamlTypeMapper.cs
- BulletedListEventArgs.cs
- PhysicalOps.cs
- NavigatingCancelEventArgs.cs
- PropertyRef.cs
- MatrixKeyFrameCollection.cs
- HostingEnvironmentException.cs
- ProcessModelSection.cs
- HttpBrowserCapabilitiesBase.cs
- SecurityTraceRecordHelper.cs
- CheckoutException.cs
- ExpandSegmentCollection.cs
- SubqueryRules.cs
- FormViewUpdateEventArgs.cs
- FontNameConverter.cs
- HierarchicalDataBoundControlAdapter.cs
- EditorBrowsableAttribute.cs
- OleDbEnumerator.cs
- BinaryMessageFormatter.cs
- Rotation3D.cs
- SystemPens.cs
- SplayTreeNode.cs
- Misc.cs
- Vector3dCollection.cs
- SecurityDescriptor.cs
- COM2ExtendedBrowsingHandler.cs
- ReadOnlyDataSourceView.cs
- FormsAuthenticationUser.cs
- UrlMappingsSection.cs
- ConfigurationPropertyAttribute.cs
- CustomAttributeSerializer.cs
- DataContractJsonSerializerOperationBehavior.cs
- XmlSchemaDocumentation.cs
- RuntimeArgumentHandle.cs
- filewebresponse.cs
- LinkedList.cs
- UpDownBaseDesigner.cs
- NullableBoolConverter.cs
- AnnotationComponentChooser.cs
- AlignmentXValidation.cs
- LabelAutomationPeer.cs
- TextBoxRenderer.cs
- PagerSettings.cs
- WebSysDescriptionAttribute.cs
- UIElementParaClient.cs
- EnumUnknown.cs
- SelectingProviderEventArgs.cs
- PrePostDescendentsWalker.cs
- PointLightBase.cs
- GeometryCombineModeValidation.cs
- DefaultExpression.cs
- WebPartMenuStyle.cs
- MexHttpsBindingCollectionElement.cs
- CheckBoxRenderer.cs
- tooltip.cs
- RowTypePropertyElement.cs
- DoubleCollection.cs
- ReflectionUtil.cs
- SystemInformation.cs
- ListItemCollection.cs
- UnsafeNativeMethodsTablet.cs
- WebServicesDescriptionAttribute.cs
- RefreshPropertiesAttribute.cs
- IDispatchConstantAttribute.cs
- FixedNode.cs
- NameObjectCollectionBase.cs
- DataGridTextBox.cs
- DesignerCategoryAttribute.cs
- RootBrowserWindowProxy.cs
- UnsafeNativeMethods.cs
- AdjustableArrowCap.cs
- RedBlackList.cs
- CustomCategoryAttribute.cs
- EmptyControlCollection.cs
- DayRenderEvent.cs
- RegistrationServices.cs
- TemplateBindingExtension.cs
- OdbcError.cs
- PowerEase.cs
- WSFederationHttpBinding.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- SQLString.cs
- RootBrowserWindow.cs
- ListMarkerLine.cs
- RecognizerInfo.cs
- CaseStatementSlot.cs
- XmlAggregates.cs
- TransformerInfo.cs
- IndexerNameAttribute.cs
- RouteCollection.cs
- UnsupportedPolicyOptionsException.cs
- HttpServerUtilityWrapper.cs
- AsymmetricSignatureFormatter.cs
- DictionaryEditChange.cs
- OSFeature.cs