Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / System.ServiceModel.Activation / System / ServiceModel / Activation / Interop / SafeCloseHandleCritical.cs / 1305376 / SafeCloseHandleCritical.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Activation.Interop
{
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using Microsoft.Win32.SafeHandles;
#pragma warning disable 618 // have not moved to the v4 security model yet
[SecurityCritical(SecurityCriticalScope.Everything)]
#pragma warning restore 618
sealed class SafeCloseHandleCritical : SafeHandleZeroOrMinusOneIsInvalid
{
const string KERNEL32 = "kernel32.dll";
SafeCloseHandleCritical()
: base(true)
{
}
protected override bool ReleaseHandle()
{
return CloseHandle(handle);
}
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
[SuppressUnmanagedCodeSecurity]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[ResourceExposure(ResourceScope.None)]
extern static bool CloseHandle(IntPtr handle);
}
}
// 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
- HtmlInputButton.cs
- AppDomain.cs
- DbConnectionFactory.cs
- FileEnumerator.cs
- AffineTransform3D.cs
- QuadraticBezierSegment.cs
- MachineKeyConverter.cs
- HttpProfileGroupBase.cs
- TiffBitmapDecoder.cs
- WebControl.cs
- RootBrowserWindowProxy.cs
- DocumentReferenceCollection.cs
- ResponseStream.cs
- HtmlButton.cs
- TreeNodeBinding.cs
- WebPartEditorOkVerb.cs
- BindingNavigator.cs
- HtmlInputImage.cs
- XmlSchemaAttributeGroupRef.cs
- XmlMtomReader.cs
- ReferenceSchema.cs
- ProtectedConfiguration.cs
- RoutedEventValueSerializer.cs
- DropShadowBitmapEffect.cs
- keycontainerpermission.cs
- SmiConnection.cs
- HttpWrapper.cs
- serverconfig.cs
- StickyNoteAnnotations.cs
- SharedUtils.cs
- GenericTypeParameterBuilder.cs
- Vector3DValueSerializer.cs
- XpsStructure.cs
- RemotingConfiguration.cs
- LinqDataSourceUpdateEventArgs.cs
- PresentationAppDomainManager.cs
- TextServicesCompartment.cs
- DesignSurfaceServiceContainer.cs
- RowCache.cs
- CommandEventArgs.cs
- __TransparentProxy.cs
- ListCollectionView.cs
- ConfigurationManagerInternal.cs
- ProtectedUri.cs
- WpfGeneratedKnownTypes.cs
- ConfigXmlWhitespace.cs
- SqlMethods.cs
- AbstractSvcMapFileLoader.cs
- HtmlInputCheckBox.cs
- ConfigUtil.cs
- DeferredSelectedIndexReference.cs
- XmlSchemaGroup.cs
- Point3DAnimation.cs
- GridErrorDlg.cs
- CodeTypeOfExpression.cs
- Gdiplus.cs
- Expression.cs
- ApplicationContext.cs
- SchemaElement.cs
- EdmPropertyAttribute.cs
- FullTrustAssembly.cs
- DataGridViewElement.cs
- TraceUtils.cs
- ListBoxItemAutomationPeer.cs
- BindableTemplateBuilder.cs
- RegisteredArrayDeclaration.cs
- ButtonColumn.cs
- OciEnlistContext.cs
- XamlFigureLengthSerializer.cs
- QuaternionAnimationUsingKeyFrames.cs
- ConfigurationManager.cs
- RandomNumberGenerator.cs
- COM2IProvidePropertyBuilderHandler.cs
- ADConnectionHelper.cs
- ExpressionBuilderCollection.cs
- XmlSchemaDatatype.cs
- GenerateScriptTypeAttribute.cs
- TableRowGroupCollection.cs
- RulePatternOps.cs
- HttpValueCollection.cs
- SchemaEntity.cs
- RectValueSerializer.cs
- CodeTypeDeclaration.cs
- IxmlLineInfo.cs
- HttpModuleAction.cs
- CodeDomLocalizationProvider.cs
- EdmTypeAttribute.cs
- ApplicationSecurityInfo.cs
- ThicknessAnimationUsingKeyFrames.cs
- SortAction.cs
- ExpressionPrinter.cs
- QuestionEventArgs.cs
- Validator.cs
- SqlBuffer.cs
- DataGridViewRowPostPaintEventArgs.cs
- BufferedGraphicsManager.cs
- EventLogPermissionEntry.cs
- RegionIterator.cs
- TypeResolvingOptions.cs
- XmlUrlResolver.cs