MsiOpenProductW function (msi.h)
The MsiOpenProduct function opens a product for use with the functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.
Syntax
UINT MsiOpenProductW(
[in] LPCWSTR szProduct,
[out] MSIHANDLE *hProduct
);
Parameters
[in] szProduct
Specifies the product code of the product to be opened.
[out] hProduct
Pointer to a variable that receives the product handle.
Return value
Value | Meaning |
---|---|
|
The configuration information is corrupt. |
|
The product could not be opened. |
|
The source was unavailable. |
|
An invalid parameter was passed to the function. |
|
The function completed successfully. |
|
The product code was unrecognized. |
Remarks
Note
The msi.h header defines MsiOpenProduct as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | 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. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |