SafeProcessHandle(IntPtr, Boolean) Construtor

Definição

Inicializa uma nova instância da classe SafeProcessHandle do identificador especificado, que indica se o identificador deve ser liberado durante a fase de finalização.Initializes a new instance of the SafeProcessHandle class from the specified handle, indicating whether to release the handle during the finalization phase.

public:
 SafeProcessHandle(IntPtr existingHandle, bool ownsHandle);
public SafeProcessHandle (IntPtr existingHandle, bool ownsHandle);
new Microsoft.Win32.SafeHandles.SafeProcessHandle : nativeint * bool -> Microsoft.Win32.SafeHandles.SafeProcessHandle
Public Sub New (existingHandle As IntPtr, ownsHandle As Boolean)

Parâmetros

existingHandle
IntPtr

O identificador a ser encapsulado.The handle to be wrapped.

ownsHandle
Boolean

true para permitir de maneira que confiável que o SafeProcessHandle libere o identificador durante a fase de finalização; caso contrário, false.true to reliably let SafeProcessHandle release the handle during the finalization phase; otherwise, false.

Comentários

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.

Aplica-se a