EN
Данное содержимое не доступно на вашем языке, используйте версию на английском языке.

MsiCloseHandle function

The MsiCloseHandle function closes an open installation handle.

Syntax


UINT MsiCloseHandle(
  _In_  MSIHANDLE hAny
);

Parameters

hAny [in]

Specifies any open installation handle.

Return value

ValueMeaning
ERROR_INVALID_HANDLE

An invalid handle was passed to the function.

ERROR_SUCCESS

The function succeeded.

 

Remarks

MsiCloseHandle must be called from the same thread that requested the creation of the handle.

The following functions supply handles that should be closed after use by calling MsiCloseHandle:

MsiCreateRecord
MsiGetActiveDatabase
MsiGetLastErrorRecord
MsiOpenPackage
MsiOpenProduct
MsiOpenDatabase
MsiDatabaseOpenView
MsiViewFetch
MsiViewGetColumnInfo
MsiDatabaseGetPrimaryKeys
MsiGetSummaryInformation
MsiEnableUIPreview

Note that when writing custom actions, it is recommended to use variables of type PMSIHANDLE because the installer closes PMSIHANDLE objects as they go out of scope, whereas you must close MSIHANDLE objects by calling MsiCloseHandle.

For example, if you use code like this:

MSIHANDLE hRec = MsiCreateRecord(3);

Change it to:

PMSIHANDLE hRec = MsiCreateRecord(3);

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

See also

Handle Management Functions

 

 

Добавления сообщества

ДОБАВИТЬ
Показ:
© 2014 Microsoft