Platform SDK: Windows Installer

MsiRecordGetString

The MsiRecordGetString function returns the string value of a record field.

UINT MsiRecordGetString(
  MSIHANDLE hRecord,     // record handle
  unsigned int iField,   // field requested
  LPTSTR szValueBuf,     // buffer to hold string
  DWORD *pcchValueBuf    // pointer to size of buffer
);

Parameters

hRecord
Handle to the record.
iField
Specifies the field requested.
szValueBuf
Specifies a buffer to hold the returned string.
pcchValueBuf
Pointer to the size of the buffer.

Return Values

ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_INVALID_PARAMETER
An invalid parameter was supplied.
ERROR_MORE_DATA
A buffer was too small to hold the entire value.
ERROR_SUCCESS
The function succeeded.

Remarks

If ERROR_MORE_DATA is returned, the parameter which is a pointer gives the size of the buffer required to hold the string. If ERROR_SUCCESS is returned, it gives the number of characters written to the string buffer. Therefore you can get the size of the buffer by passing in an empty string (for example "") for the parameter that specifies the buffer. Do not attempt to determine the size of the buffer by passing in a Null (value=0).

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later. Available as a redistributable.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Msiquery.h.
  Library: Use Msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on all platforms.

See Also

Record Processing Functions