News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

HDD activity monitor

Started by MichaelW, March 11, 2006, 09:05:33 AM

Previous topic - Next topic

John

Michael,
It works great on my work machine running Windows 2000.

I get the same error as Vortex on my home machine with XP Pro and SP2. The pdh.dll version is 00000503 and the error code returned is:
C0000BB8

I also don't see the PhysicalDisk counter in the app that farrier posted.

MichaelW

C0000BB8 is PDH_CSTATUS_NO_OBJECT, "The specified machine was found, but no matching performance object was found on that machine."

I have updated the original attachment with a modified version that should work OK with localized languages other than English.

eschew obfuscation

Phoenix


farrier

Phoenix,

Thanks for the list of Index numbers.  Where did you get that list, or did you construct it?

MichaelW,

In your latest 'Multi-Lingual' program, you use the proper index number to retrieve the corresponding string for the index.  You do that for the:

objectName   originally   PhysicalDisk
counterName   originally   % Disk Time

But you leave the

instanceName   originally   _Total

as is.  Would not this normally be translated into the local language?  Or does the underscore imply a Global/Total value?  It seems that this 'instance' has either this _Global/_Total value and then values specific to hardware or software installed on the particular machine.

Thanks for your help with this subject!!

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

MichaelW

Microsoft apparently does not translate the instance names. If I pass the instance name '_Total' to PdhLookupPerfIndexByName it returns PDH_STRING_NOT_FOUND, and an index value of zero. For an index value of zero PdhLookupPerfNameByIndex returns zero, which is ERROR_SUCCESS, but the returned string has a length of zero. This all seems kind of sloppy to me, because while some instance names might be reasonably universal, '_Total' is not.

eschew obfuscation

Vortex

Hi MichaelW,

Many thanks for the new upload, it works fine on my Win XP HE Sp2 :U

Phoenix

Farrier,

this list is a direct copy from the registry. You will find the list of counters (and help) here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009

and there is an additional entry for your local language, i. e. for german:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\007

It took me some time to recall where i found this information, i could have posted the key directly... :red

Regards, Phoenix


Edit:

Additional location: C:\WINDOWS\system32\PerfStringBackup.INI --> [PerfStrings_007] and [PerfStrings_009]

Ghirai

Very nice :U

Works great (XP Pro SP2).
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html