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
- SoapClientProtocol.cs
- Ops.cs
- InkCanvasFeedbackAdorner.cs
- HwndHost.cs
- ReadOnlyCollectionBase.cs
- UnmanagedMarshal.cs
- SurrogateSelector.cs
- ValidationError.cs
- StringBlob.cs
- DataGridCellsPresenter.cs
- DropSource.cs
- CodeAttachEventStatement.cs
- LinqDataSourceValidationException.cs
- ArgumentException.cs
- Delay.cs
- BitmapImage.cs
- ImageClickEventArgs.cs
- ToolbarAUtomationPeer.cs
- JournalEntryStack.cs
- StringCollection.cs
- AttributeProviderAttribute.cs
- KnownAssembliesSet.cs
- DataGridCellsPanel.cs
- InheritanceContextHelper.cs
- DbBuffer.cs
- RuntimeEnvironment.cs
- FontStyleConverter.cs
- XmlTypeAttribute.cs
- HttpPostedFile.cs
- ToolStripButton.cs
- DataGridDesigner.cs
- TransformGroup.cs
- ISO2022Encoding.cs
- JapaneseLunisolarCalendar.cs
- CodeExpressionCollection.cs
- CodeEventReferenceExpression.cs
- ArgumentsParser.cs
- XmlQuerySequence.cs
- DataObject.cs
- ToolStripItemCollection.cs
- InstanceDescriptor.cs
- ActivityDelegate.cs
- PlaceHolder.cs
- UnicodeEncoding.cs
- ResourcePermissionBaseEntry.cs
- ServerType.cs
- WindowsAuthenticationModule.cs
- FileEnumerator.cs
- DataGridViewButtonCell.cs
- shaperfactory.cs
- RankException.cs
- FamilyTypefaceCollection.cs
- PassportAuthenticationEventArgs.cs
- Win32MouseDevice.cs
- NumericExpr.cs
- EndpointDispatcherTable.cs
- ForeignKeyConstraint.cs
- WebPartAddingEventArgs.cs
- GenericUI.cs
- ProcessModelSection.cs
- AnimationStorage.cs
- mediaeventargs.cs
- BindingValueChangedEventArgs.cs
- TextStore.cs
- ComponentConverter.cs
- SectionInformation.cs
- TypedElement.cs
- SqlMethodAttribute.cs
- filewebresponse.cs
- OlePropertyStructs.cs
- util.cs
- KeyValueConfigurationCollection.cs
- _UriSyntax.cs
- DeferredSelectedIndexReference.cs
- ItemType.cs
- NativeCppClassAttribute.cs
- Stylus.cs
- XmlSchemaComplexContent.cs
- RuntimeResourceSet.cs
- ToolboxSnapDragDropEventArgs.cs
- Pens.cs
- InputGestureCollection.cs
- SqlExpander.cs
- SchemaTableOptionalColumn.cs
- ToolStripSeparatorRenderEventArgs.cs
- DateRangeEvent.cs
- HtmlProps.cs
- _FtpControlStream.cs
- EntityCommandCompilationException.cs
- CommandField.cs
- XmlAnyElementAttributes.cs
- AnchoredBlock.cs
- InvokeGenerator.cs
- EntityDataSourceWrapper.cs
- MessageBox.cs
- BadImageFormatException.cs
- Point3DCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- IconHelper.cs
- CompositeDataBoundControl.cs