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
- PipelineModuleStepContainer.cs
- ParsedAttributeCollection.cs
- URLString.cs
- XPathArrayIterator.cs
- DataControlLinkButton.cs
- EntityContainerAssociationSet.cs
- DynamicQueryableWrapper.cs
- CookielessHelper.cs
- RootCodeDomSerializer.cs
- HMACMD5.cs
- Module.cs
- ColorTransformHelper.cs
- ImmutableObjectAttribute.cs
- DocumentSequenceHighlightLayer.cs
- FixedDocumentPaginator.cs
- FusionWrap.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- CodeCommentStatementCollection.cs
- Sequence.cs
- CreateDataSourceDialog.cs
- Vector3D.cs
- UIHelper.cs
- PackageDigitalSignature.cs
- RegisteredArrayDeclaration.cs
- AccessibleObject.cs
- RouteParametersHelper.cs
- Effect.cs
- TdsRecordBufferSetter.cs
- CursorConverter.cs
- CommunicationObjectManager.cs
- DataRecordInfo.cs
- DataControlCommands.cs
- SqlConnectionPoolProviderInfo.cs
- SymDocumentType.cs
- MessageHeaderAttribute.cs
- SmtpFailedRecipientException.cs
- ThreadExceptionDialog.cs
- datacache.cs
- UserControlDesigner.cs
- TerminateDesigner.cs
- FlowDocument.cs
- BrowserPolicyValidator.cs
- DesignerValidatorAdapter.cs
- FixedSOMTableRow.cs
- PostBackOptions.cs
- WindowsFormsSynchronizationContext.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HMACSHA512.cs
- SafeWaitHandle.cs
- ColorAnimation.cs
- SpellerError.cs
- BypassElement.cs
- EncoderReplacementFallback.cs
- TypeGeneratedEventArgs.cs
- TypefaceMetricsCache.cs
- Utilities.cs
- RelatedImageListAttribute.cs
- OutArgument.cs
- DatagridviewDisplayedBandsData.cs
- DocumentXmlWriter.cs
- StdValidatorsAndConverters.cs
- OptimizerPatterns.cs
- ConnectionOrientedTransportElement.cs
- SystemColors.cs
- PopupRoot.cs
- MimeFormImporter.cs
- SystemColors.cs
- ProfileService.cs
- DeferredElementTreeState.cs
- PriorityQueue.cs
- InstancePersistence.cs
- SamlDoNotCacheCondition.cs
- GestureRecognizer.cs
- Debug.cs
- ObjectListFieldsPage.cs
- EllipseGeometry.cs
- HttpResponseHeader.cs
- LinkArea.cs
- FileUtil.cs
- HtmlMeta.cs
- StandardToolWindows.cs
- GiveFeedbackEvent.cs
- ProxyOperationRuntime.cs
- SqlCacheDependencySection.cs
- DataListItemCollection.cs
- DefaultValueConverter.cs
- BufferBuilder.cs
- ToolStripRendererSwitcher.cs
- InternalSafeNativeMethods.cs
- SoapIncludeAttribute.cs
- TreeNodeSelectionProcessor.cs
- DataGridViewCellCancelEventArgs.cs
- TextFormatterImp.cs
- handlecollector.cs
- XmlNodeChangedEventArgs.cs
- GPPOINT.cs
- ProfilePropertySettings.cs
- SelectingProviderEventArgs.cs
- ExclusiveCanonicalizationTransform.cs
- BaseComponentEditor.cs