[Patch] Allow access to /proc/registry/HKEY_PERFORMANCE_DATA

Christian Franke Christian.Franke@t-online.de
Fri Dec 19 13:59:00 GMT 2008


The command 'ls /proc/registry/HKEY_PERFORMANCE_DATA' returns garbage, 
because the registry functions don't work or work different for this 
(pseudo-)key.

This patch fixes the directory listing and allows access to the raw 
binary counter data, e.g.

All Global values, except "Costly" values:
xxd /proc/registry/HKEY_PERFORMANCE_DATA/Global

Prozessor time:
xxd /proc/registry/HKEY_PERFORMANCE_DATA/6

The directory listing is fixed, all lists of numbers are accepted as 
file names.
The actual counter numbers listed in the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib
are not considered yet.

2008-12-19  Christian Franke  <franke@computer.org>

	* fhandler_registry.cc (perf_data_files): New table.
	(PERF_DATA_FILE_COUNT): New constant.
	(fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA
	value names.
	(fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return
	default values only.
	(fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list
	names from perf_data_files only.
	(fhandler_registry::fill_filebuf): Use larger buffer to speed up
	access to HKEY_PERFORMANCE_DATA values.  Remove check for possible
	subkey.  Add RegCloseKey ().
	(open_key): Replace goto by break, remove label.  Do not try to
	open subkey of HKEY_PERFORMANCE_DATA.  Add missing RegCloseKey ()
	after open subkey error.



Christian




-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin-1.7-registry-perfdata.patch
Type: text/x-diff
Size: 4813 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20081219/192e7c9e/attachment.bin>


More information about the Cygwin-patches mailing list