Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / SafeRegistryKey.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ApplicationCommands.cs
- XslException.cs
- EntityContainerEmitter.cs
- ToolStripLabel.cs
- ProgressBarAutomationPeer.cs
- Scalars.cs
- GestureRecognizer.cs
- ScriptMethodAttribute.cs
- FormatSelectingMessageInspector.cs
- PackWebRequest.cs
- MimeBasePart.cs
- PropertyReferenceExtension.cs
- NumberAction.cs
- FlowLayoutPanelDesigner.cs
- Point.cs
- JournalEntryStack.cs
- CrossSiteScriptingValidation.cs
- XmlIlGenerator.cs
- DataTemplate.cs
- ExpressionBuilderContext.cs
- StringWriter.cs
- ConfigXmlText.cs
- UrlMappingCollection.cs
- DbProviderFactoriesConfigurationHandler.cs
- DependencyPropertyValueSerializer.cs
- SiteMapProvider.cs
- SmiEventSink_DeferedProcessing.cs
- DBDataPermission.cs
- SecurityAttributeGenerationHelper.cs
- FaultContractAttribute.cs
- UTF7Encoding.cs
- DiscoveryMessageSequence11.cs
- datacache.cs
- UnsafeCollabNativeMethods.cs
- WindowsEditBox.cs
- AttributeEmitter.cs
- SelectionEditor.cs
- StyleXamlTreeBuilder.cs
- CustomAttribute.cs
- RowsCopiedEventArgs.cs
- PenThreadPool.cs
- SqlTypeSystemProvider.cs
- oledbconnectionstring.cs
- ToolStripDropDownMenu.cs
- ConfigViewGenerator.cs
- OdbcStatementHandle.cs
- RtType.cs
- CompressedStack.cs
- ColumnReorderedEventArgs.cs
- ListBindableAttribute.cs
- OdbcReferenceCollection.cs
- CheckPair.cs
- OdbcConnection.cs
- SafeEventLogWriteHandle.cs
- Int32Storage.cs
- ComponentConverter.cs
- ProfileProvider.cs
- HttpHandlerAction.cs
- TraceListener.cs
- HostUtils.cs
- RootCodeDomSerializer.cs
- PageContentCollection.cs
- RefExpr.cs
- MinMaxParagraphWidth.cs
- UnsafeNativeMethodsPenimc.cs
- SiteMapDataSource.cs
- WindowsFormsSynchronizationContext.cs
- FormViewUpdateEventArgs.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- UnmanagedMemoryStream.cs
- UrlParameterWriter.cs
- BinaryWriter.cs
- KernelTypeValidation.cs
- _NegoStream.cs
- PersonalizationDictionary.cs
- DesignerActionItemCollection.cs
- TransformGroup.cs
- BamlMapTable.cs
- wgx_commands.cs
- CallSiteHelpers.cs
- XomlCompilerHelpers.cs
- ApplicationSecurityInfo.cs
- GatewayDefinition.cs
- AutoResetEvent.cs
- RemotingConfiguration.cs
- CodeNamespaceImportCollection.cs
- CodeEntryPointMethod.cs
- OverrideMode.cs
- ActivityTypeDesigner.xaml.cs
- ImageCreator.cs
- TextRenderer.cs
- GenerateTemporaryAssemblyTask.cs
- SmtpNetworkElement.cs
- PackageDigitalSignatureManager.cs
- HttpMethodAttribute.cs
- GridViewCommandEventArgs.cs
- SortableBindingList.cs
- LayoutUtils.cs
- TemplatedControlDesigner.cs
- NativeRecognizer.cs