test: perfuser.c File Reference

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# perfuser.c File Reference

`#include <nt.h>`
`#include <ntrtl.h>`
`#include <nturtl.h>`
`#include <windows.h>`
`#include <winuser.h>`
`#include <winperf.h>`
`#include <ntprfctr.h>`
`#include <string.h>`
`#include <wcstr.h>`
`#include "userctrs.h"`
`#include "perfmsg.h"`
`#include "perfutil.h"`
`#include "userdata.h"`

Go to the source code of this file.

## Classes

struct | _tagCSStatistics
struct | _tagInstance

## Defines

#define | ALL_PROCESSES_STRING L"_All Processes"
#define | QUC_PID_TOTAL 0xffffffff
#define | QUERYUSER_TYPE_USER 0x1
#define | QUERYUSER_TYPE_CS 0x2

## Typedefs

typedef _tagCSStatistics | CSSTATISTICS
typedef _tagInstance | ProcessInstance

## Functions

| BOOL (WINAPI *QueryUserCounters)(DWORD
DWORD | GlobalCollect (IN LPWSTR lpValueName, IN OUT LPVOID *lppData, IN OUT LPDWORD lpcbTotalBytes, IN OUT LPDWORD lpNumObjectTypes, IN DWORD dwQueryType)
BOOL | FillInstances (VOID)
BOOL __stdcall | DllInit (IN HANDLE DLLHandle, IN DWORD Reason, IN LPVOID ReservedAndUnused)
DWORD APIENTRY | OpenUserPerformanceData (LPWSTR lpDeviceNames)
DWORD APIENTRY | CollectUserPerformanceData (IN LPWSTR lpValueName, IN OUT LPVOID *lppData, IN OUT LPDWORD lpcbTotalBytes, IN OUT LPDWORD lpNumObjectTypes)
DWORD APIENTRY | CloseUserPerformanceData ()
VOID | CleanUpInstances (VOID)

## Variables

| LPVOID
| DWORD
USER_DATA_DEFINITION | UserDataDefinition
CS_DATA_DEFINITION | CSDataDefinition
ProcessInstance * | gaInstances
int | gNumInstances
PDWORD | gpPid
PDWORD | gpdwResult
DWORD | dwOpenCount
HANDLE | ghHeap
BOOL | gbInitOK
PM_OPEN_PROC | OpenUserPerformanceData
PM_COLLECT_PROC | CollectUserPerformanceData
PM_CLOSE_PROC | CloseUserPerformanceData

## Define Documentation

#define ALL_PROCESSES_STRING L"_All Processes"

| Definition at line 30 of file perfuser.c. Referenced by FillInstances().

#define QUC_PID_TOTAL 0xffffffff

| Definition at line 35 of file perfuser.c. Referenced by _QueryUserHandles(), and FillInstances().

#define QUERYUSER_TYPE_CS 0x2

| Definition at line 37 of file perfuser.c. Referenced by GlobalCollect().

#define QUERYUSER_TYPE_USER 0x1

| Definition at line 36 of file perfuser.c. Referenced by GlobalCollect().

## Typedef Documentation

typedef struct _tagCSStatistics CSSTATISTICS

typedef struct _tagInstance ProcessInstance

## Function Documentation

BOOL | ( | WINAPI * | QueryUserCounters | ) |

| Referenced by _InitializeImmEntryTable(), DllInit(), ECDoIMEMenuCommand(), ImeCopyDataHandler(), CProfileInformationPage::OnInit(), OpenKeyboardLayoutFile(), and WINNLSTranslateMessageK().

VOID CleanUpInstances | ( | VOID |  | ) |

Definition at line 623 of file perfuser.c.

References FREE, gaInstances, gNumInstances, NULL, and VOID().

Referenced by FillInstances().

    00625                    :
    00626     Clean-up previous allocated memory
    00627     Helper function
    00628
    00629 --*/
    00630 {
    00631     int i;
    00632
    00633     if (gaInstances) {
    00634         for (i = 0; i<gNumInstances; i++) {
    00635             FREE(gaInstances[i].pName);
    00636         }
    00637         FREE(gaInstances);
    00638         gaInstances = NULL;
    00639     }
    00640 }

DWORD APIENTRY CloseUserPerformanceData | ( |  | ) |

Definition at line 382 of file perfuser.c.

References dwOpenCount, FREE, gaInstances, gNumInstances, gpdwResult, gpPid, and MonCloseEventLog().

    00384                    :
    00385     This routine closes the open handles to win32k device performance counters
    00386
    00387 Arguments:
    00388     None.
    00389
    00390 Return Value:
    00391     ERROR_SUCCESS
    00392 --*/
    00393
    00394 {
    00395     int i;
    00396     if (!(--dwOpenCount)) { // when this is the last thread...
    00397         MonCloseEventLog();
    00398     }
    00399     if (gpdwResult)
    00400         FREE(gpdwResult);
    00401     if (gpPid)
    00402         FREE(gpPid);
    00403     if (gaInstances) {
    00404         for (i = 0; i<gNumInstances; i++) {
    00405             FREE(gaInstances[i].pName);
    00406         }
    00407         FREE(gaInstances);
    00408     }
    00409     return ERROR_SUCCESS;
    00410 }

DWORD APIENTRY CollectUserPerformanceData | ( | IN LPWSTR | lpValueName,
|  | IN OUT LPVOID * | lppData,
|  | IN OUT LPDWORD | lpcbTotalBytes,
|  | IN OUT LPDWORD | lpNumObjectTypes
| ) |

Definition at line 270 of file perfuser.c.

References APIENTRY, DWORD, gbInitOK, GetQueryType(), GlobalCollect(), IsNumberInUnicodeList(), QUERY_FOREIGN, QUERY_ITEMS, and QUERY_NOCOUNTERS.

    00278                    :    This routine will return the data for the User counters.
    00279
    00280 Arguments:
    00281    IN       LPWSTR   lpValueName
    00282             pointer to a wide character string passed by registry.
    00283    IN OUT   LPVOID   *lppData
    00284          IN: pointer to the address of the buffer to receive the completed
    00285             PerfDataBlock and subordinate structures. This routine will
    00286             append its data to the buffer starting at the point referenced
    00287             by *lppData.
    00288          OUT: points to the first byte after the data structure added by this
    00289             routine. This routine updated the value at lppdata after appending
    00290             its data.
    00291
    00292    IN OUT   LPDWORD  lpcbTotalBytes
    00293          IN: the address of the DWORD that tells the size in bytes of the
    00294             buffer referenced by the lppData argument
    00295          OUT: the number of bytes added by this routine is written to the
    00296             DWORD pointed to by this argument
    00297
    00298    IN OUT   LPDWORD  NumObjectTypes
    00299          IN: the address of the DWORD to receive the number of objects added
    00300             by this routine
    00301          OUT: the number of objects added by this routine is written to the
    00302             DWORD pointed to by this argument
    00303
    00304 Return Value:
    00305
    00306       ERROR_MORE_DATA if buffer passed is too small to hold data
    00307          any error conditions encountered are reported to the event log if
    00308          event logging is enabled.
    00309       ERROR_SUCCESS  if success or any other error. Errors, however are
    00310          also reported to the event log.
    00311 --*/
    00312 {
    00313
    00314     //  Variables for reformatting the data
    00315     PERF_COUNTER_BLOCK      *pPerfCounterBlock;
    00316     USER_DATA_DEFINITION    *pUserDataDefinition;
    00317     ULONG   SpaceNeeded;
    00318     PDWORD  pdwCounter, dwProcList;
    00319     DWORD   dwQueryType;
    00320     DWORD   dwObjects;
    00321     int     i;
    00322
    00323     /*
    00324      * before doing anything else, see if Open went OK
    00325      */
    00326     if (!gbInitOK) {
    00327         // unable to continue because open failed.
    00328         *lpcbTotalBytes = (DWORD) 0;
    00329         *lpNumObjectTypes = (DWORD) 0;
    00330         return ERROR_SUCCESS; // yes, this is a successful exit
    00331     }
    00332
    00333     /*
    00334      * see if this is a foreign (i.e. non-NT) computer data request
    00335      */
    00336     dwQueryType = GetQueryType (lpValueName);
    00337     if (dwQueryType == QUERY_FOREIGN) {
    00338         /*
    00339          * this routine does not service requests for data from
    00340          * Non-NT computers
    00341          */
    00342         *lpcbTotalBytes = (DWORD) 0;
    00343         *lpNumObjectTypes = (DWORD) 0;
    00344         return ERROR_SUCCESS;
    00345     }
    00346     if (dwQueryType == QUERY_ITEMS) {
    00347         if ( !(dwObjects = IsNumberInUnicodeList (lpValueName) )) {
    00348
    00349             /*
    00350              * request received for data object not provided by this routine
    00351              */
    00352             *lpcbTotalBytes = (DWORD) 0;
    00353             *lpNumObjectTypes = (DWORD) 0;
    00354             return ERROR_SUCCESS;
    00355
    00356         }
    00357
    00358         return GlobalCollect(
    00359                 lpValueName,
    00360                 lppData,
    00361                 lpcbTotalBytes,
    00362                 lpNumObjectTypes,
    00363                 dwObjects);
    00364     }
    00365     else {
    00366         /*
    00367          * General request to fill the instance combo-box
    00368          * No need to actually retrieve the counter values
    00369          */
    00370         return GlobalCollect(
    00371                 lpValueName,
    00372                 lppData,
    00373                 lpcbTotalBytes,
    00374                 lpNumObjectTypes,
    00375                 QUERY_NOCOUNTERS);
    00376     }
    00377
    00378     return ERROR_SUCCESS;
    00379 }

BOOL __stdcall DllInit | ( | IN HANDLE | DLLHandle,
|  | IN DWORD | Reason,
|  | IN LPVOID | ReservedAndUnused
| ) |

Definition at line 97 of file perfuser.c.

References BOOL(), DWORD, FALSE, LPVOID, MAX_PATH, and TRUE.

    00102 {
    00103     char szUser32DllPath[MAX_PATH+15];
    00104     HMODULE hUser32Module;
    00105     ReservedAndUnused;
    00106     /*
    00107      *  this will prevent the DLL from getting the DLL_THREAD_* messages
    00108      */
    00109     DisableThreadLibraryCalls (DLLHandle);
    00110
    00111     switch(Reason) {
    00112         case DLL_PROCESS_ATTACH:
    00113
    00114             if (!GetSystemDirectory(szUser32DllPath, MAX_PATH+1)) {
    00115                 return FALSE;
    00116             }
    00117             strcat( szUser32DllPath, "\\user32.dll");
    00118
    00119             hUser32Module = GetModuleHandle(szUser32DllPath);
    00120             if (!hUser32Module) {
    00121                 return FALSE;
    00122             }
    00123             QueryUserCounters = (BOOL (WINAPI  *)(DWORD, LPVOID, DWORD, LPVOID, DWORD ))
    00124                             GetProcAddress(hUser32Module, "QueryUserCounters");
    00125             if (!QueryUserCounters) {
    00126                 return FALSE;
    00127             }
    00128             break;
    00129
    00130         case DLL_PROCESS_DETACH:
    00131             break;
    00132     }
    00133     return TRUE;
    00134 }

BOOL FillInstances | ( | VOID |  | ) |

Definition at line 642 of file perfuser.c.

References ALL_PROCESSES_STRING, ALLOC, BOOL, BYTE, CleanUpInstances(), DWORD, FALSE, FREE, gaInstances, gbInitOK, gNumInstances, gpdwResult, gpPid, _tagInstance::id, L, LOG_USER, NT_SUCCESS, NtQuerySystemInformation(), NULL, NUM_USER_COUNTERS, _tagInstance::pName, QUC_PID_TOTAL, REPORT_ERROR_DATA, _tagInstance::sizeName, and TRUE.

Referenced by GlobalCollect().

    00645                    :
    00646     This routine will fill the gaInstances array when the performance dll is opened
    00647     The data in gaInstances will be used for every Collect call
    00648
    00649 Arguments:      none
    00650
    00651 Return Value:   success status
    00652
    00653 --*/
    00654 {
    00655     PSYSTEM_PROCESS_INFORMATION ProcessInfo;
    00656     ULONG   TotalOffset = 0, ResultLength;
    00657     PWCHAR  p, pPeriod;
    00658     DWORD   status;
    00659     UCHAR   *pLargeBuffer;
    00660     int     cNumAllocatedInstances;
    00661     int     i, oldInstances;
    00662
    00663     oldInstances  = gNumInstances;
    00664     gNumInstances = 0;
    00665
    00666     CleanUpInstances();
    00667
    00668     if (!(pLargeBuffer = ALLOC(sizeof(UCHAR)*64*1024))) {
    00669         REPORT_ERROR_DATA (STATUS_NO_MEMORY, LOG_USER,
    00670                     &status, sizeof(status));
    00671         return FALSE;
    00672     }
    00673
    00674     status = NtQuerySystemInformation(
    00675                 SystemProcessInformation,
    00676                 pLargeBuffer,
    00677                 sizeof(UCHAR)*64*1024,
    00678                 &ResultLength);
    00679     if (!NT_SUCCESS(status)) {
    00680         goto ExitNoMemory;
    00681     }
    00682
    00683     cNumAllocatedInstances = ResultLength/sizeof(SYSTEM_PROCESS_INFORMATION);
    00684     gaInstances = ALLOC(cNumAllocatedInstances*sizeof(ProcessInstance));
    00685     if (!gaInstances) {
    00686
    00687         REPORT_ERROR_DATA (STATUS_NO_MEMORY, LOG_USER,
    00688             &status, sizeof(status));
    00689         goto ExitNoMemory;
    00690     }
    00691
    00692     /*
    00693      * create the first instance named _All Processes so that it will usualy show
    00694      * the first in the list
    00695      */
    00696     gaInstances[gNumInstances].sizeName = sizeof(ALL_PROCESSES_STRING);
    00697     gaInstances[gNumInstances].id = QUC_PID_TOTAL;
    00698     gaInstances[gNumInstances].pName = ALLOC(gaInstances[gNumInstances].sizeName);
    00699     if (!gaInstances[gNumInstances].pName) {
    00700         REPORT_ERROR_DATA (STATUS_NO_MEMORY, LOG_USER,
    00701             &status, sizeof(status));
    00702         goto ExitNoMemory;
    00703     }
    00704     wcscpy(gaInstances[gNumInstances].pName, ALL_PROCESSES_STRING);
    00705     gNumInstances++;
    00706
    00707     ProcessInfo = (PSYSTEM_PROCESS_INFORMATION)pLargeBuffer;
    00708     while (TRUE) {
    00709         if ( ProcessInfo->ImageName.Buffer ) {
    00710             p = wcsrchr(ProcessInfo->ImageName.Buffer, L'\\');
    00711             if ( p ) {
    00712                 p++;
    00713                 }
    00714             else {
    00715                 p = ProcessInfo->ImageName.Buffer;
    00716                 }
    00717             /*
    00718              *  remove .exe from the name
    00719              */
    00720             if (pPeriod =  wcsrchr(p, L'.'))
    00721                 *pPeriod = L'\0';
    00722             }
    00723         else {
    00724                 p = L"SystemProc";
    00725             }
    00726         gaInstances[gNumInstances].sizeName = wcslen(p);
    00727         /*
    00728          *  convert to bytes
    00729          */
    00730         gaInstances[gNumInstances].sizeName = (gaInstances[gNumInstances].sizeName + 1)
    00731                                                 * sizeof(WCHAR);
    00732         gaInstances[gNumInstances].pName = ALLOC(gaInstances[gNumInstances].sizeName);
    00733         if (!gaInstances[gNumInstances].pName) {
    00734             REPORT_ERROR_DATA (STATUS_NO_MEMORY, LOG_USER,
    00735                 &status, sizeof(status));
    00736             goto ExitNoMemory;
    00737         }
    00738         wcscpy(gaInstances[gNumInstances].pName, p);
    00739         gaInstances[gNumInstances].id = (WORD)ProcessInfo->UniqueProcessId;
    00740         gNumInstances++;
    00741
    00742         if (ProcessInfo->NextEntryOffset == 0) {
    00743             break;
    00744         }
    00745         TotalOffset += ProcessInfo->NextEntryOffset;
    00746         ProcessInfo = (PSYSTEM_PROCESS_INFORMATION)((BYTE*)pLargeBuffer + TotalOffset);
    00747     }
    00748
    00749     FREE(pLargeBuffer);
    00750     pLargeBuffer = NULL;
    00751
    00752     if (oldInstances != gNumInstances) {
    00753         /*
    00754          *  adjust the global buffers
    00755          */
    00756         if (gpdwResult)
    00757             FREE(gpdwResult);
    00758         if (gpPid)
    00759             FREE(gpPid);
    00760
    00761         if (!(gpdwResult = ALLOC(sizeof(DWORD)*gNumInstances*NUM_USER_COUNTERS))) {
    00762             gpdwResult = NULL;
    00763             goto ExitNoMemory;
    00764         }
    00765
    00766         if (!(gpPid = ALLOC(sizeof(DWORD)*gNumInstances))) {
    00767             gpPid = NULL;
    00768             goto ExitNoMemory;
    00769         }
    00770         for (i = 0; i < gNumInstances; i++) {
    00771             gpPid[i] = gaInstances[i].id;
    00772         }
    00773     }
    00774     return TRUE;
    00775
    00776 ExitNoMemory:
    00777
    00778     CleanUpInstances();
    00779
    00780     if (pLargeBuffer) {
    00781         FREE(pLargeBuffer);
    00782     }
    00783     gbInitOK = FALSE;
    00784     return FALSE;
    00785
    00786 }
    }

