MsiGetUserInfo

[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
);
 

Parameters

szProduct
Specifies the product code for the product to be queried.
lpUserNameBuf
Pointer to a variable that receives the name of the user.
pcchUserNameBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpUserNameBuf parameter. This size should include the terminating null character..
lpOrgNameBuf
Pointer to a buffer that receives the organization name.
pcchOrgNameBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpOrgNameBuf parameter. This size should include the terminating null character.
lpSerialBuf
Pointer to a buffer that receives the product ID.
pcchSerialBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpSerialBuf parameter. This size should include the terminating null character.

Return Values

USERINFOSTATE_ABSENT
Some or all of the user information is absent.
USERINFOSTATE_INVALIDARG
One of the function parameters was invalid.
USERINFOSTATE_MOREDATA
A buffer is too small to hold the requested data.
USERINFOSTATE_PRESENT
The function completed successfully.
USERINFOSTATE_UNKNOWN
The product code does not identify a known product.

Remarks

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.

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

System Status Functions