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
- FixUp.cs
- RsaSecurityToken.cs
- MILUtilities.cs
- EventProviderBase.cs
- DiscoveryRequestHandler.cs
- ReliabilityContractAttribute.cs
- CreateUserWizardStep.cs
- WorkflowTerminatedException.cs
- BindingManagerDataErrorEventArgs.cs
- DoubleSumAggregationOperator.cs
- BinaryKeyIdentifierClause.cs
- ComponentChangedEvent.cs
- OneOfScalarConst.cs
- Int32KeyFrameCollection.cs
- DataGridDesigner.cs
- GPRECTF.cs
- VersionedStream.cs
- HttpClientCertificate.cs
- BamlLocalizationDictionary.cs
- XPathDescendantIterator.cs
- ControlUtil.cs
- TrackingParticipant.cs
- ImageListImage.cs
- IntranetCredentialPolicy.cs
- Floater.cs
- InfoCardSymmetricAlgorithm.cs
- PassportAuthentication.cs
- TemplateContentLoader.cs
- ManipulationPivot.cs
- ShapingEngine.cs
- Configuration.cs
- CodeNamespace.cs
- TreeView.cs
- ServiceDocumentFormatter.cs
- SHA512Managed.cs
- BitmapEffectState.cs
- ScrollBarAutomationPeer.cs
- TypeSystemHelpers.cs
- TypeInfo.cs
- ExtractCollection.cs
- LineMetrics.cs
- SecurityUtils.cs
- EpmContentSerializer.cs
- SystemResourceHost.cs
- ComPersistableTypeElementCollection.cs
- ProgressChangedEventArgs.cs
- DataStorage.cs
- SqlFunctionAttribute.cs
- GeometryDrawing.cs
- ValidatingCollection.cs
- PipeStream.cs
- CodeTypeDeclarationCollection.cs
- SystemIPInterfaceStatistics.cs
- DetailsViewRow.cs
- itemelement.cs
- TraceXPathNavigator.cs
- MenuStrip.cs
- TextServicesProperty.cs
- ResourceReader.cs
- _AutoWebProxyScriptHelper.cs
- SAPIEngineTypes.cs
- AnnotationAuthorChangedEventArgs.cs
- KerberosSecurityTokenAuthenticator.cs
- ResourceManagerWrapper.cs
- HyperLinkField.cs
- FontNamesConverter.cs
- XhtmlConformanceSection.cs
- TypeElement.cs
- HtmlLabelAdapter.cs
- GregorianCalendar.cs
- ReflectionPermission.cs
- Debug.cs
- ReferencedType.cs
- RemotingAttributes.cs
- DataError.cs
- NullToBooleanConverter.cs
- DesignerCapabilities.cs
- ProfilePropertyNameValidator.cs
- SymmetricKeyWrap.cs
- DataGridTableStyleMappingNameEditor.cs
- CounterCreationData.cs
- StylusPointPropertyUnit.cs
- AxisAngleRotation3D.cs
- XmlEntityReference.cs
- BoundPropertyEntry.cs
- StackBuilderSink.cs
- PolyLineSegment.cs
- UnconditionalPolicy.cs
- AddInBase.cs
- ZoneIdentityPermission.cs
- XmlSerializer.cs
- ValidatorCollection.cs
- FlowDocumentReader.cs
- ClientBuildManager.cs
- XmlIncludeAttribute.cs
- ProviderUtil.cs
- __Filters.cs
- WebGetAttribute.cs
- CompilationLock.cs
- VariantWrapper.cs