DWORD GlobalCollect | ( | IN LPWSTR | lpValueName,
|  | IN OUT LPVOID * | lppData,
|  | IN OUT LPDWORD | lpcbTotalBytes,
|  | IN OUT LPDWORD | lpNumObjectTypes,
|  | IN DWORD | dwQueryType
| ) |

Definition at line 417 of file perfuser.c.

References _tagCSStatistics::cExclusive, CSDataDefinition, _tagCSStatistics::cShared, DWORD, FillInstances(), gaInstances, gNumInstances, gpdwResult, gpPid, _tagCSStatistics::i64TimeExclusive, _tagInstance::id, LOG_USER, MAX_PATH, NT_SUCCESS, NULL, NUM_CS_COUNTERS, NUM_USER_COUNTERS, PBYTE, QUERY_CS, QUERY_NOCOUNTERS, QUERY_USER, QUERYUSER_TYPE_CS, QUERYUSER_TYPE_USER, REPORT_ERROR, SIZE_OF_CS_PERFORMANCE_DATA, SIZE_OF_USER_PERFORMANCE_DATA, _tagInstance::sizeName, USER_DATA_DEFINITION, UserDataDefinition, and _USER_DATA_DEFINITION::UserObjectType.

Referenced by CollectUserPerformanceData().

    00423 {
    00424     PERF_COUNTER_BLOCK      *pPerfCounterBlock;
    00425     USER_DATA_DEFINITION    *pUserDataDefinition;
    00426     CS_DATA_DEFINITION      *pCSDataDefinition;
    00427     static CSSTATISTICS     PrevCSStatistics;
    00428     static __int64          i64Frecv;
    00429     PERF_INSTANCE_DEFINITION    *pPerfInstanceDefinition;
    00430     PDWORD  pdwCounter;     // write pointer in the lppData
    00431     DWORD   dwTotal, dwSpaceNeeded;
    00432     int     i, counter;
    00433
    00434     /*
    00435      *  FillInstances() is quite expensive and should normally be called only
    00436      *  once, in OpenUserPerformanceData().  The problem is that, when monitoring
    00437      *  remote machines, the Open get called by screg.exe only once, no matter how
    00438      *  many remote "probes" are attached.  So, if there are new processes on the
    00439      *  target machine, they can not be seen by the probes that are added afterwards.
    00440      */
    00441     if (dwQueryType & (QUERY_USER | QUERY_NOCOUNTERS)) {
    00442         if (!FillInstances()) {
    00443             *lpcbTotalBytes = (DWORD) 0;
    00444             *lpNumObjectTypes = (DWORD) 0;
    00445             return ERROR_SUCCESS;
    00446         }
    00447     }
    00448     /*
    00449      * First make sure we have enough space
    00450      * If the space will not sufice, we will get called again with a larger buffer
    00451      */
    00452     dwSpaceNeeded = 0;
    00453     if (dwQueryType & (QUERY_USER | QUERY_NOCOUNTERS)) {
    00454         dwSpaceNeeded += (gNumInstances)*(
    00455                             sizeof(PERF_INSTANCE_DEFINITION) +
    00456                             MAX_PATH * sizeof (WCHAR) +
    00457                             sizeof(PERF_COUNTER_BLOCK) + SIZE_OF_USER_PERFORMANCE_DATA) +
    00458                             sizeof(USER_DATA_DEFINITION);
    00459     }
    00460     if (dwQueryType & (QUERY_CS | QUERY_NOCOUNTERS)) {
    00461         dwSpaceNeeded += SIZE_OF_CS_PERFORMANCE_DATA
    00462                         + sizeof(CS_DATA_DEFINITION)
    00463                         + sizeof(PERF_COUNTER_BLOCK);
    00464     }
    00465     if (*lpcbTotalBytes < dwSpaceNeeded) {
    00466             *lpcbTotalBytes = (DWORD) 0;
    00467             *lpNumObjectTypes = (DWORD) 0;
    00468             return ERROR_MORE_DATA;
    00469     }
    00470
    00471     /*
    00472      * fill the return data
    00473      */
    00474
    00475     *lpNumObjectTypes = 0;
    00476     /*
    00477      * pUserDataDefinition also keeps track of the buffer starting point
    00478      */
    00479     pUserDataDefinition = (USER_DATA_DEFINITION *) *lppData;
    00480     pdwCounter = (DWORD *) *lppData;
    00481
    00482     if (dwQueryType & (QUERY_USER | QUERY_NOCOUNTERS)) {
    00483         /*
    00484          * USER object is requested
    00485          */
    00486         (*lpNumObjectTypes) ++;
    00487
    00488         if (dwQueryType & QUERY_USER) {
    00489             if (!NT_SUCCESS(QueryUserCounters(QUERYUSER_TYPE_USER,
    00490                                 gpPid, gNumInstances*sizeof(DWORD),
    00491                                 gpdwResult, (NUM_USER_COUNTERS-1)*gNumInstances*sizeof(DWORD)))) {
    00492                 *lpcbTotalBytes = (DWORD) 0;
    00493                 *lpNumObjectTypes = (DWORD) 0;
    00494                 return ERROR_SUCCESS;
    00495             }
    00496         }
    00497         else {
    00498             memset(gpdwResult, 0, sizeof(DWORD)*gNumInstances*NUM_USER_COUNTERS);
    00499         }
    00500         /*
    00501          * Copy the (constant, initialized) Object Type and counter definitions
    00502          * to the caller's data buffer
    00503          */
    00504         memmove(pUserDataDefinition, &UserDataDefinition, sizeof(USER_DATA_DEFINITION));
    00505         pUserDataDefinition->UserObjectType.NumInstances = gNumInstances;
    00506
    00507         pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *) &pUserDataDefinition[1];
    00508         for (i = 0; i < gNumInstances; i++) {
    00509
    00510             /*
    00511              * Collect and format all process instances
    00512              */
    00513             pPerfInstanceDefinition->ParentObjectTitleIndex = 0;
    00514             pPerfInstanceDefinition->ParentObjectInstance = 0;
    00515             pPerfInstanceDefinition->UniqueID = (LONG)gaInstances[i].id;
    00516             pPerfInstanceDefinition->NameOffset = sizeof(PERF_INSTANCE_DEFINITION);
    00517             pPerfInstanceDefinition->NameLength = gaInstances[i].sizeName;
    00518
    00519             pPerfInstanceDefinition->ByteLength = sizeof(PERF_INSTANCE_DEFINITION) +
    00520                                         pPerfInstanceDefinition->NameLength;
    00521
    00522             wcscpy((wchar_t*)((PBYTE)pPerfInstanceDefinition + sizeof(PERF_INSTANCE_DEFINITION)),
    00523                     gaInstances[i].pName);
    00524
    00525             pPerfCounterBlock = (PERF_COUNTER_BLOCK *) ((PBYTE)pPerfInstanceDefinition
    00526                                 + pPerfInstanceDefinition->ByteLength);
    00527
    00528             pPerfCounterBlock->ByteLength = SIZE_OF_USER_PERFORMANCE_DATA;
    00529             pdwCounter = (PDWORD) (&pPerfCounterBlock[1]);
    00530
    00531             for (counter = dwTotal = 0; counter<NUM_USER_COUNTERS-1; counter++) {
    00532                 dwTotal += gpdwResult[i*(NUM_USER_COUNTERS-1)+counter];
    00533             }
    00534             *pdwCounter++ = dwTotal;
    00535             memmove(pdwCounter,  gpdwResult + i*(NUM_USER_COUNTERS-1), (NUM_USER_COUNTERS-1)*sizeof(DWORD));
    00536             pdwCounter += NUM_USER_COUNTERS-1;
    00537
    00538             pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *)pdwCounter;
    00539         }
    00540
    00541         ((USER_DATA_DEFINITION *)*lppData)->UserObjectType.TotalByteLength =
    00542                 (ULONG)((PBYTE)pdwCounter - (PBYTE)pUserDataDefinition);
    00543     }
    00544
    00545     if (dwQueryType & (QUERY_CS | QUERY_NOCOUNTERS)) {
    00546         /*
    00547          * CS object is requested
    00548          */
    00549         (*lpNumObjectTypes) ++;
    00550
    00551         /*
    00552          * Write CS_DATA_DEFINITION object, no instances
    00553          *
    00554          * Copy the (constant, initialized) Object Type and counter definitions
    00555          * to the caller's data buffer
    00556          */
    00557         pCSDataDefinition = (CS_DATA_DEFINITION *)pdwCounter;
    00558         memmove(pCSDataDefinition, &CSDataDefinition, sizeof(CS_DATA_DEFINITION));
    00559
    00560         pPerfCounterBlock = (PERF_COUNTER_BLOCK *) &pCSDataDefinition[1];
    00561         pPerfCounterBlock->ByteLength = SIZE_OF_CS_PERFORMANCE_DATA;
    00562
    00563         pdwCounter = (DWORD *) &pPerfCounterBlock[1];
    00564
    00565         if (dwQueryType & QUERY_NOCOUNTERS) {
    00566             memset(pdwCounter, 0, sizeof(DWORD)*NUM_CS_COUNTERS);
    00567         }
    00568         else {
    00569             CSSTATISTICS CSCounters;
    00570
    00571             /*
    00572              * When entering for the first time, grab the hardware
    00573              * cycle counter frequency (if any)
    00574              */
    00575             if (!PrevCSStatistics.i64TimeExclusive) {
    00576
    00577                 if (!QueryPerformanceFrequency((LARGE_INTEGER*)&i64Frecv))
    00578                     i64Frecv = 0;
    00579             }
    00580             /*
    00581              * Retrieve the CS counters
    00582              */
    00583              if (!QueryUserCounters(QUERYUSER_TYPE_CS, NULL, 0, &CSCounters, sizeof(CSSTATISTICS))) {
    00584                 REPORT_ERROR (USERPERF_CS_CANT_QUERY, LOG_USER);
    00585              }
    00586              /*
    00587               * In case of overflow, the error will be of 1, no big deal
    00588               */
    00589              *pdwCounter = CSCounters.cExclusive - PrevCSStatistics.cExclusive;
    00590              *(pdwCounter + 1) = CSCounters.cShared - PrevCSStatistics.cShared;
    00591
    00592              if (i64Frecv) {
    00593                  /*
    00594                   * Translate the value in counts per milisecond
    00595                   */
    00596                   *(pdwCounter + 2) = (DWORD)((CSCounters.i64TimeExclusive-PrevCSStatistics.i64TimeExclusive)*1000/i64Frecv);
    00597              }
    00598              else {
    00599                  /*
    00600                   * No support for high resolution timer in the hardware
    00601                   */
    00602                   *(pdwCounter + 2) = 0;
    00603              }
    00604
    00605              PrevCSStatistics.cExclusive = CSCounters.cExclusive;
    00606              PrevCSStatistics.cShared = CSCounters.cShared;
    00607              PrevCSStatistics.i64TimeExclusive = CSCounters.i64TimeExclusive;
    00608         }
    00609         pdwCounter += NUM_CS_COUNTERS;
    00610     }
    00611
    00612
    00613     /*
    00614      *  update arguments for return
    00615      */
    00616     *lpcbTotalBytes = (ULONG)((PBYTE)pdwCounter - (PBYTE)*lppData);
    00617     *lppData = (PVOID) pdwCounter;
    00618
    00619     return ERROR_SUCCESS;
    00620 }

