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
- HandlerBase.cs
- MembershipUser.cs
- SynchronizationContextHelper.cs
- SQLBytes.cs
- GlobalizationAssembly.cs
- XmlEncodedRawTextWriter.cs
- SiteMapDataSourceDesigner.cs
- SplitContainer.cs
- Int64.cs
- BinHexEncoding.cs
- SafeSystemMetrics.cs
- XmlTextWriter.cs
- Nodes.cs
- Timer.cs
- InputReport.cs
- ZipIOExtraField.cs
- ZipIOLocalFileDataDescriptor.cs
- TextAnchor.cs
- XamlPointCollectionSerializer.cs
- WebPartUserCapability.cs
- RichTextBox.cs
- TableHeaderCell.cs
- RotateTransform.cs
- ButtonPopupAdapter.cs
- PackageFilter.cs
- MaxMessageSizeStream.cs
- EdmProperty.cs
- PermissionSet.cs
- ProcessHostMapPath.cs
- DataBinding.cs
- WindowVisualStateTracker.cs
- LabelLiteral.cs
- HelloOperationCD1AsyncResult.cs
- HTMLTagNameToTypeMapper.cs
- NamespaceDecl.cs
- ObjectPersistData.cs
- InfocardChannelParameter.cs
- PowerStatus.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- WebControl.cs
- ScriptingWebServicesSectionGroup.cs
- MenuItemStyle.cs
- ToolStripHighContrastRenderer.cs
- KnownAssembliesSet.cs
- ResourcesGenerator.cs
- InvalidOleVariantTypeException.cs
- Atom10FormatterFactory.cs
- NumericExpr.cs
- ISessionStateStore.cs
- XmlSchemaExternal.cs
- PrivilegeNotHeldException.cs
- ConfigurationCollectionAttribute.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- DoubleKeyFrameCollection.cs
- AttributeCollection.cs
- DataStreamFromComStream.cs
- BamlStream.cs
- SqlConnection.cs
- ProcessHost.cs
- HtmlImage.cs
- UidManager.cs
- PolicyConversionContext.cs
- ManualResetEvent.cs
- SchemaObjectWriter.cs
- _ScatterGatherBuffers.cs
- GenericTextProperties.cs
- Exception.cs
- TextEditorMouse.cs
- SocketManager.cs
- ServiceTimeoutsElement.cs
- XamlPoint3DCollectionSerializer.cs
- PropertyOrder.cs
- BooleanStorage.cs
- CqlIdentifiers.cs
- CodeDirectionExpression.cs
- EDesignUtil.cs
- XmlSchemaObjectCollection.cs
- EntityException.cs
- XmlDictionaryReader.cs
- NetDataContractSerializer.cs
- FixedSOMGroup.cs
- ConstraintEnumerator.cs
- XmlRootAttribute.cs
- XmlReaderSettings.cs
- Soap12FormatExtensions.cs
- TabPanel.cs
- Menu.cs
- ControlType.cs
- PropertyEmitterBase.cs
- GetPageNumberCompletedEventArgs.cs
- RadialGradientBrush.cs
- SoapMessage.cs
- Rfc4050KeyFormatter.cs
- NativeMethods.cs
- KnownBoxes.cs
- ReadOnlyNameValueCollection.cs
- ArrangedElementCollection.cs
- PreApplicationStartMethodAttribute.cs
- CryptoProvider.cs
- DataGridPreparingCellForEditEventArgs.cs