MsiEnumClientsA function

The MsiEnumClients function enumerates the clients for a given installed component. The function retrieves one product code each time it is called.

Syntax

UINT MsiEnumClientsA(
  LPCSTR szComponent,
  DWORD  iProductIndex,
  LPSTR  lpProductBuf
);

Parameters

szComponent

Specifies the component whose clients are to be enumerated.

iProductIndex

Specifies the index of the client to retrieve. This parameter should be zero for the first call to the MsiEnumClients function and then incremented for subsequent calls. Because clients are not ordered, any new client has an arbitrary index. This means that the function can return clients in any order.

lpProductBuf

Pointer to a buffer that receives the product code. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character.

Return Value

Value Meaning
ERROR_BAD_CONFIGURATION
The configuration data is corrupt.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_NO_MORE_ITEMS
There are no clients to return.
ERROR_NOT_ENOUGH_MEMORY
The system does not have enough memory to complete the operation. Available with Windows Server 2003.
ERROR_SUCCESS
A value was enumerated.
ERROR_UNKNOWN_COMPONENT
The specified component is unknown.

Remarks

To enumerate clients, an application should initially call the MsiEnumClients function with the iProductIndex parameter set to zero. The application should then increment the iProductIndexparameter and call MsiEnumClients until there are no more clients (that is, until the function returns ERROR_NO_MORE_ITEMS).

When making multiple calls to MsiEnumClients to enumerate all of the component's clients, each call should be made from the same thread.

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