Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / Microsoft / Win32 / SafeCryptContextHandle.cs / 1305376 / 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
- FontStyleConverter.cs
- ListViewInsertionMark.cs
- DefaultExpressionVisitor.cs
- WbemProvider.cs
- DropTarget.cs
- IdleTimeoutMonitor.cs
- SendMessageRecord.cs
- UTF32Encoding.cs
- CursorConverter.cs
- WebPartTransformer.cs
- XsltSettings.cs
- RSACryptoServiceProvider.cs
- OleDbParameterCollection.cs
- HttpFileCollection.cs
- sitestring.cs
- TypeSemantics.cs
- EnumType.cs
- PartitionResolver.cs
- Serializer.cs
- DataGridViewCellMouseEventArgs.cs
- WizardForm.cs
- FileAuthorizationModule.cs
- ToolStripDropDown.cs
- OrCondition.cs
- CreateUserWizardAutoFormat.cs
- SqlDelegatedTransaction.cs
- SegmentInfo.cs
- SvcMapFileLoader.cs
- DeferredSelectedIndexReference.cs
- TraceHandler.cs
- FolderNameEditor.cs
- MappedMetaModel.cs
- RemotingConfigParser.cs
- ActivityDesigner.cs
- MbpInfo.cs
- UIAgentRequest.cs
- SiteMap.cs
- Rect3D.cs
- CharStorage.cs
- ScalarOps.cs
- DuplicateWaitObjectException.cs
- ScrollChrome.cs
- RegisteredExpandoAttribute.cs
- PrimarySelectionAdorner.cs
- RequiredArgumentAttribute.cs
- Line.cs
- ElementNotAvailableException.cs
- Vector.cs
- DataServiceKeyAttribute.cs
- KeyFrames.cs
- EntityKey.cs
- ScrollChangedEventArgs.cs
- XmlSchemaComplexType.cs
- Brush.cs
- MasterPage.cs
- Size3DValueSerializer.cs
- PersonalizationEntry.cs
- SqlTriggerContext.cs
- DataGridView.cs
- XmlSchemaSimpleContent.cs
- DynamicPropertyHolder.cs
- HashMembershipCondition.cs
- HuffModule.cs
- DescendentsWalkerBase.cs
- ZeroOpNode.cs
- StreamResourceInfo.cs
- Matrix3D.cs
- XmlSchemaComplexContent.cs
- newinstructionaction.cs
- CultureTableRecord.cs
- TargetControlTypeAttribute.cs
- Function.cs
- WindowHideOrCloseTracker.cs
- RewritingProcessor.cs
- UICuesEvent.cs
- XmlWellformedWriter.cs
- GenerateTemporaryTargetAssembly.cs
- Relationship.cs
- DropShadowEffect.cs
- Connector.cs
- SqlClientWrapperSmiStreamChars.cs
- Formatter.cs
- ObjectPropertyMapping.cs
- OutputCacheModule.cs
- DocumentViewerHelper.cs
- HttpPostServerProtocol.cs
- ClientTargetCollection.cs
- BridgeDataReader.cs
- SurrogateEncoder.cs
- GetTokenRequest.cs
- XmlConverter.cs
- Int32EqualityComparer.cs
- AdjustableArrowCap.cs
- GroupBoxAutomationPeer.cs
- BindingManagerDataErrorEventArgs.cs
- StringPropertyBuilder.cs
- AtomicFile.cs
- DataListItemEventArgs.cs
- TraceSection.cs
- DBSqlParserColumnCollection.cs