SetupQueryFileLog

The SetupQueryFileLog function returns information from a setup file log.

BOOL SetupQueryFileLog(
  HSPFILELOG FileLogHandle,  // handle to the log file
  PCTSTR LogSectionName,     // optional, name to group by
  PCTSTR TargetFileName,     // name of target file
  SetupFileLogInfo DesiredInfo,  // specifies info to return
  PTSTR DataOut,             // optional, receives info
  DWORD ReturnBufferSize,    // size of supplied buffer
  PDWORD RequiredSize        // optional, needed buffer size
);
 

Parameters

FileLogHandle
Supplies the handle to the file log as returned by SetupInitializeLogFile.
LogSectionName
This optional parameter supplies the section name for the log file in a format that is meaningful to the caller. Required for non-system logs. If no LogSectionName is specified for a system log, a default is supplied.
TargetFileName
Supplies the name of the file for which log information is desired.
DesiredInfo
Indicates what information should be returned to the DataOut buffer. It can take one of the following enumerated values:
Value Meaning
SetupFileLogSourceFilename The name of the source file as it exists on the source media
SetupFileLogChecksum A 32-bit checksum value used by the system log
SetupFileLogDiskTagfile The name of the tag file of the media source containing the source file
SetupFileLogDiskDescription The human-readable description of the media where the source file resides
SetupFileLogOtherInfo Additional information associated with the logged file

DataOut
This optional parameter points to a caller-supplied buffer in which this function returns the requested information for the file. Not all information is provided for every file. An error is not returned if an empty entry for the file exists in the log.
ReturnBufferSize
Supplies the size of the buffer, pointed to by DataOut. If the buffer is too small and DataOut is specified, data is not stored in the buffer and the function returns zero. If DataOut is not specified, the ReturnBufferSize parameter is ignored.
RequiredSize
This optional parameter points to a caller-supplied variable in which this function returns the required size of DataOut.

Return Values

If the function succeeds, the return value is a non-zero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

For the Unicode version of this function, the buffer sizes ReturnBufferSize, and ReturnRequiredSize are specified in number of characters. This number includes the null terminator. For the ANSI version of this function, the sizes are specified in number of bytes.

If this function is called with a ReturnBuffer of NULL and a ReturnBufferSize of zero, the function puts the buffer size needed to hold the specified data into the variable pointed to by RequiredSize. If the function succeeds in this, the return value is a non-zero value. Otherwise, the return value is zero and extended error information can be obtained by calling GetLastError.

Thus, you can call the function once to get the required buffer size, allocate the necessary memory, and then call the function a second time to retrieve the data. Using this technique, you can avoid errors due to an insufficient buffer size.

Remarks

If the value of DesiredInfo is greater than SetupFileLogOtherInfo the function will fail, and GetLastError will return ERROR_INVALID_PARAMETER.

QuickInfo

  Windows NT: Use version 4.0 and later.
  Windows: Use Windows 95 and later.
  Windows CE: Unsupported.
  Header: Declared in setupapi.h.
  Import Library: Link with setupapi.lib.

See Also

Overview, Functions, SetupLogFile