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
- complextypematerializer.cs
- ButtonPopupAdapter.cs
- DragDrop.cs
- DBPropSet.cs
- Renderer.cs
- SrgsElementFactoryCompiler.cs
- GlyphInfoList.cs
- RangeValueProviderWrapper.cs
- PasswordBox.cs
- ZipIOLocalFileHeader.cs
- QueryExtender.cs
- TranslateTransform.cs
- Content.cs
- _TimerThread.cs
- ToolStripDropDownItemDesigner.cs
- XmlSchemaInclude.cs
- Intellisense.cs
- XmlSchemaAppInfo.cs
- ModelFunctionTypeElement.cs
- ImmutableObjectAttribute.cs
- PolyLineSegmentFigureLogic.cs
- GridViewDeleteEventArgs.cs
- SettingsPropertyIsReadOnlyException.cs
- ProxyAssemblyNotLoadedException.cs
- VarRefManager.cs
- CommonProperties.cs
- ListBase.cs
- FirstMatchCodeGroup.cs
- TreeViewHitTestInfo.cs
- DocumentOrderQuery.cs
- CommandLibraryHelper.cs
- Listen.cs
- WebResourceAttribute.cs
- SystemSounds.cs
- SortAction.cs
- XhtmlMobileTextWriter.cs
- FixedSOMGroup.cs
- PermissionSetEnumerator.cs
- OdbcPermission.cs
- ConditionBrowserDialog.cs
- ToolStripItemCollection.cs
- TextSimpleMarkerProperties.cs
- PropertyDescriptorGridEntry.cs
- PrintSystemException.cs
- SystemException.cs
- PriorityChain.cs
- ZipIOExtraFieldZip64Element.cs
- MessageLogger.cs
- ColorDialog.cs
- MD5.cs
- EndPoint.cs
- TouchDevice.cs
- DataGridTable.cs
- Binding.cs
- DataGridRowHeaderAutomationPeer.cs
- StatusBarPanelClickEvent.cs
- TreeNodeConverter.cs
- GregorianCalendar.cs
- SymDocumentType.cs
- PropVariant.cs
- ReflectTypeDescriptionProvider.cs
- RuleSetDialog.Designer.cs
- StateManagedCollection.cs
- ActivityPreviewDesigner.cs
- NumericExpr.cs
- ExpressionConverter.cs
- RectangleHotSpot.cs
- SystemColors.cs
- SafePEFileHandle.cs
- BulletChrome.cs
- PropertyEmitter.cs
- ExpressionBuilderContext.cs
- WhileDesigner.cs
- IIS7WorkerRequest.cs
- UnsupportedPolicyOptionsException.cs
- ScrollBar.cs
- AccessedThroughPropertyAttribute.cs
- SiteMapHierarchicalDataSourceView.cs
- IList.cs
- ADMembershipProvider.cs
- Model3D.cs
- ControlAdapter.cs
- SchemaMapping.cs
- RegexCompiler.cs
- CuspData.cs
- WebGetAttribute.cs
- SessionStateContainer.cs
- PtsHelper.cs
- OdbcPermission.cs
- Emitter.cs
- FunctionUpdateCommand.cs
- SchemaAttDef.cs
- HScrollProperties.cs
- Stylesheet.cs
- WebPartHeaderCloseVerb.cs
- RemoveStoryboard.cs
- HttpWriter.cs
- InvokeBinder.cs
- CompositeScriptReferenceEventArgs.cs
- WebPartZoneBaseDesigner.cs