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
- ToolStripPanelDesigner.cs
- IfAction.cs
- ScrollChangedEventArgs.cs
- LabelEditEvent.cs
- Regex.cs
- ContractReference.cs
- BroadcastEventHelper.cs
- SourceItem.cs
- DropTarget.cs
- Polyline.cs
- OrderingInfo.cs
- EntityDataSourceDesigner.cs
- NavigationProgressEventArgs.cs
- Matrix3DConverter.cs
- ScrollItemPattern.cs
- ColumnResizeAdorner.cs
- Parsers.cs
- ControlEvent.cs
- ListView.cs
- GenericUriParser.cs
- ModelFunctionTypeElement.cs
- panel.cs
- PriorityQueue.cs
- HttpContext.cs
- CharConverter.cs
- WindowsGraphicsWrapper.cs
- HttpServerVarsCollection.cs
- ServiceObjectContainer.cs
- ImportCatalogPart.cs
- ServiceDescriptions.cs
- StrictAndMessageFilter.cs
- BamlLocalizationDictionary.cs
- AQNBuilder.cs
- Comparer.cs
- NamedPipeAppDomainProtocolHandler.cs
- EntityDataSourceDataSelection.cs
- CssStyleCollection.cs
- ControlBindingsConverter.cs
- FixedPageProcessor.cs
- ProvidePropertyAttribute.cs
- TreeViewDesigner.cs
- CreateParams.cs
- WorkflowRuntimeSection.cs
- Point3DValueSerializer.cs
- ServiceOperationParameter.cs
- UniqueSet.cs
- ClrProviderManifest.cs
- ActivationArguments.cs
- BufferedWebEventProvider.cs
- SecurityKeyIdentifierClause.cs
- SubMenuStyle.cs
- MachineSettingsSection.cs
- ProjectedWrapper.cs
- TimeStampChecker.cs
- OpenTypeLayoutCache.cs
- RepeaterCommandEventArgs.cs
- HttpListenerPrefixCollection.cs
- _ContextAwareResult.cs
- XmlArrayItemAttributes.cs
- IndentedWriter.cs
- FrameAutomationPeer.cs
- SQLGuidStorage.cs
- DataSpaceManager.cs
- Grid.cs
- ErasingStroke.cs
- SqlRowUpdatingEvent.cs
- ThumbButtonInfoCollection.cs
- IteratorFilter.cs
- TextTreeUndo.cs
- xmlformatgeneratorstatics.cs
- ApplicationInterop.cs
- EditingCommands.cs
- PointHitTestResult.cs
- XmlCodeExporter.cs
- TextTreeFixupNode.cs
- DataMemberFieldEditor.cs
- Mappings.cs
- PrivilegedConfigurationManager.cs
- BindingListCollectionView.cs
- RegexCompiler.cs
- GridViewColumnCollection.cs
- RemotingConfigParser.cs
- ControlPersister.cs
- OdbcEnvironmentHandle.cs
- CharacterHit.cs
- SourceItem.cs
- RoutedEventArgs.cs
- SimpleLine.cs
- HashStream.cs
- EventLogInternal.cs
- OdbcDataReader.cs
- GetPageCompletedEventArgs.cs
- SessionPageStateSection.cs
- SharedDp.cs
- GlyphRunDrawing.cs
- SelfSignedCertificate.cs
- AppLevelCompilationSectionCache.cs
- XmlMtomWriter.cs
- StringCollection.cs
- WinEventHandler.cs