MsiGetLastErrorRecord

[This is preliminary documentation and subject to change.]

The MsiGetLastErrorRecord function returns the error record that was last returned for the calling process.

MSIHANDLE MsiGetLastErrorRecord();
 

Parameters

None

Return Values

A handle to the error record. If the last function was successful, MsiGetLastErrorRecord returns a null MSIHANDLE.

Remarks

With the MsiGetLastErrorRecord function, field 1 of the record contains the MSI error code. Other fields contain data specific to the particular error. The error record is released internally after this function is run.

If the record is passed to MsiProcessMessage, it is formatted by looking up the string in the current database. If there is no install session but a product database is open, the format string may be obtained by a query on the Error table using the error code, followed by a call to MsiFormatRecord. If the error code is known, the parameters may be individually interpreted.

The following functions set the per-process error record or reset it to null if no error occurred (MsiGetLastErrorRecord also clears the error record after returning it).

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 msiquery.h.
  Import Library: Use msi.lib.

See Also

Database Access Reference, Installer State Access Functions