Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // 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
- FixedElement.cs
- TriggerCollection.cs
- RsaKeyIdentifierClause.cs
- ElementNotEnabledException.cs
- PenThread.cs
- SHA256Managed.cs
- WizardPanel.cs
- WebPartDeleteVerb.cs
- ImageButton.cs
- PageThemeBuildProvider.cs
- UnicastIPAddressInformationCollection.cs
- WsdlImporterElement.cs
- DataColumnMappingCollection.cs
- XmlEventCache.cs
- WizardStepBase.cs
- FileNotFoundException.cs
- InfiniteTimeSpanConverter.cs
- SafeNativeMethods.cs
- DbConnectionStringBuilder.cs
- MediaContextNotificationWindow.cs
- XmlSerializationReader.cs
- NameScopePropertyAttribute.cs
- Switch.cs
- SmtpAuthenticationManager.cs
- WindowClosedEventArgs.cs
- SoapAttributeOverrides.cs
- PolyQuadraticBezierSegment.cs
- MatrixAnimationUsingKeyFrames.cs
- BaseComponentEditor.cs
- TriggerAction.cs
- ModelItemCollection.cs
- ExpressionPrefixAttribute.cs
- Graphics.cs
- SdlChannelSink.cs
- MenuItem.cs
- DataBoundControlHelper.cs
- SchemaComplexType.cs
- ClientTargetSection.cs
- HostingEnvironmentSection.cs
- TransformProviderWrapper.cs
- Attachment.cs
- ClrProviderManifest.cs
- TypeDescriptorFilterService.cs
- QueryOperatorEnumerator.cs
- OperationContextScope.cs
- SmiConnection.cs
- InheritanceAttribute.cs
- XMLSchema.cs
- SqlExpander.cs
- DBCommand.cs
- ImportContext.cs
- TextElement.cs
- BitmapMetadata.cs
- ZipIOModeEnforcingStream.cs
- GeometryHitTestResult.cs
- ContainerParaClient.cs
- SchemaEntity.cs
- SigningCredentials.cs
- RuleRef.cs
- OciHandle.cs
- FilterException.cs
- BaseDataListComponentEditor.cs
- ConsoleKeyInfo.cs
- InvalidAsynchronousStateException.cs
- StretchValidation.cs
- DictionaryBase.cs
- sortedlist.cs
- XmlHierarchicalEnumerable.cs
- SecurityKeyType.cs
- KeyBinding.cs
- SpAudioStreamWrapper.cs
- shaperfactoryquerycacheentry.cs
- ToolboxItem.cs
- EmptyElement.cs
- IpcClientChannel.cs
- DecimalAnimation.cs
- EventArgs.cs
- MenuItemBinding.cs
- ParameterModifier.cs
- InputProcessorProfilesLoader.cs
- EventMappingSettingsCollection.cs
- Hashtable.cs
- OleDbDataReader.cs
- XmlILCommand.cs
- Timer.cs
- SqlEnums.cs
- ProxyManager.cs
- XmlElementList.cs
- SortedSetDebugView.cs
- DateTimeFormat.cs
- RtfFormatStack.cs
- QueueSurrogate.cs
- RadialGradientBrush.cs
- CacheAxisQuery.cs
- SecurityPermission.cs
- UnicodeEncoding.cs
- ReadOnlyHierarchicalDataSourceView.cs
- TreeNodeCollection.cs
- TemplateInstanceAttribute.cs
- UndirectedGraph.cs