SafeRegistryHandle Classe
Definição
Representa um identificador seguro para o Registro do Windows.Represents a safe handle to the Windows registry.
public ref class SafeRegistryHandle sealed : Microsoft::Win32::SafeHandles::SafeHandleZeroOrMinusOneIsInvalid
public ref class SafeRegistryHandle sealed : System::Runtime::InteropServices::SafeHandle
public sealed class SafeRegistryHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
[System.Security.SecurityCritical]
public sealed class SafeRegistryHandle : System.Runtime.InteropServices.SafeHandle
[System.Security.SecurityCritical]
public sealed class SafeRegistryHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
type SafeRegistryHandle = class
inherit SafeHandleZeroOrMinusOneIsInvalid
[<System.Security.SecurityCritical>]
type SafeRegistryHandle = class
inherit SafeHandle
[<System.Security.SecurityCritical>]
type SafeRegistryHandle = class
inherit SafeHandleZeroOrMinusOneIsInvalid
Public NotInheritable Class SafeRegistryHandle
Inherits SafeHandleZeroOrMinusOneIsInvalid
Public NotInheritable Class SafeRegistryHandle
Inherits SafeHandle
- Herança
- Herança
- Herança
- Atributos
Comentários
Você pode usar a invocação de plataforma na função nativa do RegCreateKeyEx Windows para obter um SafeRegistryHandle objeto e, em seguida, usá-lo para criar chaves do registro com o RegistryKey.FromHandle método.You can use platform invoke on the native RegCreateKeyEx Windows function to obtain a SafeRegistryHandle object, and then use it to create registry keys with the RegistryKey.FromHandle method.
Importante
Esse tipo implementa a interface IDisposable.This type implements the IDisposable interface. Quando você terminar de usar o tipo, deverá descartá-lo direta ou indiretamente.When you have finished using the type, you should dispose of it either directly or indirectly. Para descartar o tipo diretamente, chame o método Dispose dele em um bloco try/catch.To dispose of the type directly, call its Dispose method in a try/catch block. Para descartá-lo indiretamente, use um constructo de linguagem como using ( em C#) ou Using (em Visual Basic).To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). Saiba mais na seção "Como usar um objeto que implementa IDisposable" no tópico da interface IDisposable.For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.
Construtores
| SafeRegistryHandle(IntPtr, Boolean) |
Inicializa uma nova instância da classe SafeRegistryHandle.Initializes a new instance of the SafeRegistryHandle class. |
Campos
| handle |
Especifica o identificador a ser encapsulado.Specifies the handle to be wrapped. (Herdado de SafeHandle) |
Propriedades
| IsClosed |
Obtém um valor que indica se o identificador está fechado.Gets a value indicating whether the handle is closed. (Herdado de SafeHandle) |
| IsInvalid |
Obtém um valor que indica se o identificador é inválido.Gets a value that indicates whether the handle is invalid. |
| IsInvalid |
Obtém um valor que indica se o identificador é inválido.Gets a value that indicates whether the handle is invalid. (Herdado de SafeHandleZeroOrMinusOneIsInvalid) |
Métodos
| Close() |
Marca o identificador de liberação de recursos.Marks the handle for releasing and freeing resources. (Herdado de SafeHandle) |
| DangerousAddRef(Boolean) |
Incrementa manualmente o contador de referências em instâncias do SafeHandle.Manually increments the reference counter on SafeHandle instances. (Herdado de SafeHandle) |
| DangerousGetHandle() |
Retorna o valor do campo handle.Returns the value of the handle field. (Herdado de SafeHandle) |
| DangerousRelease() |
Diminui manualmente o contador de referência em uma instância SafeHandle.Manually decrements the reference counter on a SafeHandle instance. (Herdado de SafeHandle) |
| Dispose() |
Libera todos os recursos usados pela classe SafeHandle.Releases all resources used by the SafeHandle class. (Herdado de SafeHandle) |
| Dispose(Boolean) |
Libera os recursos não gerenciados usados pela classe SafeHandle que especifica se deve executar uma operação de descarte normal.Releases the unmanaged resources used by the SafeHandle class specifying whether to perform a normal dispose operation. (Herdado de SafeHandle) |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ReleaseHandle() |
Quando substituído em uma classe derivada, executa o código necessário para liberar o identificador.When overridden in a derived class, executes the code required to free the handle. (Herdado de SafeHandle) |
| SetHandle(IntPtr) |
Define o identificador para o identificador pré-existente especificado.Sets the handle to the specified pre-existing handle. (Herdado de SafeHandle) |
| SetHandleAsInvalid() |
Marca um identificador como não mais usado.Marks a handle as no longer used. (Herdado de SafeHandle) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |