Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / SafeRegistryKey.cs / 1305376 / SafeRegistryKey.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.Tools.ServiceModel.WsatConfig { using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using Microsoft.Win32.SafeHandles; sealed class SafeRegistryKey : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeRegistryKey() : base(false) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeRegistryKey(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(preexistingHandle); } protected override bool ReleaseHandle() { // Returns a Win32 error code, 0 for success int r = SafeNativeMethods.RegCloseKey(handle); return r == 0; } } } // 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
- NativeCompoundFileAPIs.cs
- NativeMethods.cs
- Selector.cs
- Compress.cs
- EFDataModelProvider.cs
- CriticalHandle.cs
- DropShadowBitmapEffect.cs
- WS2007HttpBindingElement.cs
- Win32PrintDialog.cs
- NameValueSectionHandler.cs
- SqlDataReaderSmi.cs
- hwndwrapper.cs
- ToolStripOverflowButton.cs
- XhtmlTextWriter.cs
- DesigntimeLicenseContext.cs
- GridViewRowPresenter.cs
- DiscoveryClientRequestChannel.cs
- BitmapDownload.cs
- ChildTable.cs
- ACL.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- ImageButton.cs
- MimeObjectFactory.cs
- MLangCodePageEncoding.cs
- UIPropertyMetadata.cs
- RequiredAttributeAttribute.cs
- MeasureData.cs
- InfoCardUIAgent.cs
- AudioFormatConverter.cs
- CqlParserHelpers.cs
- StringTraceRecord.cs
- CodeRegionDirective.cs
- TextTreeText.cs
- PrintPreviewControl.cs
- ExpanderAutomationPeer.cs
- TextBoxBase.cs
- WebBrowsableAttribute.cs
- HtmlHistory.cs
- BindingSource.cs
- ValidateNames.cs
- ApplicationTrust.cs
- ParsedAttributeCollection.cs
- DesignerDeviceConfig.cs
- DocumentApplicationJournalEntry.cs
- ObjectTypeMapping.cs
- UnsafeNetInfoNativeMethods.cs
- FeatureManager.cs
- KnownTypeAttribute.cs
- MissingManifestResourceException.cs
- InterleavedZipPartStream.cs
- EventHandlersStore.cs
- ServiceAuthorizationBehavior.cs
- FocusChangedEventArgs.cs
- ISAPIWorkerRequest.cs
- CompletedAsyncResult.cs
- WsdlBuildProvider.cs
- CodeIdentifier.cs
- FixedSOMImage.cs
- DesignerImageAdapter.cs
- IntersectQueryOperator.cs
- IntegerCollectionEditor.cs
- CultureInfoConverter.cs
- NextPreviousPagerField.cs
- ComplexType.cs
- QueryOperator.cs
- TreeView.cs
- Types.cs
- WebMessageFormatHelper.cs
- validationstate.cs
- PlainXmlSerializer.cs
- CollectionContainer.cs
- ConnectionString.cs
- HttpListenerRequest.cs
- TextTabProperties.cs
- XamlToRtfWriter.cs
- TextRangeEdit.cs
- SymbolEqualComparer.cs
- WebPartUtil.cs
- ZoneIdentityPermission.cs
- RunWorkerCompletedEventArgs.cs
- PerSessionInstanceContextProvider.cs
- CompilerTypeWithParams.cs
- ToolboxItemCollection.cs
- PersonalizableAttribute.cs
- OutputCacheSettings.cs
- ComPlusTraceRecord.cs
- RadioButtonPopupAdapter.cs
- shaper.cs
- EdgeProfileValidation.cs
- NativeMethods.cs
- TTSEngineProxy.cs
- ClientUrlResolverWrapper.cs
- ExpressionNormalizer.cs
- ImageSourceConverter.cs
- TextStore.cs
- PackageFilter.cs
- VectorKeyFrameCollection.cs
- BamlMapTable.cs
- CompilerInfo.cs
- WebExceptionStatus.cs