Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HKEY_PERFORMANCE_DATA

305 views
Skip to first unread message

Jury Shmarygo

unread,
Jun 10, 1999, 3:00:00 AM6/10/99
to
Hello

Can anyone explain me what is going on when I call
RegQueryValueExW(HKEY_PERFORMANCE_DATA, L"Counter 009", NULL, dwType,
pDataBuffer, &dwDataBufferSize); ?

Why the value of "Counter" value is changed under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\019
key (I have system default locale set to Russian) when I change my locale?

Configuration: I have WindowsNT4.0 Server, SP4.
Thanks,
Jury


Slava M. Usov

unread,
Jun 10, 1999, 3:00:00 AM6/10/99
to

Jury Shmarygo <ju...@vest.msk.ru> wrote in message
news:#elNgA2s#GA....@cppssbbsa02.microsoft.com...

> Hello
>
> Can anyone explain me what is going on when I call
> RegQueryValueExW(HKEY_PERFORMANCE_DATA, L"Counter 009", NULL, dwType,
> pDataBuffer, &dwDataBufferSize); ?

"Counter 009" does not seem to be a correct value; first, it must be just
"009"; second, if I remember correctly, counter values are even; the odd
values are reserved for descriptions.

> Why the value of "Counter" value is changed under
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\019
> key (I have system default locale set to Russian) when I change my locale?

Sorry, could you explain in more details what and how is changed?

--

Slava

Please send any replies to this newsgroup.


Felix Kasza [MVP]

unread,
Jun 10, 1999, 3:00:00 AM6/10/99
to
Jury,

> Why the value of "Counter" value is changed under
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\019
> key (I have system default locale set to Russian) when I change my locale?

Counter IDs (which, as Slava said, are even) are assigned on a
first-come, first-served base. Different perflibs may choose to install
different counters for different language IDs. Do not rely on their
values, look in the registry instead.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.
Note to spammers: fel...@mvps.org is my real email address.
No anti-spam address here. Just one comment: IN YOUR FACE!

Jury Shmarygo

unread,
Jun 11, 1999, 3:00:00 AM6/11/99
to
1. As Slava wrote according to documentation I can call RegQueryValueEx
passing HKEY_PERFORMANCE_DATA and a string "Global" or string with counter
numbers divided with spaces etc. But if you look at Perfmon code (it is
shiped with VC++ 5.0 SAMPLES\SDK\SDKTOOLS\WINNT\PERFMON) it calls
RegQueryValueEx passes HKEY_PERFORMANCE_DATA and string "Counter 009" (the
number depends on user locale) to get the counter names if the Version is
greater then 0x10000 (HKLM\.......\Perflib key). If version is equal or less
then 0x10000 it opens 009 subkey and reads Counter value. I'm not going to
use undocument resources of RegQueryValueEx function, I just want to
understand what counter names Permon actually gets.
2. I have very strange behavior. Here the steps I performed to test:
1) Change locale to German(Standart), append "Test" string to Counter value
under each subkey (009 and 019 subkeys; 009 contains full set of counter
names, but Counter value is empty under 019 subkey) of
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib key.
2) Change locale to English(U.S.), look at Couter value. Under 009 subkey it
the same as it was, but under 019 subkey Counter value contains full set of
counter names. Now remove the "Test" string from Counter value under each
subkey (009 and 019)
3) Again change locale to German(Standart). Now Counter value under 009
subkey does not contain "Test" string, but under 019 subkey Counter value
contains the only string "Test". Why can this happen?
All the time I had system default locale set to "Russian" on English Windows
NT40 Server SP4. After changing locale I had to restart regedt32 in order to
see the changes.

The real question is: How should I register my counter names that they could
be seen under perfmon independ of what locale is set? Writing to Couter
value under each subkey of HKLM\.....\Perflib does not seem to be the right
way.

Perhaps you can advise me more appropriate conference?

Thanks for answering.

Felix Kasza [MVP] wrote in message <376118c5....@207.46.180.23>...

Slava M. Usov

unread,
Jun 11, 1999, 3:00:00 AM6/11/99
to

Jury Shmarygo <ju...@vest.msk.ru> wrote in message
news:eyuf4o9s#GA.212@cppssbbsa03...

> 1. As Slava wrote according to documentation I can call RegQueryValueEx
> passing HKEY_PERFORMANCE_DATA and a string "Global" or string with counter
> numbers divided with spaces etc. But if you look at Perfmon code (it is
> shiped with VC++ 5.0 SAMPLES\SDK\SDKTOOLS\WINNT\PERFMON) it calls
> RegQueryValueEx passes HKEY_PERFORMANCE_DATA and string "Counter 009" (the
> number depends on user locale) to get the counter names if the Version is
> greater then 0x10000 (HKLM\.......\Perflib key). If version is equal or
less
> then 0x10000 it opens 009 subkey and reads Counter value.

Interesting. Time to look into the perfmon code again...

> 2. I have very strange behavior. Here the steps I performed to test:
> 1) Change locale to German(Standart), append "Test" string to Counter
value
> under each subkey (009 and 019 subkeys; 009 contains full set of counter
> names, but Counter value is empty under 019 subkey) of
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib
key.
> 2) Change locale to English(U.S.), look at Couter value. Under 009 subkey
it
> the same as it was, but under 019 subkey Counter value contains full set
of
> counter names. Now remove the "Test" string from Counter value under each
> subkey (009 and 019)
> 3) Again change locale to German(Standart). Now Counter value under 009
> subkey does not contain "Test" string, but under 019 subkey Counter value
> contains the only string "Test". Why can this happen?

No idea. Looks like some piece of code tracks changes of counter
names/descriptions across locale changes.

> The real question is: How should I register my counter names that they
could
> be seen under perfmon independ of what locale is set? Writing to Couter
> value under each subkey of HKLM\.....\Perflib does not seem to be the
right
> way.

Re-read the article "Adding Counter Names and Descriptions to the Registry"
in the Platform SDK.

1. It suggest using "lodctr.exe" or "LoadPerf.dll" to add counters.
2. The .ini file that contains data on objects/counters you're adding must
contain info for ANY language that should be supported; there is NO way to
support ALL languages without actually providing info for ALL of them.

So, I guess you'll be OK if you just create names/descriptions for US
English and Russian and register them via lodctr.exe.

Jury Shmarygo

unread,
Jun 11, 1999, 3:00:00 AM6/11/99
to
>1. It suggest using "lodctr.exe" or "LoadPerf.dll" to add counters.
>2. The .ini file that contains data on objects/counters you're adding must
>contain info for ANY language that should be supported; there is NO way to
>support ALL languages without actually providing info for ALL of them.
>
>So, I guess you'll be OK if you just create names/descriptions for US
>English and Russian and register them via lodctr.exe.


Ok, thanks a lot. Since documentation says to use lodctr.exe may be it is
incorrect to modify land subkey with register function. I'll try the with
lodctr.exe

Felix Kasza [MVP]

unread,
Jun 12, 1999, 3:00:00 AM6/12/99
to

Jury,

> Now Counter value under 009 subkey does not contain "Test"
> string, but under 019 subkey Counter value contains the
> only string "Test". Why can this happen?

I concur with Slava -- use documented methods for adding counters. Doing
it any other way, I got burned.

Felix Kasza [MVP]

unread,
Jun 12, 1999, 3:00:00 AM6/12/99
to

Jury,

> But if you look at Perfmon code [...] it calls RegQueryValueEx


> passes HKEY_PERFORMANCE_DATA and string "Counter 009" (the
> number depends on user locale)

That's nice. However, my SDK documentation says nothing about this, so
I'll stay away from it.

0 new messages