Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > 'Counter' value of the 'Perflib' subkey

Reply
Thread Tools Display Modes

'Counter' value of the 'Perflib' subkey

 
 
Michelle
Guest
Posts: n/a

 
      06-11-2010

I have a program which queries the 'Counter' value of the 'Perflib' subkey in
the Windows registry using RegQueryValueEx. It used to work fine but now the
debug build of my program is broken on Windows 2008 Server R2.

The 'Counter' value is a REG_MULTI_SZ type data and is terminated with two
NULL characters. However, I found out for Windows 2008 Server R2, the value
returned from RegQueryValueEx has an extra character(0xcdcd) after the two
NULL characters, which ends the 'Counter' string value. And that extra
character causes my program to fail because my code tries to read it.

Looking at the 'Counter' value of the 'Perflib' subkey in the Windows
registry (opened by regedt32), I do see there are two blank lines at the end.
While for other Windows OS (I checked Windows XP x86, Windows 2003 Server R2
x86 and Windows 2003 Server R2 x64), all of them have only one blank line at
the end. Hence it seems the problem is not with RegQueryValueEx , the value
itself contains the extra character after the two null characters. Note that
this problem only happens in DEBUG binary. I guess it is because the memory
is initialized by DEBUG configuration as 0xCDCD. For release build 0x00 is
used hence no problem.

Having said that, does anyone know why the 'Counter' value of the 'Perflib'
subkey in the Windows 2008 Server R2 registry ends with an extra character
after the two nulls, which is different from previous Windows versions?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 2008 Physical Disk Permon Counter Instance Steve Windows Server 0 05-11-2010 12:44 AM
performance counter alert on win2008 inenewbl Windows Server 0 10-28-2009 11:52 AM
Counter Strike: Source Universe_JDJ Windows Vista Games 4 11-09-2007 09:56 AM
counter strike fme008 via WindowsKB.com Windows Vista Games 3 02-19-2007 02:38 AM
Performance Counter Library Values nicktodd Windows Vista Performance 0 11-21-2006 03:49 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59