MsiGetProductProperty

[This is preliminary documentation and subject to change.]

The MsiGetProductProperty function retrieves product properties. These properties are in the product database.

UINT MsiGetProductProperty(
  MSIHANDLE hProduct,   // product handle obtained from MsiOpenProduct
  LPCTSTR szProperty,   // property name, case-sensitive
  LPTSTR lpValueBuf,    // returned value, NULL if not desired
  DWORD *pcchValueBuf   // in/out buffer character count
);
 

Parameters

hProduct
Handle to the product obtained from MsiOpenProduct.
szProperty
Specifies the property to retrieve. This is case-sensitive.
lpValueBuf
Pointer to a buffer that receives the property value. The value is truncated and null-terminated if lpValueBuf is too small. This parameter can be NULL.
pcchValueBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpValueBuf parameter. This size should include the terminating NULL character.

If lpValueBuf is NULL, pcchValueBuf can be NULL.

Return Values

ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_INVALID_HANDLE
An invalid handle was passed to the function.
ERROR_MORE_DATA
A buffer is too small to hold the entire property value.
ERROR_SUCCESS
The function completed successfully.

Remarks

When the MsiGetProductProperty function returns, the pcchValueBuf parameter contains the length of the class string stored in the buffer. The count returned does not include the terminating NULL character. If the buffer is not big enough, MsiGetProductProperty returns ERROR_MORE_DATA, and MsiGetProductProperty contains the size of the string, in characters, without counting the NULL character.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msi.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Product Query Functions