Skip to content

InstallerHandle Class

Base class for Windows Installer handle types (Database, View, Record, SummaryInfo).

MethodDescription
Close()Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .
Dispose()Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .
Dispose(disposing)Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .
Equals(obj)Tests whether this handle object is equal to another handle object. Two handle objects are equal if their types are the same and their native integer handles are the same.
GetHashCode()Gets a hash value for the handle object.
PropertyDescription
HandleGets the native integer handle.
IsClosedChecks if the handle is closed. When closed, method calls on the handle object may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .

These classes implement the «see T:System.IDisposable» interface, because they hold unmanaged resources (MSI handles) that should be properly disposed when no longer needed.

WixToolset.Dtf.WindowsInstaller.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .

public void Close()

The finalizer of this class will NOT close the handle if it is still open, because finalization can run on a separate thread from the application, resulting in potential problems if handles are closed from that thread. It is best that the handle be closed manually as soon as it is no longer needed, as leaving lots of unused handles open can degrade performance. This method is merely an alias for the «see M:WixToolset.Dtf.WindowsInstaller.InstallerHandle.Dispose» method. Win32 MSI API: MsiCloseHandle

Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .

public void Dispose()

The finalizer of this class will NOT close the handle if it is still open, because finalization can run on a separate thread from the application, resulting in potential problems if handles are closed from that thread. It is best that the handle be closed manually as soon as it is no longer needed, as leaving lots of unused handles open can degrade performance. Win32 MSI API: MsiCloseHandle

  • M:WixToolset.Dtf.WindowsInstaller.InstallerHandle.Close

Closes the handle. After closing a handle, further method calls may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .

protected void Dispose(
bool disposing
)
ParameterTypeDescription
disposingboolIf true, the method has been called directly or indirectly by a user’s code, so managed and unmanaged resources will be disposed. If false, the method has been called by the runtime from inside the finalizer, and only unmanaged resources will be disposed.

Tests whether this handle object is equal to another handle object. Two handle objects are equal if their types are the same and their native integer handles are the same.

public bool Equals(
System.Object obj
)
ParameterTypeDescription
objSystem.ObjectThe handle object to compare with the current handle object.

bool true if the specified handle object is equal to the current handle object; otherwise false

Gets a hash value for the handle object.

public int GetHashCode()

int A hash code for the handle object.

The hash code is derived from the native integer handle.

Gets the native integer handle.

public IntPtr Handle { get; set; }

Checks if the handle is closed. When closed, method calls on the handle object may throw an «see T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException» .

public bool IsClosed { get; set; }