Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SynchronizedDispatch.cs
- ResourcePart.cs
- WindowsTokenRoleProvider.cs
- CollectionChange.cs
- TextPointer.cs
- __FastResourceComparer.cs
- XmlIgnoreAttribute.cs
- DataGridParentRows.cs
- EditorZoneBase.cs
- AlphaSortedEnumConverter.cs
- CanExecuteRoutedEventArgs.cs
- SafeRightsManagementSessionHandle.cs
- Identity.cs
- CssClassPropertyAttribute.cs
- Latin1Encoding.cs
- SourceSwitch.cs
- DocumentPageView.cs
- ListDictionaryInternal.cs
- OleDbParameterCollection.cs
- VariableDesigner.xaml.cs
- IndexingContentUnit.cs
- ExpressionEditorAttribute.cs
- LeftCellWrapper.cs
- _UriSyntax.cs
- TryExpression.cs
- WebPartConnectionsDisconnectVerb.cs
- ColumnReorderedEventArgs.cs
- ContentElementAutomationPeer.cs
- TextSelectionHighlightLayer.cs
- SqlDataSourceParameterParser.cs
- ServiceProviders.cs
- WebPartEventArgs.cs
- NameValuePair.cs
- ProgressBarAutomationPeer.cs
- HttpFileCollection.cs
- TreeViewImageIndexConverter.cs
- XmlSchemaObject.cs
- PathFigureCollectionConverter.cs
- InlineObject.cs
- BindingExpression.cs
- FrameworkRichTextComposition.cs
- StylusDevice.cs
- MemoryMappedViewStream.cs
- SymbolEqualComparer.cs
- DragDeltaEventArgs.cs
- RuleSetDialog.Designer.cs
- ContextMarshalException.cs
- IndicCharClassifier.cs
- UserControlParser.cs
- UInt16.cs
- LazyTextWriterCreator.cs
- StylusPointPropertyInfoDefaults.cs
- ThicknessAnimation.cs
- UserNamePasswordValidationMode.cs
- DataGridViewComboBoxCell.cs
- ControlValuePropertyAttribute.cs
- SoapEnumAttribute.cs
- RoutedEventConverter.cs
- OleDbRowUpdatedEvent.cs
- ToolStripPanelRow.cs
- AnnotationDocumentPaginator.cs
- MessageBox.cs
- ServiceParser.cs
- BinaryExpressionHelper.cs
- CodeMethodMap.cs
- DoubleAnimationUsingPath.cs
- SerializationException.cs
- ExternalException.cs
- FilteredReadOnlyMetadataCollection.cs
- LambdaCompiler.Address.cs
- WebAdminConfigurationHelper.cs
- FormViewDeletedEventArgs.cs
- ClientBase.cs
- ZipIOFileItemStream.cs
- UriParserTemplates.cs
- DataGridItemEventArgs.cs
- StringBuilder.cs
- RotateTransform3D.cs
- HeaderCollection.cs
- EndpointIdentityExtension.cs
- TcpClientCredentialType.cs
- KeyboardNavigation.cs
- GuidelineSet.cs
- CodeSnippetStatement.cs
- XmlSerializerVersionAttribute.cs
- EmbeddedMailObjectsCollection.cs
- documentsequencetextcontainer.cs
- ReaderContextStackData.cs
- TableSectionStyle.cs
- ParallelLoopState.cs
- CodeGeneratorOptions.cs
- BrowserTree.cs
- LicenseManager.cs
- UrlMapping.cs
- FragmentQueryProcessor.cs
- InstanceCreationEditor.cs
- ListParagraph.cs
- ZoneButton.cs
- PKCS1MaskGenerationMethod.cs
- DragDrop.cs