I have an application that collects Perfmon counter values โโthrough the API open in winreg.h - in order to collect Perfmon counter values, I have to make a call RegQueryValueExWpassing in the Perfmon counter identifier that interests me, and in order to get this identifier, I need to query the registry for the list of Perfmon counter names and go through the search for who is interested
C ++ is not my choice language, so the following example is a shaky example, perhaps with a lot of syntax errors, but you get the idea:
DWORD IdProcessIndex = 0;
WCHAR* RawStrings = new WCHAR[ len ];
WCHAR* pCurrent;
DWORD nLenInChars;
RegQueryValueExW(HKEY_PERFORMANCE_DATA, COUNTER009, 0, 0, (PBYTE)RawStrings, &len)
pCurrent = (WCHAR*)RawStrings;
while ( (nLenInChars = wcslen(pCurrent)) != 0 && IdProcessIndex == 0 )
{
WCHAR* pName;
pName = pCurrent + nLenInChars + 1;
if ( wcscmp( pName, L"ID Process" ) == 0)
{
IdProcessIndex = _wtoi( pCurrent );
}
pCurrent = pName + wcslen( pName ) + 1;
}
WCHAR strIdProcessIndex[32];
_itow( nIdProcessIndex, strIdProcessIndex, 10 );
RegQueryValueExW(HKEY_PERFORMANCE_DATA, strIdProcessIndex, NULL, NULL, (PBYTE)pData, &len)
, ( Windows CE dev) perfmon "ID Process", .
, , , - , , , , ?
( .Net - )