Export (0) Print
Expand All
Expand Minimize

MsiGetUserInfo function

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

Syntax


USERINFOSTATE MsiGetUserInfo(
  _In_     LPCTSTR szProduct,
  _Out_    LPTSTR lpUserNameBuf,
  _Inout_  DWORD *pcchUserNameBuf,
  _Out_    LPTSTR lpOrgNameBuf,
  _Inout_  DWORD *pcchOrgNameBuf,
  _In_     LPTSTR lpSerialBuf,
  _Inout_  DWORD *pcchSerialBuf
);

Parameters

szProduct [in]

Specifies the product code for the product to be queried.

lpUserNameBuf [out]

Pointer to a variable that receives the name of the user.

pcchUserNameBuf [in, out]

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 [out]

Pointer to a buffer that receives the organization name.

pcchOrgNameBuf [in, out]

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 [in]

Pointer to a buffer that receives the product ID.

pcchSerialBuf [in, out]

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

ValueMeaning
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

Version

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.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiGetUserInfoW (Unicode) and MsiGetUserInfoA (ANSI)

See also

System Status Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft