PdhUpdateLog function

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

Syntax


PDH_STATUS PdhUpdateLog(
  _In_ PDH_HLOG hLog,
  _In_ LPCTSTR  szUserString
);

Parameters

hLog [in]

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

szUserString [in]

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 codeDescription
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]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

Unicode and ANSI names

PdhUpdateLogW (Unicode) and PdhUpdateLogA (ANSI)

See also

PdhGetLogFileSize
PdhOpenLog
PdhOpenQuery
PdhUpdateLogFileCatalog

 

 

Show: