PdhUpdateLogA function

Collects counter data for the current query and writes the data to the log file.

Syntax

PDH_FUNCTION PdhUpdateLogA(
  PDH_HLOG hLog,
  LPCSTR   szUserString
);

Parameters

hLog

Handle of a single log file to update. The PdhOpenLog function returns this handle.

szUserString

Null-terminated string that contains a user-defined comment to add to the data record. The string can not be empty.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code. The following are possible values.

Return code Description
PDH_INVALID_HANDLE
The log file handle is not valid.
PDH_INVALID_ARGUMENT
An empty string was passed in the szUserString parameter.

Remarks

If you are updating a log file from another log file, the comments from the other log file do not migrate.

Examples

For an example, see Writing Performance Data to a Log File.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header pdh.h
Library Pdh.lib
DLL Pdh.dll

See also

PdhGetLogFileSize

PdhOpenLog

PdhOpenQuery

PdhUpdateLogFileCatalog