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
- TextElement.cs
- BlobPersonalizationState.cs
- ExpressionEditorAttribute.cs
- UnsafeNativeMethods.cs
- MailMessageEventArgs.cs
- ResourceDescriptionAttribute.cs
- SafeThemeHandle.cs
- BufferAllocator.cs
- ControlType.cs
- WpfKnownMember.cs
- DataBindingCollection.cs
- TextServicesCompartment.cs
- EpmSourceTree.cs
- SHA1Managed.cs
- AdCreatedEventArgs.cs
- FileRecordSequenceHelper.cs
- XmlNamedNodeMap.cs
- TrackingRecord.cs
- Win32PrintDialog.cs
- SoapSchemaMember.cs
- Listbox.cs
- AlphabeticalEnumConverter.cs
- CharEnumerator.cs
- ProfileServiceManager.cs
- MenuItemBinding.cs
- DataRow.cs
- IPGlobalProperties.cs
- __Filters.cs
- DataBinding.cs
- CancelEventArgs.cs
- WebPartHelpVerb.cs
- SchemaElementLookUpTable.cs
- TextProperties.cs
- Misc.cs
- DataGridView.cs
- CaseStatementProjectedSlot.cs
- ManualResetEvent.cs
- BamlRecordWriter.cs
- mactripleDES.cs
- SqlMethods.cs
- EventRecord.cs
- ListSortDescriptionCollection.cs
- ConsoleKeyInfo.cs
- Metafile.cs
- XNodeSchemaApplier.cs
- RectAnimationUsingKeyFrames.cs
- ADRoleFactory.cs
- InputMethodStateTypeInfo.cs
- TemplateParser.cs
- ParameterExpression.cs
- PlainXmlWriter.cs
- DockAndAnchorLayout.cs
- Bitmap.cs
- ExeContext.cs
- ValidationRuleCollection.cs
- ThreadExceptionEvent.cs
- ThreadAttributes.cs
- isolationinterop.cs
- DataGridViewCellEventArgs.cs
- MultipartContentParser.cs
- ApplicationCommands.cs
- CoreSwitches.cs
- assertwrapper.cs
- TextServicesDisplayAttribute.cs
- ValidationService.cs
- CryptoApi.cs
- SemanticResolver.cs
- HttpListenerContext.cs
- ProvidersHelper.cs
- SoapInteropTypes.cs
- Thread.cs
- OleAutBinder.cs
- UserMapPath.cs
- ReceiveSecurityHeader.cs
- WebPartConnection.cs
- StringUtil.cs
- Route.cs
- PixelShader.cs
- BuildManagerHost.cs
- Point.cs
- CachedBitmap.cs
- SequenceQuery.cs
- IRCollection.cs
- DesignerTransactionCloseEvent.cs
- ActivityScheduledQuery.cs
- MessageDispatch.cs
- RewritingPass.cs
- SequentialOutput.cs
- UseAttributeSetsAction.cs
- RectAnimation.cs
- AbandonedMutexException.cs
- SamlAttributeStatement.cs
- BrowsableAttribute.cs
- HttpCacheVary.cs
- HttpListenerException.cs
- ToolStripContainer.cs
- DoubleLinkListEnumerator.cs
- DbParameterCollectionHelper.cs
- PropVariant.cs
- HasCopySemanticsAttribute.cs