Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeRegistryHandle.cs / 1305376 / SafeRegistryHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // File: SafeRegistryHandle.cs // //[....] // // Implements Microsoft.Win32.SafeHandles.SafeRegistryHandle // // ====================================================================================== #if !FEATURE_PAL namespace Microsoft.Win32.SafeHandles { using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; [System.Security.SecurityCritical] public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid { [System.Security.SecurityCritical] internal SafeRegistryHandle() : base(true) {} [System.Security.SecurityCritical] public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(preexistingHandle); } [System.Security.SecurityCritical] override protected bool ReleaseHandle() { return (RegCloseKey(handle) == Win32Native.ERROR_SUCCESS); } [DllImport(Win32Native.ADVAPI32), SuppressUnmanagedCodeSecurity, ResourceExposure(ResourceScope.None), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] internal static extern int RegCloseKey(IntPtr hKey); } } #endif // !FEATURE_PAL // 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
- SafeNativeMethodsCLR.cs
- DecimalAverageAggregationOperator.cs
- TextElementEnumerator.cs
- ColumnMapProcessor.cs
- ManagementOptions.cs
- ImageFormatConverter.cs
- SemanticAnalyzer.cs
- SHA384CryptoServiceProvider.cs
- EncryptedData.cs
- MatrixCamera.cs
- TrustManagerPromptUI.cs
- XPathConvert.cs
- ListBoxAutomationPeer.cs
- CapabilitiesSection.cs
- WorkflowStateRollbackService.cs
- ActivityStatusChangeEventArgs.cs
- DockAndAnchorLayout.cs
- GorillaCodec.cs
- Encoding.cs
- Point3DCollectionConverter.cs
- Converter.cs
- Variable.cs
- WebHttpSecurityModeHelper.cs
- MailAddressCollection.cs
- TranslateTransform.cs
- PropertyValue.cs
- XmlDataSourceNodeDescriptor.cs
- SingleQueryOperator.cs
- FlowLayout.cs
- PrimaryKeyTypeConverter.cs
- Misc.cs
- ListBoxItemAutomationPeer.cs
- SizeLimitedCache.cs
- SettingsPropertyIsReadOnlyException.cs
- WindowsMenu.cs
- FormViewInsertedEventArgs.cs
- CellParaClient.cs
- SystemUdpStatistics.cs
- _ConnectStream.cs
- Animatable.cs
- TransactedReceiveScope.cs
- ExclusiveNamedPipeTransportManager.cs
- Translator.cs
- ThrowHelper.cs
- SiteMapDataSourceView.cs
- DataGridViewComboBoxColumn.cs
- RadialGradientBrush.cs
- ProtocolsConfigurationEntry.cs
- HashLookup.cs
- NavigateEvent.cs
- MediaSystem.cs
- TextOnlyOutput.cs
- RegexReplacement.cs
- XamlToRtfParser.cs
- SecurityKeyType.cs
- ComponentCollection.cs
- SatelliteContractVersionAttribute.cs
- ChannelSinkStacks.cs
- AnonymousIdentificationSection.cs
- MetadataArtifactLoaderCompositeResource.cs
- ServerValidateEventArgs.cs
- EventProviderWriter.cs
- PtsHelper.cs
- ClonableStack.cs
- NullableDoubleSumAggregationOperator.cs
- querybuilder.cs
- GlobalizationAssembly.cs
- CompoundFileStorageReference.cs
- Parsers.cs
- ActivitySurrogate.cs
- ButtonField.cs
- StringWriter.cs
- DataTransferEventArgs.cs
- ZipIOBlockManager.cs
- BindingMemberInfo.cs
- ExpressionVisitor.cs
- VarInfo.cs
- OSFeature.cs
- FormConverter.cs
- GACMembershipCondition.cs
- HtmlWindow.cs
- XmlTextReaderImplHelpers.cs
- StylusCaptureWithinProperty.cs
- Int16Animation.cs
- TreeViewEvent.cs
- BStrWrapper.cs
- Repeater.cs
- IntSecurity.cs
- ping.cs
- IndentTextWriter.cs
- DSASignatureDeformatter.cs
- ComponentResourceKeyConverter.cs
- TextContainerChangeEventArgs.cs
- PathData.cs
- DataFormats.cs
- FlowLayoutPanel.cs
- DrawingAttributes.cs
- SqlBulkCopyColumnMapping.cs
- MetaTable.cs
- HttpChannelFactory.cs