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
- EntityViewContainer.cs
- SecureStringHasher.cs
- MethodRental.cs
- LinqDataSourceInsertEventArgs.cs
- RectAnimationClockResource.cs
- ApplicationTrust.cs
- ReceiveReply.cs
- GridViewRow.cs
- AssemblyInfo.cs
- FilteredDataSetHelper.cs
- ConcurrencyMode.cs
- ElementNotAvailableException.cs
- ActivityBindForm.cs
- FileEnumerator.cs
- FixedSOMTableCell.cs
- CellParaClient.cs
- CategoryState.cs
- RelationshipConstraintValidator.cs
- SingleSelectRootGridEntry.cs
- PerformanceCounterCategory.cs
- CompletionProxy.cs
- TagPrefixInfo.cs
- ProfileModule.cs
- DataRow.cs
- ScriptControlDescriptor.cs
- Polygon.cs
- FormViewRow.cs
- ForEachAction.cs
- PropertyItemInternal.cs
- ObjectDataSource.cs
- EdmRelationshipRoleAttribute.cs
- ImmutableObjectAttribute.cs
- GroupQuery.cs
- Scheduling.cs
- MetadataFile.cs
- LiteralLink.cs
- AppearanceEditorPart.cs
- VirtualDirectoryMappingCollection.cs
- IdleTimeoutMonitor.cs
- ContentTextAutomationPeer.cs
- GridViewColumnCollection.cs
- StyleModeStack.cs
- Compiler.cs
- CatalogZone.cs
- ISAPIApplicationHost.cs
- DataGridViewCellPaintingEventArgs.cs
- StatusBarAutomationPeer.cs
- ObjectListCommandsPage.cs
- WmfPlaceableFileHeader.cs
- ScrollViewer.cs
- HMACSHA512.cs
- WebResponse.cs
- SetStoryboardSpeedRatio.cs
- DomainUpDown.cs
- CollectionEditor.cs
- FormatConvertedBitmap.cs
- LayoutManager.cs
- WebPartVerbsEventArgs.cs
- UrlPropertyAttribute.cs
- ObjectConverter.cs
- ComEventsMethod.cs
- BaseHashHelper.cs
- ReadOnlyCollection.cs
- TabControl.cs
- FileSystemInfo.cs
- XmlSchemaSet.cs
- InvalidAsynchronousStateException.cs
- CheckableControlBaseAdapter.cs
- hresults.cs
- XmlTypeAttribute.cs
- IssuedTokenClientCredential.cs
- StateDesignerConnector.cs
- RawMouseInputReport.cs
- ListView.cs
- UITypeEditors.cs
- ScaleTransform3D.cs
- RotateTransform3D.cs
- Script.cs
- TypeBuilder.cs
- DocumentSequenceHighlightLayer.cs
- ColumnMapProcessor.cs
- Listen.cs
- FormViewRow.cs
- RequestResizeEvent.cs
- FontDriver.cs
- SQLCharsStorage.cs
- OleDbConnection.cs
- StringHandle.cs
- MLangCodePageEncoding.cs
- DataGridViewComboBoxCell.cs
- LayoutTableCell.cs
- XPathChildIterator.cs
- TransactionsSectionGroup.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- X509Extension.cs
- ControlEvent.cs
- ButtonBaseAdapter.cs
- WebPartTransformerAttribute.cs
- TargetControlTypeAttribute.cs
- UrlParameterReader.cs