[This is preliminary documentation and subject to change.]
The MsiGetUserInfo function returns the registered user information for an installed product.
USERINFOSTATE MsiGetUserInfo(
LPCTSTR szProduct, // product code
LPTSTR lpUserNameBuf, // buffer to return user name
DWORD *pcchUserNameBuf, // in/out buffer character count,
// including NULL
LPTSTR lpOrgNameBuf, // buffer to return organization name
DWORD *pcchOrgNameBuf, // in/out buffer character count,
// including NULL
LPTSTR lpSerialBuf, // buffer to return product ID
DWORD *pcchSerialBuf // in/out buffer character count,
// including NULL
);
When the MsiGetUserInfo function returns, the pcchNameBuf 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, the MsiGetUserInfo function returns USERINFOSTATE_MOREDATA, and MsiGetUserInfo contains the size of the string, in characters, without counting the NULL character.
The user information is considered to be present even in the absence of a company name.
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.