MsiGetUserInfoA function

The MsiGetUserInfo function returns the registered user information for an installed product.

Syntax

USERINFOSTATE MsiGetUserInfoA(
  LPCSTR  szProduct,
  LPSTR   lpUserNameBuf,
  LPDWORD pcchUserNameBuf,
  LPSTR   lpOrgNameBuf,
  LPDWORD pcchOrgNameBuf,
  LPSTR   lpSerialBuf,
  LPDWORD pcchSerialBuf
);

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. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not 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. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.

Return Value

Value Meaning
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.

Requirements

   
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

See Also

System Status Functions