PdhGetLogFileSize function

Returns the size of the specified log file.

Syntax

PDH_FUNCTION PdhGetLogFileSize(
  PDH_HLOG hLog,
  LONGLONG *llSize
);

Parameters

hLog

Handle to the log file. The PdhOpenLog or PdhBindInputDataSource function returns this handle.

llSize

Size of the log file, in bytes.

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_LOG_FILE_OPEN_ERROR
An error occurred when trying to open the log file.
PDH_INVALID_HANDLE
The handle is not valid.

Remarks

If the log file handle points to multiple bound log files, the size is the sum of all the log files. If the log file is a SQL log file, the llSize parameter is the number of records in the 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

PdhOpenLog