DWORD APIENTRY OpenUserPerformanceData | ( | LPWSTR | lpDeviceNames | ) |

Definition at line 136 of file perfuser.c.

References APIENTRY, CSDataDefinition, _CS_DATA_DEFINITION::CSExEnter, _CS_DATA_DEFINITION::CSExTime, _CS_DATA_DEFINITION::CSObjectType, _CS_DATA_DEFINITION::CSShEnter, dwOpenCount, DWORD, gbInitOK, hEventLog, L, LOG_USER, MonOpenEventLog(), NUM_USER_COUNTERS, _USER_DATA_DEFINITION::NumTotals, REPORT_ERROR_DATA, TRUE, type, UserDataDefinition, and _USER_DATA_DEFINITION::UserObjectType.

    00139                    :
    00140
    00141     This routine opens the interface with the event log and
    00142     initializes the data structures used to pass data back to the registry.
    00143     It also calls FillInstances.
    00144
    00145 Arguments:
    00146     Pointer to object ID of each device to be opened
    00147
    00148 Return Value:
    00149     None.
    00150 --*/
    00151 {
    00152     LONG    status;
    00153     HKEY    hKeyDriverPerf;
    00154     DWORD   size;
    00155     DWORD   type;
    00156     DWORD   dwFirstCounter;
    00157     DWORD   dwFirstHelp;
    00158
    00159     PDWORD  pCounterNameTitleIndex;
    00160     LPWSTR  *pCounterNameTitle;
    00161     PDWORD  pCounterHelpTitleIndex;
    00162     LPWSTR  *pCounterHelpTitle;
    00163     int     i;
    00164
    00165     /*
    00166      *  Since SCREG is multi-threaded and will call this routine in
    00167      *  order to service remote performance queries, this library
    00168      *  must keep track of how many times it has been opened (i.e.
    00169      *  how many threads have accessed it). the registry routines will
    00170      *  limit access to the initialization routine to only one thread
    00171      *  at a time so synchronization (i.e. reentrancy) should not be
    00172      *  a problem
    00173      */
    00174     if (!dwOpenCount) {
    00175
    00176         hEventLog = MonOpenEventLog();  // open Eventlog interface
    00177         /*
    00178          * get counter and help index base values from registry
    00179          *      Open key to registry entry
    00180          *      read First Counter and First Help values
    00181          *      update static data structures by adding base to
    00182          *      offset value in structure.
    00183          */
    00184         status = RegOpenKeyEx (
    00185             HKEY_LOCAL_MACHINE,
    00186             "SYSTEM\\CurrentControlSet\\Services\\PerfUser\\Performance",
    00187             0L,
    00188             KEY_ALL_ACCESS,
    00189             &hKeyDriverPerf);
    00190
    00191         if (status != ERROR_SUCCESS) {
    00192             REPORT_ERROR_DATA (USERPERF_UNABLE_OPEN_DRIVER_KEY, LOG_USER,
    00193                 &status, sizeof(status));
    00194             /*
    00195              * these failures are fatal, if we can't get the base values of the
    00196              * counter or help names, then the names won't be available
    00197              * to the requesting application  so there's not much
    00198              * point in continuing.
    00199              */
    00200             goto OpenExitPoint;
    00201         }
    00202
    00203         size = sizeof (DWORD);
    00204         status = RegQueryValueEx(
    00205                     hKeyDriverPerf,
    00206                     "First Counter",
    00207                     0L,
    00208                     &type,
    00209                     (LPBYTE)&dwFirstCounter,
    00210                      &size);
    00211
    00212         if (status != ERROR_SUCCESS) {
    00213             REPORT_ERROR_DATA (USERPERF_UNABLE_READ_FIRST_COUNTER, LOG_USER,
    00214                 &status, sizeof(status));
    00215             goto OpenExitPoint;
    00216         }
    00217
    00218         status = RegQueryValueEx(
    00219                     hKeyDriverPerf,
    00220                     "First Help",
    00221                     0L,
    00222                     &type,
    00223                     (LPBYTE)&dwFirstHelp,
    00224                     &size);
    00225
    00226         if (status != ERROR_SUCCESS) {
    00227             REPORT_ERROR_DATA (USERPERF_UNABLE_READ_FIRST_HELP, LOG_USER,
    00228                 &status, sizeof(status));
    00229             goto OpenExitPoint;
    00230         }
    00231
    00232         UserDataDefinition.UserObjectType.ObjectNameTitleIndex += dwFirstCounter;
    00233         UserDataDefinition.UserObjectType.ObjectHelpTitleIndex += dwFirstHelp;
    00234
    00235         pCounterNameTitleIndex = &UserDataDefinition.NumTotals.CounterNameTitleIndex;
    00236         pCounterHelpTitleIndex = &UserDataDefinition.NumTotals.CounterHelpTitleIndex;
    00237
    00238         for (i = 0; i<NUM_USER_COUNTERS;
    00239                 i++,
    00240                 pCounterNameTitleIndex += sizeof(PERF_COUNTER_DEFINITION)/sizeof(DWORD),
    00241                 pCounterHelpTitleIndex += sizeof(PERF_COUNTER_DEFINITION)/sizeof(DWORD))
    00242         {
    00243             *pCounterNameTitleIndex += dwFirstCounter;
    00244             *pCounterHelpTitleIndex += dwFirstHelp;
    00245         }
    00246         /*
    00247          * Set CSDataDefinition indexes
    00248          */
    00249         CSDataDefinition.CSObjectType.ObjectNameTitleIndex += dwFirstCounter;
    00250         CSDataDefinition.CSObjectType.ObjectHelpTitleIndex += dwFirstHelp;
    00251         CSDataDefinition.CSExEnter.CounterNameTitleIndex += dwFirstCounter;
    00252         CSDataDefinition.CSExEnter.CounterHelpTitleIndex += dwFirstHelp;
    00253         CSDataDefinition.CSShEnter.CounterNameTitleIndex += dwFirstCounter;
    00254         CSDataDefinition.CSShEnter.CounterHelpTitleIndex += dwFirstHelp;
    00255         CSDataDefinition.CSExTime.CounterNameTitleIndex += dwFirstCounter;
    00256         CSDataDefinition.CSExTime.CounterHelpTitleIndex += dwFirstHelp;
    00257
    00258         RegCloseKey (hKeyDriverPerf); // close key to registry
    00259         gbInitOK = TRUE;     // ok to use this function
    00260     }
    00261
    00262     dwOpenCount++;          // increment OPEN counter
    00263     status = ERROR_SUCCESS; // for successful exit
    00264
    00265 OpenExitPoint:
    00266
    00267     return status;
    00268 }

