Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#47 JwaWinPerf problem under 64 bit

open
nobody
None
5
2012-05-01
2012-05-01
Patrick
No

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.

Discussion

  • Bento Jesus
    Bento Jesus
    2012-06-03

    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