Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Configuration / Microsoft / Win32 / SafeCryptContextHandle.cs / 1 / SafeCryptContextHandle.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace Microsoft.Win32 { using System; using System.Security.Permissions; using Microsoft.Win32.SafeHandles; using System.Configuration; // Safehandle for crypt context handles [System.Security.SuppressUnmanagedCodeSecurityAttribute()] internal sealed class SafeCryptContextHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeCryptContextHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeCryptContextHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } override protected bool ReleaseHandle() { if (handle != IntPtr.Zero) { UnsafeNativeMethods.CryptReleaseContext(this, 0); return true; } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace Microsoft.Win32 { using System; using System.Security.Permissions; using Microsoft.Win32.SafeHandles; using System.Configuration; // Safehandle for crypt context handles [System.Security.SuppressUnmanagedCodeSecurityAttribute()] internal sealed class SafeCryptContextHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeCryptContextHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeCryptContextHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } override protected bool ReleaseHandle() { if (handle != IntPtr.Zero) { UnsafeNativeMethods.CryptReleaseContext(this, 0); return true; } return false; } } } // 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
- MultiTrigger.cs
- BitSet.cs
- ApplicationDirectoryMembershipCondition.cs
- EdmFunction.cs
- ConfigurationHelpers.cs
- HasCopySemanticsAttribute.cs
- CompositeActivityValidator.cs
- ObjectNavigationPropertyMapping.cs
- VerbConverter.cs
- AccessorTable.cs
- COM2FontConverter.cs
- ButtonStandardAdapter.cs
- SeverityFilter.cs
- TypeResolvingOptionsAttribute.cs
- SoapMessage.cs
- TextAnchor.cs
- Rules.cs
- BaseValidator.cs
- SqlNotificationEventArgs.cs
- PlainXmlWriter.cs
- GridViewCancelEditEventArgs.cs
- SystemIPAddressInformation.cs
- ComplexTypeEmitter.cs
- ProfileInfo.cs
- ColumnReorderedEventArgs.cs
- BindingManagerDataErrorEventArgs.cs
- Geometry3D.cs
- BasePropertyDescriptor.cs
- ListControlConvertEventArgs.cs
- AnonymousIdentificationModule.cs
- DataKeyPropertyAttribute.cs
- HttpCookie.cs
- Geometry.cs
- ControlType.cs
- UIPropertyMetadata.cs
- CertificateReferenceElement.cs
- HttpCacheParams.cs
- ValidationError.cs
- MimeMapping.cs
- CodeSubDirectory.cs
- IPipelineRuntime.cs
- Attachment.cs
- TraceSwitch.cs
- ClientApiGenerator.cs
- MailAddressCollection.cs
- Visitor.cs
- DbProviderConfigurationHandler.cs
- SessionPageStatePersister.cs
- DataSourceControl.cs
- ConstNode.cs
- TextElementEnumerator.cs
- Int64Storage.cs
- ElapsedEventArgs.cs
- ParenthesizePropertyNameAttribute.cs
- Native.cs
- CommonRemoteMemoryBlock.cs
- WindowHelperService.cs
- DoWorkEventArgs.cs
- LinqDataSourceValidationException.cs
- IPHostEntry.cs
- ModelTreeEnumerator.cs
- NonParentingControl.cs
- FormsAuthenticationModule.cs
- ServiceProviders.cs
- ProfileModule.cs
- DataServiceQueryProvider.cs
- Empty.cs
- SecurityDocument.cs
- SchemaCollectionCompiler.cs
- JsonReaderWriterFactory.cs
- PtsCache.cs
- Config.cs
- ExceptionHelpers.cs
- ContourSegment.cs
- DeleteMemberBinder.cs
- BufferAllocator.cs
- MailHeaderInfo.cs
- SuspendDesigner.cs
- CodeComment.cs
- TextServicesDisplayAttribute.cs
- InputMethodStateTypeInfo.cs
- UpdateManifestForBrowserApplication.cs
- ScrollBarRenderer.cs
- VideoDrawing.cs
- StorageFunctionMapping.cs
- WebPartRestoreVerb.cs
- FindRequestContext.cs
- ChannelManager.cs
- MatrixAnimationBase.cs
- XmlComplianceUtil.cs
- HtmlHistory.cs
- DocumentSequence.cs
- GenericWebPart.cs
- HttpDigestClientCredential.cs
- InstalledFontCollection.cs
- sqlstateclientmanager.cs
- XPathDocumentNavigator.cs
- GcSettings.cs
- ReadContentAsBinaryHelper.cs
- AdornerLayer.cs