## Variable Documentation

PM_CLOSE_PROC CloseUserPerformanceData

| Definition at line 93 of file perfuser.c.

PM_COLLECT_PROC CollectUserPerformanceData

| Definition at line 92 of file perfuser.c.

CS_DATA_DEFINITION CSDataDefinition

| Definition at line 58 of file perfuser.c. Referenced by GlobalCollect(), IsNumberInUnicodeList(), and OpenUserPerformanceData().

DWORD dwOpenCount

| Definition at line 74 of file perfuser.c. Referenced by CloseUserPerformanceData(), and OpenUserPerformanceData().

DWORD

| Definition at line 52 of file perfuser.c. Referenced by __ClientLoadOLE(), __ClientRegisterDragDrop(), __ClientRevokeDragDrop(), _BuildNameList(), _BuildPropList(), _CheckMenuItem(), _ClientCopyDDEIn1(), _ClientEventCallback(), _ClientGetDDEFlags(), _ClientGetDDEHookData(), _ClientGetListboxString(), _CreateWindowEx(), _CsUpdateInstance(), _DeferWindowPos(), _DefSetText(), _EndTask(), _GetClassData(), _GetClassInfoEx(), _GetDCEx(), _GetListBoxInfo(), _GetMenuDefaultItem(), _GetMenuState(), _GetMessagePos(), _GetMouseMovePointsEx(), _GetQueueStatus(), _GetUserObjectInformation(), _GetWindowContextHelpId(), _GetWindowLongPtr(), _GetWindowWord(), _InitializeImmEntryTable(), _LockSetForegroundWindow(), _PeekMessage(), _PostMessage(), _QueryUserHandles(), _SetCursorIconData(), _SetRipFlags(), _SetUserObjectInformation(), _SetWindowLongPtr(), _SetWindowWord(), _UnregisterClass(), _WOWCleanup(), AbnormalDDEPost(), AddTaggedElement(), AddTagTableEntry(), AdjustPrivilege(), AITestCall(), AlignCopyMemory(), AllocAce(), AllocAndSetDDEData(), AllocateCallbackData(), AllocateHeapObject(), AllocConsole(), AnimateBlend(), AnimateFade(), AnimateWindow(), ApplyMatrix(), Ascii85Encode(), AssignNewLayout(), bCheckAndDeleteTTF(), bCheckIfDualBootingWithWin31(), bCleanConvertedTTFs(), BeginGlobalDict(), BitmapFromDIB(), bLoadableFontDrivers(), BltColor(), BMPtoDIB(), BMPtoDIBV5(), BoostHardError(), BroadcastSystemMessage(), BroadcastSystemMessageWorker(), BuildHimcList(), BuildHwndList(), ButtonWndProcWorker(), CAddProfileDialog::CAddProfileDialog(), CalcBitmapBufferSize(), CalcCharacterPositionAtoW(), CalcCharacterPositionWtoA(), CalcGRAMAddress(), CalcSBStuff2(), CallMsgFilter(), CallNextHookEx(), CaptureAnsiCallbackData(), CaptureCallbackData(), CaptureUnicodeCallbackData(), CascadeWindowsEnum(), ChangeDibColors(), ChangeICMSetting(), ChangeMenuA(), ChangeMenuW(), ChangeTaggedElementSize(), CharHandlerFromConsole(), CharLowerBuffA(), CharLowerBuffW(), CharUpperBuffA(), CharUpperBuffW(), CheckAttribute(), CheckBadApp(), CheckBitmapBits(), CheckDesktopPolicy(), CheckDesktopPolicyChange(), CheckInputOutputTable(), CheckMenuItem(), CheckQuitMessage(), CheckRemoveHotkeyBit(), CheckResMedHftnMatch(), CheckRestricted(), CheckTransferState(), ChooseNewColor(), CI_GetClrVal(), ClassifyInstruction(), ClientThreadSetup(), CliReadRegistryValue(), CliSaveImeHotKeyWorker(), CliSetSingleHotKey(), CloseCandidateJapan(), CloseCandidateKorea(), CloseCandidatePRC(), CloseCandidateTaiwan(), CloseMonitor(), ClosePrtr(), ClRespRequestData(), ClSpontAdviseData(), ClStartAdvise(), ClStartExecute(), ClStartPoke(), ClStartRequest(), ClStartUnadvise(), CMCheckRGBs(), CMCreateDeviceLinkProfile(), CMCreateMultiProfileTransformInternal(), CMCreateTransformExt(), CMGetInfo(), CMTranslateColors(), CMTranslateRGB(), CMTranslateRGBs(), CMTranslateRGBsExt(), CollectUserPerformanceData(), CProfile::ColorDirectory(), ColorSpaceControl(), ComboBoxWndProcWorker(), CommonCreateWindowStation(), CColorMatchDialog::CompleteInitialization(), ComposeDeadKeys(), CompStrAToCharW(), CompStrAToStringA(), CompStrAToStringExA(), CompStrAToStringExW(), CompStrAToStringW(), CompStrAToUndetA(), CompStrAToUndetW(), CompStrWToCharA(), CompStrWToStringA(), CompStrWToStringExA(), CompStrWToStringExW(), CompStrWToStringW(), CompStrWToUndetA(), CompStrWToUndetW(), ConimeHotkey(), ConImeInputLangchangeRequest(), ConnectConv(), ConsoleWindowProc(), ConvertColorNameToIndex(), ConvertHotKey(), ConvertIndexToColorName(), ConvertToAnsi(), ConvertToUnicode(), CookedRead(), CopyBmp(), CopyDibHdr(), CopyIcoCur(), CopyImeFile(), CopySTR(), crc32(), CreateAniIcon(), CreateColorantArray(), CreateColSpArray(), CreateColSpProc(), CreateCRDControl(), CreateCRDRevArray(), CreateCtrlThread(), CreateCursor(), CreateDeviceLinkProfile(), CreateDialogIndirectParamAorW(), CreateFloatString(), CreateHostInputOutputArray(), CreateHostLutCRD(), CreateHostMatrixCSAorCRD(), CreateHostRevTRCInputTable(), CreateHostTRCInputTable(), CreateIcon(), CreateIconIndirect(), CreateInputArray(), CreateInputContext(), CreateINTENTControl(), CreateLutCRD(), CreateMatrixCRD(), CreateMonoCRD(), CreateMultiProfileTransform(), CreateOutputArray(), CreatePaletteFromBitmap(), CreateProfCRDControl(), CreateScreenBitmap(), CreateSetupNameArray(), CreateWindowsWindow(), CSMakeCall(), CtrlRoutine(), DBGGetWindowLong(), DdeAccessData(), DdeClientTransaction(), DdeCreateDataHandle(), DdeGetData(), DdeQueryStringA(), DdeQueryStringW(), DECLARE_INTERFACE_(), DefaultHandler(), DefDlgProcWorker(), DefMDIChildProcWorker(), DefSetText(), DefShortToInt(), DefWindowProcWorker(), DeleteCommandLine(), DeleteOldICMKey(), DeleteTaggedElement(), DestroyHandleTableObjects(), DestroyThreadsObjects(), DeviceClassNotify(), DeviceEventWorker(), df(), DialogBoxIndirectParamAorW(), DIBFromBitmap(), DIBtoDIBV5(), dir(), DispLenStructedUnicode(), DispLenUnicode(), DllInit(), DoCallback(), DoesCPTagExist(), DoHostConversionCRD(), DoHostConversionCSA(), DoPaint(), DoStringPaste(), DownSiren(), DrawCaption(), DrawCaptionTemp(), DrawCommandListPopup(), DrawDiagonal(), DrawDiagonalLine(), DrawGrip(), DrawMenuItemCheckMark(), DrawPushButton(), DrawStateW(), ds(), DsoDump(), dsoGetSize(), dsoTerminateString(), dt(), DT_GetLineBreak(), DumpConvInfo(), DupConvTerminate(), DwordMatches(), dwrWorker(), ECDeleteText(), ECDoIMEMenuCommand(), ECGetBrush(), ECGetDBCSVector(), ECImmSetCompositionWindow(), ECInsertText(), ECNcCreate(), ECNotifyParent(), ECSetFont(), ECSetIMEMenu(), EditWndProc(), EnableGlobalDict(), EnableMenuItem(), EndGlobalDict(), EndTaskDlgProc(), EnumColorProfilesW(), EnumDisplayDevices(), CProfile::Enumerate(), CScannerList::Enumerate(), CPrinterList::Enumerate(), EnumerateFonts(), EnumRegisterWordProcA(), EnumRegisterWordProcW(), Event(), ExamineKey(), ExamineValueEntries(), ExitWindowsThread(), ExitWindowsWorker(), ExtractIconFromEXE(), fakeImm_bwuwl(), fakeImm_d1(), fakeImm_d2(), fakeImm_d3(), fakeImm_wd1(), fakeImm_wd2(), fakeImm_wd3(), fakeImm_wd4(), fakeImm_wd5(), fakeImm_wd6(), FastGetProfileDwordW(), FastGetProfileKeysW(), FastGetProfileStringFromIDW(), FastGetProfileStringW(), FastGetProfileValue(), FastStreamWrite(), FillInstances(), CDeviceProfileManagement::FillList(), FillProfileFromLog(), FillProfileFromLogW(), FindCharPosition(), FindMnemChar(), FindOldMonitor(), FindResourceNE(), FindResourcePE(), FixupCallbackPointers(), FreeDDEData(), FreeProfileObject(), FreeThreadsWinEvents(), FsgWriteToFrameBuffer(), FsVgaWriteToFrameBuffer(), GenerateNlsVkAltKey(), GenerateNlsVkKey(), GetACPCharSet(), GetActiveKeyboardName(), GetAltTabInfo(), GetAppCompatFlags(), GetAppCompatFlags2(), GetAppImeCompatFlags(), GetAsyncKeyState(), GetBitmapBytes(), GetClassInfo(), GetClassInfoEx(), GetClipboardCodePage(), GetClipboardData(), GetClipboardFormatName(), CProfile::GetCMM(), GetCMMInfo(), GetColorDirectoryW(), GetColorMatchingModule(), GetColorProfileElement(), GetColorProfileElementTag(), GetColorProfileFromHandle(), GetColorProfileHeader(), CProfile::GetColorSpace(), GetCompStrJapan(), GetCompStrKorea(), GetCompStrPRC(), GetCompStrTaiwan(), GetConsoleInputExeNameA(), GetConsoleInputExeNameW(), GetConsoleTitleA(), GetConsoleTitleW(), GetContextHelpId(), GetCountColorProfileElements(), GetCPElementData(), GetCPElementDataSize(), GetCPElementDataType(), GetCPElementSize(), GetCPMediaWhitePoint(), GetCRDInputOutputArraySize(), GetCSAFromProfile(), GetDbgTagFlags(), GetDebugHookLParamSize(), GetDeviceCMYK(), GetDeviceGray(), GetDeviceRGB(), CDeviceProfileManagement::GetDeviceTypeString(), GetDialogMonitor(), GetErrorMode(), GetFilenameFromPath(), GetFlags(), GetFullUserHandle(), GetHardErrorText(), GetHDevName(), GetHostColorRenderingDictionary(), GetHostColorSpaceArray(), GetHostCSA(), GetHostMatrixCSAorCRD(), GetIcoCurBpp(), GetIcoCurHeight(), GetIcoCurWidth(), GetImeLayout(), GetIMEName(), GetInputWindow(), GetKbdLangSwitch(), GetKeyboardLayoutName(), GetKeyNameText(), GetKeyState(), GetLinkProperties(), GetMangledSiteSid(), GetMaxOverlapChars(), GetMenuCheckMarkDimensions(), GetMenuContextHelpId(), GetMenuDefaultItem(), GetMenuInheritedContextHelpId(), GetMessage(), GetMessagePos(), GetMonitorData(), GetNamedProfileInfo(), GetNetworkDrives(), GetPrimaryMonitor(), GetPS2ColorRenderingDictionary(), GetPS2ColorRenderingIntent(), GetPS2ColorSpaceArray(), GetPS2CSA_ABC(), GetPS2CSA_ABC_Lab(), GetPS2CSA_ABC_LAB(), GetPS2CSA_DEFG(), GetPS2CSA_MONO_A(), GetPS2CSA_MONO_ABC(), GetPS2PreviewColorRenderingDictionary(), GetPublicArrayName(), GetQueryType(), GetQueueStatus(), GetRegIntFromID(), GetRegistryValues(), GetRevCurve(), GetRipComponent(), GetRipFlags(), GetRipPID(), GetServerIMEKeyboardLayout(), GetSizeDialogTemplate(), GetStandardColorSpaceProfileW(), GetSysColor(), GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), GetTabbedTextExtentA(), GetTabbedTextExtentW(), GetTitleFromLinkName(), GetTRCElementSize(), CProfile::GetType(), GetUserObjectInformationA(), GetVersionDatum(), GetWindowContextHelpId(), GetWindowData(), GetWindowThreadProcessId(), GlobalCollect(), CColorMatchDialog::GoodParms(), HandleKeyEvent(), HandleMediaChangeEvent(), HandleRemoteNetDeviceChangeEvent(), HardErrorHandler(), HasExtension(), HFill(), HMAllocObject(), HMCleanupGrantedHandle(), HMFreeObject(), HMGrowHandleTable(), HMValidateHandle(), HMValidateHandleNoSecure(), HMValidateSharedHandle(), HowManyColors(), IconFromBestImage(), Idf(), IdleTimerProc(), Idmon(), Idso(), Ifrr(), IGetDeviceData(), ImeControlHandler(), ImeNotifyHandler(), ImeRunHelp(), ImeSetContextHandler(), ImeSystemHandler(), ImeUIGuideLine(), ImeUINotify(), ImeUISetConversionMode(), ImeWndCreateHandler(), ImmActivateLayout(), ImmCallImeConsoleIME(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmCreateContext(), ImmCreateIMCC(), ImmCreateSoftKeyboard(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGenerateMessage(), ImmGetAppCompatFlags(), ImmGetCandidateListA(), ImmGetCandidateListCountA(), ImmGetCandidateListCountW(), ImmGetCandidateListCountWorker(), ImmGetCandidateListW(), ImmGetCandidateListWorker(), ImmGetCompositionStringA(), ImmGetCompositionStringW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetDescriptionA(), ImmGetGuideLineA(), ImmGetGuideLineW(), ImmGetGuideLineWorker(), ImmGetIMCCLockCount(), ImmGetIMCCSize(), ImmGetIMCLockCount(), ImmGetIMEFileNameA(), ImmGetImeMenuItemsA(), ImmGetImeMenuItemsInterProcess(), ImmGetImeMenuItemsW(), ImmGetImeMenuItemsWorker(), ImmGetProperty(), ImmGetReconvertTotalSize(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmIMPQueryIMEA(), ImmIMPSetIMEA(), ImmInstallIMEA(), ImmLoadLayout(), ImmLockClientImc(), ImmPenAuxInput(), ImmPostMessages(), ImmProcessKey(), ImmPutImeMenuItemsIntoMappedFile(), ImmReconversionWorker(), ImmRegisterWordA(), ImmRegisterWordW(), ImmRequestMessageAorW(), ImmRequestMessageWorker(), ImmSendNotification(), ImmSetActiveContext(), ImmSetCompositionStringWorker(), ImmSetConversionStatus(), ImmSetOpenStatus(), ImmTranslateMessage(), ImmUnregisterWordA(), ImmUnregisterWordW(), IncludeCandidateP(), IncludeCandidateT(), IncludeCompositionP(), IncludeCompositionT(), InitExtendedEditKeys(), InitializeFullScreen(), InitiateShutdown(), InitScancodeMap(), InitSecurity(), InitWindowsStuff(), InnerGrayStringAorW(), InquireIme(), InSendMessageEx(), InsertInBuffer(), InternalAssociateColorProfileWithDevice(), InternalCreateCallbackThread(), InternalCreateColorTransform(), InternalCreateDataHandle(), InternalCreateDialog(), InternalDdeQueryString(), InternalDisassociateColorProfileFromDevice(), InternalEnumColorProfiles(), InternalEnumObjects(), InternalEnumProps(), InternalGetCandidateListAtoW(), InternalGetCandidateListWtoA(), InternalGetColorDirectory(), InternalGetCompositionStringA(), InternalGetCompositionStringW(), InternalGetDeviceConfig(), InternalGetPS2ColorRenderingDictionary(), InternalGetPS2ColorRenderingIntent(), InternalGetPS2ColorSpaceArray(), InternalGetPS2CSAFromLCS(), InternalGetPS2PreviewCRD(), InternalGetSCSProfile(), InternalGetWindowText(), InternalImeMenuCreateBitmap(), InternalImmLockIMC(), InternalInstallColorProfile(), InternalInvalidate2(), InternalOpenColorProfile(), InternalRegisterClassEx(), InternalRegisterCMM(), InternalSCS_CHANGEATTR(), InternalSCS_CHANGECLAUSE(), InternalSCS_RECONVERTSTRING(), InternalSCS_SETSTR(), InternalSetClipboardData(), InternalSetDeviceConfig(), InternalSetSCSProfile(), InternalUninstallColorProfile(), InternalUnregisterCMM(), InternalWaitCancel(), IopAddRemoteBootValuesToRegistry(), IopCacheNetbiosNameForIpAddress(), IopSetDefaultGateway(), IopTCPQueryInformationEx(), IopTCPSetInformationEx(), IopWriteTriageDump(), IsColorProfileTagPresent(), IsColorProfileValid(), IsDialogMessageW(), ISetDeviceData(), IsForegroundThread(), IsGRAMRowOver(), IsHandleEntrySecure(), IsMetaFile(), IsNumberInUnicodeList(), IsReferenceTag(), IsSRGB(), IsSRGBColorProfile(), IsTimeFromLastInput(), IsTimeFromLastRITEvent(), ITestCall(), JTransCompositionA(), JTransCompositionW(), LaunchHelper(), LBDropObjectHandler(), LBGetScrollFlags(), ListBoxWndProcWorker(), CString::LoadAndFormat(), LoadAniIcon(), LoadAppDlls(), LoadBmp(), LoadCP(), LoadCPUserPreferences(), LoadCursorIconFromFileMap(), LoadFixVersionInfo(), LoadImeDpi(), LoadLink(), LoadLinkInfo(), LoadVarVersionInfo(), LoadVersionInfo(), main(), MakeCSCall(), MakeIMENotify(), MakeInfoStringJapan(), MakeInfoStringPRC(), MakeInfoStringTaiwan(), MakeMenuItem(), MakeStatusStrPRC1(), MakeStatusStrPRC2(), MakeStatusStrTaiwan1(), MakeStatusStrTaiwan2(), MapScancode(), MapVirtualKey(), MapVirtualKeyEx(), MaybeTranslateExecuteData(), MB_UpdateDlgItem(), MBC_RightJustifyMenu(), MDIClientWndProcWorker(), memcpyGRAMOver(), MemFree(), MenuItemState(), MenuLoadChicagoTemplates(), MenuLoadWinTemplates(), MenuRecalc(), MessageBoxWorker(), MESSAGECALL(), MigrateSystem9x(), MLBuildchLines(), MLDrawText(), MLEditWndProc(), MLIchToXYPos(), MLInsertchLine(), MLInsertText(), MLKeyDown(), MLLine(), MLScroll(), MNAnimate(), MNDrawArrow(), MNRecalcTabStrings(), MonitorConv(), MonitorLink(), MonitorStringHandle(), MonOpenEventLog(), MoveGRAM(), MsgWaitForMultipleObjects(), MsgWaitForMultipleObjectsEx(), msProfMenu(), msProfSendMessageDiffThread(), MungeClipData(), MyNewDeviceLinkFill(), MySetCandidateWindow(), MySetCompFont(), MySetCompWindow(), NextGRAMRow(), NonConsoleProcessShutdown(), NotifyIMEProc(), NotifyLogon(), NtUserBuildHimcList(), NtUserBuildHwndList(), NtUserBuildNameList(), NtUserBuildPropList(), NtUserChangeClipboardChain(), NtUserCheckImeHotKey(), NtUserCheckMenuItem(), NtUserCreateCaret(), NtUserCreateDesktop(), NtUserDdeInitialize(), NtUserDdeSetQualityOfService(), NtUserDefSetText(), NtUserDestroyWindow(), NtUserDragDetect(), NtUserDragObject(), NtUserDrawCaption(), NtUserDrawCaptionTemp(), NtUserEvent(), NtUserFillWindow(), NtUserfnHkINLPDEBUGHOOKSTRUCT(), NtUserGetAppImeLevel(), NtUserGetClassName(), NtUserGetClipboardSequenceNumber(), NtUserGetCursorFrameInfo(), NtUserGetGuiResources(), NtUserGetIconInfo(), NtUserGetInternalWindowPos(), NtUserGetKeyboardLayoutList(), NtUserGetListBoxInfo(), NtUserGetMenuBarInfo(), NtUserGetMenuIndex(), NtUserGetMenuItemRect(), NtUserGetObjectInformation(), NtUserGetThreadState(), NtUserGetUpdateRect(), NtUserGetWindowPlacement(), NtUserHardErrorControl(), NtUserHiliteMenuItem(), NtUserInitializeClientPfnArrays(), NtUserInternalGetWindowText(), NtUserMenuItemFromPoint(), NtUserNotifyProcessCreate(), NtUserProcessConnect(), NtUserQueryUserCounters(), NtUserRegisterTasklist(), NtUserSBGetParms(), NtUserScrollWindowEx(), NtUserSendInput(), NtUserSetConsoleReserveKeys(), NtUserSetCursorIconData(), NtUserSetInformationProcess(), NtUserSetInformationThread(), NtUserSetInternalWindowPos(), NtUserSetMenu(), NtUserSetProp(), NtUserSetScrollInfo(), NtUserSetSystemMenu(), NtUserSetThreadState(), NtUserSetWindowStationUser(), NtUserShowScrollBar(), NtUserSystemParametersInfo(), NtUserUpdateInstance(), NtUserUserHandleGrantAccess(), NtUserWaitForInputIdle(), NtUserWin32PoolAllocationStats(), NumString(), OemKeyScan(), CColorMatchDialog::OnCommand(), CAddDeviceDialog::OnContextMenu(), CProfileAssociationPage::OnContextMenu(), CProfileInformationPage::OnInit(), CPrinterProfileManagement::OnInit(), CPrinterProfileManagement::OnNotify(), OpenCacheKeyEx(), OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), OpenCandidateTaiwan(), OpenClipboard(), OpenKeyboardLayoutFile(), OpenMonitor(), OpenPrtr(), OpenUserPerformanceData(), PackAndPostMessage(), PostMessage(), PostShellHookMessages(), PostThreadMessage(), PostUpdateKeyStateEvent(), PrependInputBuffer(), PrintPair(), PrivateExtractIconsW(), ProbeAndCaptureSoftKbdData(), ProcessCommandLine(), ProcessCommandListInput(), ProcessCommandNumberInput(), ProcessCookedReadInput(), ProcessCopyToCharInput(), ProcessCtrlEvents(), ProcessDDEMLInitiate(), ProcessDeviceChanges(), ProcessHardErrorRequest(), ProcessResizeWindow(), PtiWindow(), QwordMatches(), RawInputThread(), RawReadWaitRoutine(), ReadChars(), ReaderProcInternal(), ReadIconGuts(), ReadLayoutFile(), ReadString(), REBASESHAREDPTR(), ReferenceClass(), RegisterDeviceNotification(), RegisterDeviceNotificationWorker(), RegisterWindowMessage(), RegReadApcProcedure(), RemoteConnect(), RemoteConnectState(), RemoteDisableScreen(), RemoteRedrawScreen(), RemoteThinwireStats(), RemoveConsoleWorker(), RemoveFlashWindowState(), RemoveProp(), RemoveStringFromMultiSz(), Request(), RtlGetExpWinVer(), RtlLoadObjectFromDIBFile(), RtlMBMessageWParamCharToWCS(), RtlVirtualUnwind(), RtlWCSMessageWParamCharToMB(), RVAtoP(), SaveBitmapToMemory(), SBSetParms(), Scale2424(), SCR_FONTNUMBER(), SelectInputContext(), SendCRDABC(), SendCRDBWPoint(), SendCRDLMN(), SendCRDOutputTable(), SendCRDPQR(), SendCRDRevArray(), SendCSABWPoint(), SendMessageCallback(), SendMessageDiffThreadFunc(), SendNotifyMessage(), SendWinHelpMessage(), SetAppCompatFlags(), SetAppImeCompatFlags(), SetClassLongPtr(), SetColorProfileElement(), SetColorProfileElementReference(), SetColorProfileElementSize(), SetColorProfileHeader(), SetCommonStateFlags(), SetConsoleInputExeNameW(), SetConsoleTitleA(), SetConsoleTitleW(), SetCurrentCommandLine(), SetEndTaskDlgStatus(), SetFont(), SetInformationProcess(), SetLastDDEMLError(), SetProp(), SetRAMFont(), SetRAMFontCodePage(), SetRipFlags(), SetSysColor(), SetSystemCursor(), SetUpAppName(), SetUpConsole(), SetWindowRgn(), SetWindowStationUser(), SfnINCBOXSTRING(), SfnINLBOXSTRING(), SfnOUTCBOXSTRING(), SfnOUTLBOXSTRING(), SizeOfDib(), SKC1ButtonUp(), SKT1ButtonUp(), SKT1SetCursor(), SLDrawLine(), SLMouseMotion(), SLMouseToIch(), SmoothScrollWindowEx(), SoftModalMessageBox(), SP_PutNumber(), SP_PutNumberW(), SpontaneousTerminate(), SpoolerCopyFileEvent(), SrvGetConsoleAliases(), SrvGetConsoleAliasExes(), SrvRegisterLogonProcess(), SrvVDMConsoleOperation(), SrvWin32HeapStat(), StartFade(), StaticCallback(), StopFade(), strncpycch(), SvSpontAdvise(), SvSpontExecute(), SvSpontPoke(), SvSpontRequest(), SvSpontUnadvise(), SvStartAdviseUpdate(), SyncSoftKbdState(), SystemParametersInfo(), TableInterp3(), TableInterp4(), CProfile::TagContents(), TestFadeFlags(), TestVGAColors(), TextAlloc(), ThreadShutdownNotify(), ThunkedMenuItemInfo(), TileWindowsEnum(), TimersProc(), ToAsciiEx(), TooltipAnimate(), ToUnicode(), ToUnicodeEx(), TransactionComplete(), TransGetConversionMode(), TransGetMode(), TransHanjaMode(), TranslateBitmapBits(), TranslateIMESubFunctions(), TranslateMessageEx(), TransSendVKey(), TransSetConversionMode(), TransSetLevel(), TransSetMode(), TransVKDBEMode(), TriagepVerifyDump(), Unadvise(), UnlinkConvFromOthers(), UnlockConsole(), UnqueueMouseEvent(), UnregisterClass(), UpdatePerUserKeyboardIndicators(), UpdatePerUserSystemParameters(), UpgradeClass(), UpSiren(), UserBeep(), UserClientShutdown(), UserCommitDesktopMemory(), UserCommitSharedMemory(), UserHardErrorEx(), UserVisrgnFromHwnd(), ValidateConnectParameters(), ValidateHSZ(), ValidColorMatchingModule(), ValidHandle(), ValidProfile(), vCleanConvertedTTFs(), VkKeyScan(), VkKeyScanEx(), vProcessFontEntry(), vSweepFonts(), VWPLAdd(), VWPLRemove(), W32WinStationTerminate(), WaitForInputIdle(), WaitForZombieTerminate(), WaitOnPseudoEvent(), wcsncpycch(), WinHelpA(), WINNLSTranslateMessageJ(), WMCSCallback(), WndProc(), WowGetModuleHandle(), WriteByteString(), WriteCharsFromInput(), WriteDouble(), WriteFixed2dot30(), WriteFloat(), WriteHexBuffer(), WriteImeLayout(), WriteInt2ByteString(), WriteIntStringU2S(), WriteIntStringU2S_L(), WriteNewLineObject(), WriteRegionToScreenBitMap(), WWSB_DoSrvWriteConsole(), WWSB_DoWriteConsole(), WWSB_FillOutput(), WWSB_WriteChars(), xxxActivateThisWindow(), xxxActivateWindow(), xxxAdvise(), xxxAdviseAck(), xxxAdviseData(), xxxAdviseDataAck(), xxxAllowSetForegroundWindow(), xxxAnimateCaption(), xxxButtonDrawCheck(), xxxButtonEvent(), xxxCalcCaptionButton(), xxxCallJournalPlaybackHook(), xxxCallMouseHook(), xxxCBCreateHandler(), xxxCBGetTextHelper(), xxxCBInternalUpdateEditWindow(), xxxCBShowListBoxWindow(), xxxCBUpdateListBoxWindow(), xxxChangeMonitorFlags(), xxxConsoleControl(), xxxCopyAckIn(), xxxCopyDdeIn(), xxxCreateDefaultImeWindow(), xxxCreateDesktop(), xxxCreateThreadInfo(), xxxCreateWindowEx(), xxxCreateWindowStation(), xxxCsDdeInitialize(), xxxCsEvent(), xxxDDETrackGetMessageHook(), xxxDDETrackPostHook(), xxxDefWindowProc(), xxxDesktopThread(), xxxDestroyWindow(), xxxDoButtonEvent(), xxxDragObject(), xxxDrawCaptionTemp(), xxxDrawState(), xxxDWP_ProcessVirtKey(), xxxDWP_SetCursor(), xxxDWPPrint(), xxxEnableMenuItem(), xxxEnableScrollBar(), xxxEndScroll(), xxxExecute(), xxxExecuteAck(), xxxFlashWindow(), xxxFlushDeferredWindowEvents(), xxxGetDummyDib(), xxxGetDummyDibV5(), xxxGetNextSysMsg(), xxxGetWindowSmIcon(), xxxGNM_FindNextMnem(), xxxHandleMenuMessages(), xxxHungAppDemon(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmProcessKey(), xxxInitActivateDlg(), xxxInternalGetMessage(), xxxInterSendMsgEx(), xxxKeyEvent(), xxxLbDir(), xxxLBDrawLBItem(), xxxLBoxCtlHScroll(), xxxLBoxCtlScroll(), xxxLBSelRange(), xxxMenuBarCompute(), xxxMenuWindowProc(), xxxMessageEvent(), xxxMinMaximize(), xxxMNCompute(), xxxMNItemSize(), xxxMNLoop(), xxxMNOpenHierarchy(), xxxMNUpdateShownMenu(), xxxMouseEventDirect(), xxxMoveSize(), xxxMS_TrackMove(), xxxMsgWaitForMultipleObjects(), xxxNewITopEx(), xxxNextAniIconStep(), xxxPoke(), xxxPokeAck(), xxxPollAndWaitForSingleObject(), xxxProcessEventMessage(), xxxQueryInformationThread(), xxxRealizePalette(), xxxRedrawHungWindow(), xxxRegisterForDeviceClassNotifications(), xxxRequestAck(), xxxScanSysQueue(), xxxScrollWindowEx(), xxxSendBSMtoDesktop(), xxxSendInput(), xxxSendMenuSelect(), xxxSendMinRectMessages(), xxxSetClassData(), xxxSetForegroundWindow(), xxxSetForegroundWindow2(), xxxSetInformationThread(), xxxSetStaticImage(), xxxSetWindowData(), xxxSetWindowLongPtr(), xxxShowScrollBar(), xxxShowTooltip(), xxxSimpleDoSyncPaint(), xxxStaticPaint(), xxxSwitchDesktop(), xxxSysCommand(), xxxSystemParametersInfo(), xxxTA_AccelerateMenu(), xxxTM_MoveDragRect(), xxxToUnicodeEx(), xxxTrackCaptionButton(), xxxTrackMouse(), xxxTrackMouseMove(), xxxTranslateAccelerator(), xxxTranslateMessage(), xxxUnadviseAck(), xxxUnexpectedClientPost(), xxxUnexpectedServerPost(), xxxUpdatePerUserAccessPackSettings(), xxxUpdatePerUserSystemParameters(), xxxWaitForInputIdle(), xxxWindowEvent(), zzzBltValidBits(), zzzCalcStartCursorHide(), zzzInitTask(), and zzzUpdateCursorImage().

ProcessInstance* gaInstances

| Definition at line 70 of file perfuser.c. Referenced by CleanUpInstances(), CloseUserPerformanceData(), FillInstances(), and GlobalCollect().

BOOL gbInitOK

| Definition at line 76 of file perfuser.c. Referenced by CollectUserPerformanceData(), FillInstances(), and OpenUserPerformanceData().

HANDLE ghHeap

| Definition at line 75 of file perfuser.c.

int gNumInstances

| Definition at line 71 of file perfuser.c. Referenced by CleanUpInstances(), CloseUserPerformanceData(), FillInstances(), and GlobalCollect().

PDWORD gpdwResult

| Definition at line 73 of file perfuser.c. Referenced by CloseUserPerformanceData(), FillInstances(), and GlobalCollect().

PDWORD gpPid

| Definition at line 72 of file perfuser.c. Referenced by CloseUserPerformanceData(), FillInstances(), and GlobalCollect().

LPVOID

| Definition at line 52 of file perfuser.c. Referenced by _InitializeImmEntryTable(), CDPA::Append(), BitmapFromDIB(), ComboBoxWndProcWorker(), ConnectConv(), CProfile::CProfile(), CreateMDIWindowA(), CreateMDIWindowW(), CreateScreenBitmap(), DECLARE_INTERFACE_(), DispatchLocalLock(), DispErrorMsg(), DllInit(), EcImeRequestHandler(), ExtractIconFromEXE(), FindResourceNE(), FindResourcePE(), FixupDdeExecuteIfNecessary(), CDPA::GetPointer(), GetPrimaryMonitor(), GetResourceTableNE(), GetResourceTablePE(), GetVersionDatum(), Idf(), ImeCopyDataHandler(), ImeSystemHandler(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetImeMenuItemsA(), ImmGetImeMenuItemsInterProcess(), ImmGetImeMenuItemsW(), ImmGetImeMenuItemsWorker(), ImmLocalAlloc(), ImmLockIMCC(), ImmPenAuxInput(), ImmPutImeMenuItemsIntoMappedFile(), ImmRequestMessageWorker(), InitConsoleIME(), InternalCreateCallbackThread(), InternalCreateDialog(), InternalDdeInitialize(), IopIsAddressRangeValid(), IopWriteTriageDump(), LoadCP(), LoadLink(), LoadVarVersionInfo(), main(), MakeAResizeDlg(), MemAlloc(), NtUserSystemParametersInfo(), OpenKeyboardLayoutFile(), ProcessDDEMLInitiate(), ReadString(), RegisterDeviceNotification(), RemoteDoMessage(), RVAtoP(), SetFontForMCWVERTICAL(), SmartStretchDIBits(), TransEnterWordRegisterMode(), ValidColorSpace(), xxxInterSendMsgEx(), xxxMNOpenHierarchy(), xxxSystemParametersInfo(), and CDPA::~CDPA().

PM_OPEN_PROC OpenUserPerformanceData

| Definition at line 91 of file perfuser.c.

USER_DATA_DEFINITION UserDataDefinition

| Definition at line 57 of file perfuser.c. Referenced by GlobalCollect(), IsNumberInUnicodeList(), and OpenUserPerformanceData().