Platform SDK: Performance Monitoring

PdhUpdateLog

The PdhUpdateLog function updates the current query and writes new data to the log file.

PDH_STATUS PdhUpdateLog(
  HLOG hLog,             
  LPCTSTR szUserString  
);

Parameters

hLog
[in] A handle to the log file to be updated.
szUserString
[in] A pointer to a null-terminated string containing the data to be added to the log file. This is generally used for comments within the log file.

Return Values

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a PDH error status defined in PDHMsg.h. The following are possible error values.

Error value Description
PDH_INVALID_HANDLE An invalid log file handle was specified.
PDH_INVALID_ARGUMENT A null string was passed in the szUserString parameter.

Remarks

There must be a currently opened query, and the desired counters must be added to it before this function is called. The query handle (hQuery) from PdhOpenQuery is passed to the call to PdhOpenLog before PdhUpdateLog is called.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Pdh.h.
  Library: Use Pdh.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

PdhUpdateLogFileCatalog, PdhGetLogFileSize, PdhOpenQuery, PdhOpenLog