Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- PeerUnsafeNativeMethods.cs
- AmbiguousMatchException.cs
- ModelPropertyCollectionImpl.cs
- ObjectToken.cs
- HtmlWindow.cs
- XamlSerializerUtil.cs
- FormatterServices.cs
- XsltOutput.cs
- WebHttpBehavior.cs
- Evaluator.cs
- WebScriptServiceHostFactory.cs
- SortDescription.cs
- Exceptions.cs
- Simplifier.cs
- PopOutPanel.cs
- CommentAction.cs
- AsymmetricKeyExchangeFormatter.cs
- DbConnectionOptions.cs
- ThrowOnMultipleAssignment.cs
- PreProcessor.cs
- ReadonlyMessageFilter.cs
- MachineKeySection.cs
- ParameterToken.cs
- WsdlHelpGeneratorElement.cs
- SystemWebCachingSectionGroup.cs
- OracleConnectionFactory.cs
- DesignerLoader.cs
- AssociatedControlConverter.cs
- ProjectedSlot.cs
- RequestQueue.cs
- WebControlParameterProxy.cs
- OracleInternalConnection.cs
- RequestNavigateEventArgs.cs
- MobileControlBuilder.cs
- PublishLicense.cs
- Triangle.cs
- AppModelKnownContentFactory.cs
- FontInfo.cs
- __ComObject.cs
- TitleStyle.cs
- EllipseGeometry.cs
- __Filters.cs
- X509CertificateCollection.cs
- KeyValueSerializer.cs
- NetCodeGroup.cs
- RawMouseInputReport.cs
- TransformConverter.cs
- ThumbAutomationPeer.cs
- DiagnosticsElement.cs
- PictureBox.cs
- HttpRuntime.cs
- PinnedBufferMemoryStream.cs
- SendMailErrorEventArgs.cs
- ToolboxDataAttribute.cs
- Directory.cs
- LocatorBase.cs
- SingleAnimationUsingKeyFrames.cs
- ExceptionRoutedEventArgs.cs
- XmlAnyAttributeAttribute.cs
- WebServiceClientProxyGenerator.cs
- ClientTargetSection.cs
- FormViewDeletedEventArgs.cs
- LambdaCompiler.Logical.cs
- ConvertTextFrag.cs
- PropertiesTab.cs
- RsaSecurityKey.cs
- ResXDataNode.cs
- GenericNameHandler.cs
- MethodSignatureGenerator.cs
- ManagementObject.cs
- AdornerHitTestResult.cs
- DataControlImageButton.cs
- MediaEntryAttribute.cs
- Model3DGroup.cs
- CheckBoxField.cs
- IndentedTextWriter.cs
- IsolatedStorageFileStream.cs
- CommandEventArgs.cs
- GeometryDrawing.cs
- SchemaCollectionCompiler.cs
- ActivityExecutorDelegateInfo.cs
- SiteMapNodeItemEventArgs.cs
- DoubleConverter.cs
- SimpleBitVector32.cs
- ObjectDataSourceMethodEditor.cs
- EventHandlers.cs
- SiteMapPath.cs
- Number.cs
- SettingsProviderCollection.cs
- StoreItemCollection.Loader.cs
- DocumentScope.cs
- CompilerCollection.cs
- ParallelDesigner.xaml.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- EnumerableRowCollection.cs
- BehaviorDragDropEventArgs.cs
- ConfigViewGenerator.cs
- loginstatus.cs
- Table.cs
- PreProcessInputEventArgs.cs