JwaWinPerf problem under 64 bit
Brought to you by:
dezipaitor,
rweijnen
JwaWinPerf defines a few types that contain "Reserved" fields, all of type LPWSTR. No problem under 32 bit, but when the same record types are compiled under 64 bit, these fields cause the record to be larger. Since RegQueryValueEx(HKEY_PERFORMANCE_DATA) returns a binary blob, the types from JwaWinPerf (namely _PERF_OBJECT_TYPE and _PERF_COUNTER_DEFINITION) mismatch with the actual data.
To 'fix' this, replace all LPWSTR types with _LPWSTR, and define that to an UInt32. Once that's done, reading performance data seems to work again (somewhat) reliably.
I agree, actually just following wiperf.h is easy to fix. For example, in_PERF_OBJECT_TYPE
#ifdef _WIN64
DWORD ObjectNameTitle; // Should use this as an offset
#else
LPWSTR ObjectNameTitle; // Initially NULL, for use by
// analysis program to point to
// retrieved title string
#endif