ReactOS  0.4.12-dev-102-g4b7f1e0
perfdata.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PERFDATA
 
struct  _CMD_LINE_CACHE
 

Macros

#define Li2Double(x)   ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
 

Typedefs

typedef struct _PERFDATA PERFDATA
 
typedef struct _PERFDATAPPERFDATA
 
typedef struct _CMD_LINE_CACHE CMD_LINE_CACHE
 
typedef struct _CMD_LINE_CACHEPCMD_LINE_CACHE
 

Functions

BOOL PerfDataInitialize (void)
 
void PerfDataUninitialize (void)
 
void PerfDataRefresh (void)
 
BOOL PerfDataGet (ULONG Index, PPERFDATA *lppData)
 
ULONG PerfDataGetProcessIndex (ULONG pid)
 
ULONG PerfDataGetProcessCount (void)
 
ULONG PerfDataGetProcessorUsage (void)
 
ULONG PerfDataGetProcessorSystemUsage (void)
 
BOOL PerfDataGetImageName (ULONG Index, LPWSTR lpImageName, ULONG nMaxCount)
 
ULONG PerfDataGetProcessId (ULONG Index)
 
BOOL PerfDataGetUserName (ULONG Index, LPWSTR lpUserName, ULONG nMaxCount)
 
BOOL PerfDataGetCommandLine (ULONG Index, LPWSTR lpCommandLine, ULONG nMaxCount)
 
void PerfDataDeallocCommandLineCache ()
 
ULONG PerfDataGetSessionId (ULONG Index)
 
ULONG PerfDataGetCPUUsage (ULONG Index)
 
LARGE_INTEGER PerfDataGetCPUTime (ULONG Index)
 
ULONG PerfDataGetWorkingSetSizeBytes (ULONG Index)
 
ULONG PerfDataGetPeakWorkingSetSizeBytes (ULONG Index)
 
ULONG PerfDataGetWorkingSetSizeDelta (ULONG Index)
 
ULONG PerfDataGetPageFaultCount (ULONG Index)
 
ULONG PerfDataGetPageFaultCountDelta (ULONG Index)
 
ULONG PerfDataGetVirtualMemorySizeBytes (ULONG Index)
 
ULONG PerfDataGetPagedPoolUsagePages (ULONG Index)
 
ULONG PerfDataGetNonPagedPoolUsagePages (ULONG Index)
 
ULONG PerfDataGetBasePriority (ULONG Index)
 
ULONG PerfDataGetHandleCount (ULONG Index)
 
ULONG PerfDataGetThreadCount (ULONG Index)
 
ULONG PerfDataGetUSERObjectCount (ULONG Index)
 
ULONG PerfDataGetGDIObjectCount (ULONG Index)
 
BOOL PerfDataGetIOCounters (ULONG Index, PIO_COUNTERS pIoCounters)
 
ULONG PerfDataGetCommitChargeTotalK (void)
 
ULONG PerfDataGetCommitChargeLimitK (void)
 
ULONG PerfDataGetCommitChargePeakK (void)
 
ULONG PerfDataGetKernelMemoryTotalK (void)
 
ULONG PerfDataGetKernelMemoryPagedK (void)
 
ULONG PerfDataGetKernelMemoryNonPagedK (void)
 
ULONG PerfDataGetPhysicalMemoryTotalK (void)
 
ULONG PerfDataGetPhysicalMemoryAvailableK (void)
 
ULONG PerfDataGetPhysicalMemorySystemCacheK (void)
 
ULONG PerfDataGetSystemHandleCount (void)
 
ULONG PerfDataGetTotalThreadCount (void)
 

Macro Definition Documentation

◆ Li2Double

#define Li2Double (   x)    ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))

Definition at line 29 of file perfdata.h.

Referenced by PerfDataRefresh().

Typedef Documentation

◆ CMD_LINE_CACHE

◆ PCMD_LINE_CACHE

◆ PERFDATA

◆ PPERFDATA

Function Documentation

◆ PerfDataDeallocCommandLineCache()

void PerfDataDeallocCommandLineCache ( )

Definition at line 659 of file perfdata.c.

Referenced by TaskManagerWndProc().

660 {
662  PCMD_LINE_CACHE cache_old;
663 
664  while (cache && cache->pnext != NULL)
665  {
666  cache_old = cache;
667  cache = cache->pnext;
668 
669  HeapFree(GetProcessHeap(), 0, cache_old);
670  }
671 }
Definition: cache.c:46
struct _CMD_LINE_CACHE * pnext
Definition: perfdata.h:63
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
static IOleCache * cache
Definition: ole2.c:81
#define HeapFree(x, y, z)
Definition: compat.h:394
PCMD_LINE_CACHE global_cache
Definition: perfdata.c:51

◆ PerfDataGet()

BOOL PerfDataGet ( ULONG  Index,
PPERFDATA lppData 
)

Definition at line 1133 of file perfdata.c.

1134 {
1135  BOOL bSuccessful = FALSE;
1136 
1138  if (Index < ProcessCount)
1139  {
1140  *lppData = pPerfData + Index;
1141  bSuccessful = TRUE;
1142  }
1144  return bSuccessful;
1145 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
unsigned int BOOL
Definition: ntddk_ex.h:94
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetBasePriority()

ULONG PerfDataGetBasePriority ( ULONG  Index)

Definition at line 847 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

848 {
849  ULONG BasePriority;
850 
852 
853  if (Index < ProcessCount)
854  BasePriority = pPerfData[Index].BasePriority;
855  else
856  BasePriority = 0;
857 
859 
860  return BasePriority;
861 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG BasePriority
Definition: perfdata.h:47
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetCommandLine()

BOOL PerfDataGetCommandLine ( ULONG  Index,
LPWSTR  lpCommandLine,
ULONG  nMaxCount 
)

Definition at line 549 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

550 {
551  static const LPWSTR ellipsis = L"...";
552 
554  UNICODE_STRING CommandLineStr = {0};
555 
556  PVOID ProcessParams = NULL;
559 
561  BOOL result;
562 
563  PCMD_LINE_CACHE new_entry;
565 
567 
568  /* [A] Search for a string already in cache? If so, use it */
569  while (cache && cache->pnext != NULL)
570  {
571  if (cache->idx == Index && cache->str != NULL)
572  {
573  /* Found it. Use it, and add some ellipsis at the very end to make it cute */
574  wcsncpy(lpCommandLine, cache->str, CMD_LINE_MIN(nMaxCount, cache->len));
575  wcscpy(lpCommandLine + CMD_LINE_MIN(nMaxCount, cache->len) - wcslen(ellipsis), ellipsis);
576  return TRUE;
577  }
578 
579  cache = cache->pnext;
580  }
581 
582  /* [B] We don't; let's allocate and load a value from the process mem... and cache it */
583  ProcessId = PerfDataGetProcessId(Index);
584 
585  /* Default blank command line in case things don't work out */
586  wcsncpy(lpCommandLine, L"", nMaxCount);
587 
588  /* Ask for a handle to the target process so that we can read its memory and query stuff */
590  if (!hProcess)
591  goto cleanup;
592 
593  /* First off, get the ProcessEnvironmentBlock location in that process' address space */
594  Status = NtQueryInformationProcess(hProcess, 0, &pbi, sizeof(pbi), NULL);
595  if (!NT_SUCCESS(Status))
596  goto cleanup;
597 
598  /* Then get the PEB.ProcessParameters member pointer */
599  result = ReadProcessMemory(hProcess,
600  (PVOID)((ULONG_PTR)pbi.PebBaseAddress + FIELD_OFFSET(PEB, ProcessParameters)),
601  &ProcessParams,
602  sizeof(ProcessParams),
603  NULL);
604  if (!result)
605  goto cleanup;
606 
607  /* Then copy the PEB->ProcessParameters.CommandLine member
608  to get the pointer to the string buffer and its size */
609  result = ReadProcessMemory(hProcess,
610  (PVOID)((ULONG_PTR)ProcessParams + FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, CommandLine)),
611  &CommandLineStr,
612  sizeof(CommandLineStr),
613  NULL);
614  if (!result)
615  goto cleanup;
616 
617  /* Allocate the next cache entry and its accompanying string in one go */
618  new_entry = HeapAlloc(GetProcessHeap(),
620  sizeof(CMD_LINE_CACHE) + CommandLineStr.Length + sizeof(UNICODE_NULL));
621  if (!new_entry)
622  goto cleanup;
623 
624  new_string = (LPWSTR)((ULONG_PTR)new_entry + sizeof(CMD_LINE_CACHE));
625 
626  /* Bingo, the command line should be stored there,
627  copy the string from the other process */
628  result = ReadProcessMemory(hProcess,
629  CommandLineStr.Buffer,
630  new_string,
631  CommandLineStr.Length,
632  NULL);
633  if (!result)
634  {
635  /* Weird, after successfully reading the mem of that process
636  various times it fails now, forget it and bail out */
637  HeapFree(GetProcessHeap(), 0, new_entry);
638  goto cleanup;
639  }
640 
641  /* Add our pointer to the cache... */
642  new_entry->idx = Index;
643  new_entry->str = new_string;
644  new_entry->len = CommandLineStr.Length;
645 
646  if (!global_cache)
647  global_cache = new_entry;
648  else
649  cache->pnext = new_entry;
650 
651  /* ... and print the buffer for the first time */
652  wcsncpy(lpCommandLine, new_string, CMD_LINE_MIN(nMaxCount, CommandLineStr.Length));
653 
654 cleanup:
655  if (hProcess) CloseHandle(hProcess);
656  return TRUE;
657 }
#define CMD_LINE_MIN(a, b)
Definition: perfdata.c:53
Definition: cache.c:46
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:158
struct _CMD_LINE_CACHE * pnext
Definition: perfdata.h:63
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI NtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength OPTIONAL)
Definition: query.c:59
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
#define ReadProcessMemory(a, b, c, d, e)
Definition: compat.h:415
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PERBANDINFO * pbi
Definition: winddi.h:3917
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
ULONG PerfDataGetProcessId(ULONG Index)
Definition: perfdata.c:515
static const UCHAR Index[8]
Definition: usbohci.c:18
static void new_string(void)
Definition: ppl.yy.c:4182
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1087
struct _CMD_LINE_CACHE CMD_LINE_CACHE
Status
Definition: gdiplustypes.h:24
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1257
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define PROCESS_VM_READ
Definition: pstypes.h:153
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
_In_ int nMaxCount
Definition: winuser.h:4746
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
PCMD_LINE_CACHE global_cache
Definition: perfdata.c:51
LPWSTR str
Definition: perfdata.h:61

◆ PerfDataGetCommitChargeLimitK()

ULONG PerfDataGetCommitChargeLimitK ( void  )

Definition at line 963 of file perfdata.c.

Referenced by Graph_DrawMemUsageGraph(), and PerformancePageRefreshThread().

964 {
965  ULONG Limit;
966  ULONG PageSize;
967 
969 
970  Limit = SystemPerfInfo.CommitLimit;
971  PageSize = SystemBasicInfo.PageSize;
972 
974 
975  Limit = Limit * (PageSize / 1024);
976 
977  return Limit;
978 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
_In_ LONG _In_ LONG Limit
Definition: kefuncs.h:328

◆ PerfDataGetCommitChargePeakK()

ULONG PerfDataGetCommitChargePeakK ( void  )

Definition at line 980 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

981 {
982  ULONG Peak;
983  ULONG PageSize;
984 
986 
988  PageSize = SystemBasicInfo.PageSize;
989 
991 
992  Peak = Peak * (PageSize / 1024);
993 
994  return Peak;
995 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetCommitChargeTotalK()

ULONG PerfDataGetCommitChargeTotalK ( void  )

Definition at line 946 of file perfdata.c.

Referenced by Graph_DrawMemUsageGraph(), and PerformancePageRefreshThread().

947 {
948  ULONG Total;
949  ULONG PageSize;
950 
952 
954  PageSize = SystemBasicInfo.PageSize;
955 
957 
958  Total = Total * (PageSize / 1024);
959 
960  return Total;
961 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetCPUTime()

LARGE_INTEGER PerfDataGetCPUTime ( ULONG  Index)

Definition at line 705 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

706 {
707  LARGE_INTEGER CpuTime = {{0,0}};
708 
710 
711  if (Index < ProcessCount)
712  CpuTime = pPerfData[Index].CPUTime;
713 
715 
716  return CpuTime;
717 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
LARGE_INTEGER CPUTime
Definition: perfdata.h:38
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetCPUUsage()

ULONG PerfDataGetCPUUsage ( ULONG  Index)

Definition at line 689 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

690 {
691  ULONG CpuUsage;
692 
694 
695  if (Index < ProcessCount)
696  CpuUsage = pPerfData[Index].CPUUsage;
697  else
698  CpuUsage = 0;
699 
701 
702  return CpuUsage;
703 }
ULONG CPUUsage
Definition: perfdata.h:37
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetGDIObjectCount()

ULONG PerfDataGetGDIObjectCount ( ULONG  Index)

Definition at line 911 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

912 {
913  ULONG GDIObjectCount;
914 
916 
917  if (Index < ProcessCount)
918  GDIObjectCount = pPerfData[Index].GDIObjectCount;
919  else
920  GDIObjectCount = 0;
921 
923 
924  return GDIObjectCount;
925 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
ULONG GDIObjectCount
Definition: perfdata.h:51
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetHandleCount()

ULONG PerfDataGetHandleCount ( ULONG  Index)

Definition at line 863 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

864 {
865  ULONG HandleCount;
866 
868 
869  if (Index < ProcessCount)
870  HandleCount = pPerfData[Index].HandleCount;
871  else
872  HandleCount = 0;
873 
875 
876  return HandleCount;
877 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
ULONG HandleCount
Definition: perfdata.h:48
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetImageName()

BOOL PerfDataGetImageName ( ULONG  Index,
LPWSTR  lpImageName,
ULONG  nMaxCount 
)

Definition at line 499 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

500 {
501  BOOL bSuccessful;
502 
504 
505  if (Index < ProcessCount) {
506  wcsncpy(lpImageName, pPerfData[Index].ImageName, nMaxCount);
507  bSuccessful = TRUE;
508  } else {
509  bSuccessful = FALSE;
510  }
512  return bSuccessful;
513 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
unsigned int BOOL
Definition: ntddk_ex.h:94
static const UCHAR Index[8]
Definition: usbohci.c:18
static const char * ImageName
Definition: image.c:34
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
_In_ int nMaxCount
Definition: winuser.h:4746

◆ PerfDataGetIOCounters()

BOOL PerfDataGetIOCounters ( ULONG  Index,
PIO_COUNTERS  pIoCounters 
)

Definition at line 927 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

928 {
929  BOOL bSuccessful;
930 
932 
933  if (Index < ProcessCount)
934  {
935  memcpy(pIoCounters, &pPerfData[Index].IOCounters, sizeof(IO_COUNTERS));
936  bSuccessful = TRUE;
937  }
938  else
939  bSuccessful = FALSE;
940 
942 
943  return bSuccessful;
944 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
unsigned int BOOL
Definition: ntddk_ex.h:94
static const UCHAR Index[8]
Definition: usbohci.c:18
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetKernelMemoryNonPagedK()

ULONG PerfDataGetKernelMemoryNonPagedK ( void  )

Definition at line 1037 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1038 {
1039  ULONG NonPaged;
1040  ULONG PageSize;
1041 
1043 
1044  NonPaged = SystemPerfInfo.NonPagedPoolPages;
1045  PageSize = SystemBasicInfo.PageSize;
1046 
1048 
1049  NonPaged = NonPaged * (PageSize / 1024);
1050 
1051  return NonPaged;
1052 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetKernelMemoryPagedK()

ULONG PerfDataGetKernelMemoryPagedK ( void  )

Definition at line 1020 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1021 {
1022  ULONG Paged;
1023  ULONG PageSize;
1024 
1026 
1028  PageSize = SystemBasicInfo.PageSize;
1029 
1031 
1032  Paged = Paged * (PageSize / 1024);
1033 
1034  return Paged;
1035 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetKernelMemoryTotalK()

ULONG PerfDataGetKernelMemoryTotalK ( void  )

Definition at line 997 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

998 {
999  ULONG Total;
1000  ULONG Paged;
1001  ULONG NonPaged;
1002  ULONG PageSize;
1003 
1005 
1007  NonPaged = SystemPerfInfo.NonPagedPoolPages;
1008  PageSize = SystemBasicInfo.PageSize;
1009 
1011 
1012  Paged = Paged * (PageSize / 1024);
1013  NonPaged = NonPaged * (PageSize / 1024);
1014 
1015  Total = Paged + NonPaged;
1016 
1017  return Total;
1018 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetNonPagedPoolUsagePages()

ULONG PerfDataGetNonPagedPoolUsagePages ( ULONG  Index)

Definition at line 831 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

832 {
833  ULONG NonPagedPoolUsage;
834 
836 
837  if (Index < ProcessCount)
838  NonPagedPoolUsage = pPerfData[Index].NonPagedPoolUsagePages;
839  else
840  NonPagedPoolUsage = 0;
841 
843 
844  return NonPagedPoolUsage;
845 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
ULONG NonPagedPoolUsagePages
Definition: perfdata.h:46
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPagedPoolUsagePages()

ULONG PerfDataGetPagedPoolUsagePages ( ULONG  Index)

Definition at line 815 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

816 {
817  ULONG PagedPoolUsage;
818 
820 
821  if (Index < ProcessCount)
822  PagedPoolUsage = pPerfData[Index].PagedPoolUsagePages;
823  else
824  PagedPoolUsage = 0;
825 
827 
828  return PagedPoolUsage;
829 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
ULONG PagedPoolUsagePages
Definition: perfdata.h:45

◆ PerfDataGetPageFaultCount()

ULONG PerfDataGetPageFaultCount ( ULONG  Index)

Definition at line 767 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

768 {
769  ULONG PageFaultCount;
770 
772 
773  if (Index < ProcessCount)
774  PageFaultCount = pPerfData[Index].PageFaultCount;
775  else
776  PageFaultCount = 0;
777 
779 
780  return PageFaultCount;
781 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG PageFaultCount
Definition: perfdata.h:42
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPageFaultCountDelta()

ULONG PerfDataGetPageFaultCountDelta ( ULONG  Index)

Definition at line 783 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

784 {
785  ULONG PageFaultCountDelta;
786 
788 
789  if (Index < ProcessCount)
790  PageFaultCountDelta = pPerfData[Index].PageFaultCountDelta;
791  else
792  PageFaultCountDelta = 0;
793 
795 
796  return PageFaultCountDelta;
797 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
ULONG PageFaultCountDelta
Definition: perfdata.h:43
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPeakWorkingSetSizeBytes()

ULONG PerfDataGetPeakWorkingSetSizeBytes ( ULONG  Index)

Definition at line 735 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

736 {
737  ULONG PeakWorkingSetSizeBytes;
738 
740 
741  if (Index < ProcessCount)
742  PeakWorkingSetSizeBytes = pPerfData[Index].PeakWorkingSetSizeBytes;
743  else
744  PeakWorkingSetSizeBytes = 0;
745 
747 
748  return PeakWorkingSetSizeBytes;
749 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG PeakWorkingSetSizeBytes
Definition: perfdata.h:40
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPhysicalMemoryAvailableK()

ULONG PerfDataGetPhysicalMemoryAvailableK ( void  )

Definition at line 1071 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1072 {
1073  ULONG Available;
1074  ULONG PageSize;
1075 
1077 
1078  Available = SystemPerfInfo.AvailablePages;
1079  PageSize = SystemBasicInfo.PageSize;
1080 
1082 
1083  Available = Available * (PageSize / 1024);
1084 
1085  return Available;
1086 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPhysicalMemorySystemCacheK()

ULONG PerfDataGetPhysicalMemorySystemCacheK ( void  )

Definition at line 1088 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1089 {
1090  ULONG SystemCache;
1091  ULONG PageSize;
1092 
1094 
1095  PageSize = SystemBasicInfo.PageSize;
1096  SystemCache = SystemCacheInfo.CurrentSizeIncludingTransitionInPages * PageSize;
1097 
1099 
1100  return SystemCache / 1024;
1101 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SIZE_T CurrentSizeIncludingTransitionInPages
Definition: extypes.h:1115
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
SYSTEM_FILECACHE_INFORMATION SystemCacheInfo
Definition: perfdata.c:46
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetPhysicalMemoryTotalK()

ULONG PerfDataGetPhysicalMemoryTotalK ( void  )

Definition at line 1054 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1055 {
1056  ULONG Total;
1057  ULONG PageSize;
1058 
1060 
1062  PageSize = SystemBasicInfo.PageSize;
1063 
1065 
1066  Total = Total * (PageSize / 1024);
1067 
1068  return Total;
1069 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetProcessCount()

ULONG PerfDataGetProcessCount ( void  )

Definition at line 472 of file perfdata.c.

Referenced by PerformancePageRefreshThread(), and UpdateProcesses().

473 {
474  ULONG Result;
476  Result = ProcessCount;
478  return Result;
479 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetProcessId()

ULONG PerfDataGetProcessId ( ULONG  Index)

Definition at line 515 of file perfdata.c.

Referenced by AddProcess(), PerfDataGetCommandLine(), and PerfDataGetText().

516 {
518 
520 
521  if (Index < ProcessCount)
522  ProcessId = PtrToUlong(pPerfData[Index].ProcessId);
523  else
524  ProcessId = 0;
525 
527 
528  return ProcessId;
529 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
#define PtrToUlong(p)
Definition: basetsd.h:83
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetProcessIndex()

ULONG PerfDataGetProcessIndex ( ULONG  pid)

Definition at line 449 of file perfdata.c.

Referenced by ProcessPageCompareFunc(), and ProcessPageOnNotify().

450 {
451  ULONG idx;
452 
454 
455  for (idx = 0; idx < ProcessCount; idx++)
456  {
457  if (PtrToUlong(pPerfData[idx].ProcessId) == pid)
458  {
459  break;
460  }
461  }
462 
464 
465  if (idx == ProcessCount)
466  {
467  return -1;
468  }
469  return idx;
470 }
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
unsigned int idx
Definition: utils.c:41
PPERFDATA pPerfData
Definition: perfdata.c:35
#define PtrToUlong(p)
Definition: basetsd.h:83
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetProcessorSystemUsage()

ULONG PerfDataGetProcessorSystemUsage ( void  )

Definition at line 490 of file perfdata.c.

Referenced by Graph_DrawCpuUsageGraph(), and PerformancePageRefreshThread().

491 {
492  ULONG Result;
494  Result = (ULONG)dbKernelTime;
496  return Result;
497 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
double dbKernelTime
Definition: perfdata.c:39
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetProcessorUsage()

ULONG PerfDataGetProcessorUsage ( void  )

Definition at line 481 of file perfdata.c.

Referenced by Graph_DrawCpuUsageGraph(), PerformancePageRefreshThread(), TrayIcon_GetProcessorUsageIcon(), TrayIcon_ShellAddTrayIcon(), and TrayIcon_ShellUpdateTrayIcon().

482 {
483  ULONG Result;
485  Result = (ULONG)dbIdleTime;
487  return Result;
488 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
double dbIdleTime
Definition: perfdata.c:38

◆ PerfDataGetSessionId()

ULONG PerfDataGetSessionId ( ULONG  Index)

Definition at line 673 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

674 {
676 
678 
679  if (Index < ProcessCount)
680  SessionId = pPerfData[Index].SessionId;
681  else
682  SessionId = 0;
683 
685 
686  return SessionId;
687 }
ULONG SessionId
Definition: dllmain.c:28
ULONG SessionId
Definition: perfdata.h:36
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetSystemHandleCount()

ULONG PerfDataGetSystemHandleCount ( void  )

Definition at line 1103 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1104 {
1105  ULONG HandleCount;
1106 
1108 
1109  HandleCount = SystemHandleInfo.NumberOfHandles;
1110 
1112 
1113  return HandleCount;
1114 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
SYSTEM_HANDLE_INFORMATION SystemHandleInfo
Definition: perfdata.c:47
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetThreadCount()

ULONG PerfDataGetThreadCount ( ULONG  Index)

Definition at line 879 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

880 {
881  ULONG ThreadCount;
882 
884 
885  if (Index < ProcessCount)
886  ThreadCount = pPerfData[Index].ThreadCount;
887  else
888  ThreadCount = 0;
889 
891 
892  return ThreadCount;
893 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG ThreadCount
Definition: perfdata.h:49
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetTotalThreadCount()

ULONG PerfDataGetTotalThreadCount ( void  )

Definition at line 1116 of file perfdata.c.

Referenced by PerformancePageRefreshThread().

1117 {
1118  ULONG ThreadCount = 0;
1119  ULONG i;
1120 
1122 
1123  for (i=0; i<ProcessCount; i++)
1124  {
1125  ThreadCount += pPerfData[i].ThreadCount;
1126  }
1127 
1129 
1130  return ThreadCount;
1131 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
GLenum GLclampf GLint i
Definition: glfuncs.h:14
PPERFDATA pPerfData
Definition: perfdata.c:35
ULONG ThreadCount
Definition: perfdata.h:49
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetUserName()

BOOL PerfDataGetUserName ( ULONG  Index,
LPWSTR  lpUserName,
ULONG  nMaxCount 
)

Definition at line 531 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

532 {
533  BOOL bSuccessful;
534 
536 
537  if (Index < ProcessCount) {
538  wcsncpy(lpUserName, pPerfData[Index].UserName, nMaxCount);
539  bSuccessful = TRUE;
540  } else {
541  bSuccessful = FALSE;
542  }
543 
545 
546  return bSuccessful;
547 }
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
unsigned int BOOL
Definition: ntddk_ex.h:94
static const UCHAR Index[8]
Definition: usbohci.c:18
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
_In_ int nMaxCount
Definition: winuser.h:4746

◆ PerfDataGetUSERObjectCount()

ULONG PerfDataGetUSERObjectCount ( ULONG  Index)

Definition at line 895 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

896 {
897  ULONG USERObjectCount;
898 
900 
901  if (Index < ProcessCount)
902  USERObjectCount = pPerfData[Index].USERObjectCount;
903  else
904  USERObjectCount = 0;
905 
907 
908  return USERObjectCount;
909 }
ULONG USERObjectCount
Definition: perfdata.h:50
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetVirtualMemorySizeBytes()

ULONG PerfDataGetVirtualMemorySizeBytes ( ULONG  Index)

Definition at line 799 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

800 {
801  ULONG VirtualMemorySizeBytes;
802 
804 
805  if (Index < ProcessCount)
806  VirtualMemorySizeBytes = pPerfData[Index].VirtualMemorySizeBytes;
807  else
808  VirtualMemorySizeBytes = 0;
809 
811 
812  return VirtualMemorySizeBytes;
813 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
ULONG VirtualMemorySizeBytes
Definition: perfdata.h:44

◆ PerfDataGetWorkingSetSizeBytes()

ULONG PerfDataGetWorkingSetSizeBytes ( ULONG  Index)

Definition at line 719 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

720 {
721  ULONG WorkingSetSizeBytes;
722 
724 
725  if (Index < ProcessCount)
726  WorkingSetSizeBytes = pPerfData[Index].WorkingSetSizeBytes;
727  else
728  WorkingSetSizeBytes = 0;
729 
731 
732  return WorkingSetSizeBytes;
733 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG WorkingSetSizeBytes
Definition: perfdata.h:39
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataGetWorkingSetSizeDelta()

ULONG PerfDataGetWorkingSetSizeDelta ( ULONG  Index)

Definition at line 751 of file perfdata.c.

Referenced by PerfDataGetText(), and ProcessPageCompareFunc().

752 {
753  ULONG WorkingSetSizeDelta;
754 
756 
757  if (Index < ProcessCount)
758  WorkingSetSizeDelta = pPerfData[Index].WorkingSetSizeDelta;
759  else
760  WorkingSetSizeDelta = 0;
761 
763 
764  return WorkingSetSizeDelta;
765 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
ULONG ProcessCount
Definition: perfdata.c:37
PPERFDATA pPerfData
Definition: perfdata.c:35
ULONG WorkingSetSizeDelta
Definition: perfdata.h:41
static const UCHAR Index[8]
Definition: usbohci.c:18
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ PerfDataInitialize()

BOOL PerfDataInitialize ( void  )

Definition at line 64 of file perfdata.c.

Referenced by wWinMain().

65 {
68 
70 
71  /*
72  * Get number of processors in the system
73  */
75  if (!NT_SUCCESS(status))
76  return FALSE;
77 
78  /*
79  * Create the SYSTEM Sid
80  */
81  AllocateAndInitializeSid(&NtSidAuthority, 1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &SystemUserSid);
82  return TRUE;
83 }
#define SECURITY_LOCAL_SYSTEM_RID
Definition: setypes.h:546
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
PSID SystemUserSid
Definition: perfdata.c:49
LONG NTSTATUS
Definition: precomp.h:26
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
static SID_IDENTIFIER_AUTHORITY NtSidAuthority
Definition: samrpc.c:14
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:526
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
#define SystemBasicInformation
Definition: xboxvmp.h:35
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
static SERVICE_STATUS status
Definition: service.c:31
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:549

◆ PerfDataRefresh()

void PerfDataRefresh ( void  )

Definition at line 175 of file perfdata.c.

Referenced by _tmain(), OnCreate(), and TaskManagerWndProc().

176 {
177  ULONG ulSize;
179  LPBYTE pBuffer;
182  PPERFDATA pPDOld;
183  ULONG Idx, Idx2;
185  HANDLE hProcessToken;
186  SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo;
187  SYSTEM_TIMEOFDAY_INFORMATION SysTimeInfo;
188  SYSTEM_FILECACHE_INFORMATION SysCacheInfo;
189  LPBYTE SysHandleInfoData;
190  PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcessorTimeInfo;
191  double CurrentKernelTime;
192  PSECURITY_DESCRIPTOR ProcessSD;
193  PSID ProcessUser;
194  ULONG Buffer[64]; /* must be 4 bytes aligned! */
195  ULONG cwcUserName;
196 
197  /* Get new system time */
198  status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo, sizeof(SysTimeInfo), NULL);
199  if (!NT_SUCCESS(status))
200  return;
201 
202  /* Get new CPU's idle time */
203  status = NtQuerySystemInformation(SystemPerformanceInformation, &SysPerfInfo, sizeof(SysPerfInfo), NULL);
204  if (!NT_SUCCESS(status))
205  return;
206 
207  /* Get system cache information */
208  status = NtQuerySystemInformation(SystemFileCacheInformation, &SysCacheInfo, sizeof(SysCacheInfo), NULL);
209  if (!NT_SUCCESS(status))
210  return;
211 
212  /* Get processor time information */
215 
216  if (!NT_SUCCESS(status))
217  {
218  if (SysProcessorTimeInfo != NULL)
219  HeapFree(GetProcessHeap(), 0, SysProcessorTimeInfo);
220  return;
221  }
222 
223  /* Get handle information
224  * We don't know how much data there is so just keep
225  * increasing the buffer size until the call succeeds
226  */
227  BufferSize = 0;
228  do
229  {
230  BufferSize += 0x10000;
231  SysHandleInfoData = (LPBYTE)HeapAlloc(GetProcessHeap(), 0, BufferSize);
232 
233  status = NtQuerySystemInformation(SystemHandleInformation, SysHandleInfoData, BufferSize, &ulSize);
234 
235  if (status == STATUS_INFO_LENGTH_MISMATCH) {
236  HeapFree(GetProcessHeap(), 0, SysHandleInfoData);
237  }
238 
239  } while (status == STATUS_INFO_LENGTH_MISMATCH);
240 
241  /* Get process information
242  * We don't know how much data there is so just keep
243  * increasing the buffer size until the call succeeds
244  */
245  BufferSize = 0;
246  do
247  {
248  BufferSize += 0x10000;
249  pBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(), 0, BufferSize);
250 
251  status = NtQuerySystemInformation(SystemProcessInformation, pBuffer, BufferSize, &ulSize);
252 
253  if (status == STATUS_INFO_LENGTH_MISMATCH) {
254  HeapFree(GetProcessHeap(), 0, pBuffer);
255  }
256 
257  } while (status == STATUS_INFO_LENGTH_MISMATCH);
258 
260 
261  /*
262  * Save system performance info
263  */
264  memcpy(&SystemPerfInfo, &SysPerfInfo, sizeof(SYSTEM_PERFORMANCE_INFORMATION));
265 
266  /*
267  * Save system cache info
268  */
269  memcpy(&SystemCacheInfo, &SysCacheInfo, sizeof(SYSTEM_FILECACHE_INFORMATION));
270 
271  /*
272  * Save system processor time info
273  */
276  }
277  SystemProcessorTimeInfo = SysProcessorTimeInfo;
278 
279  /*
280  * Save system handle info
281  */
282  memcpy(&SystemHandleInfo, SysHandleInfoData, sizeof(SYSTEM_HANDLE_INFORMATION));
283  HeapFree(GetProcessHeap(), 0, SysHandleInfoData);
284 
285  for (CurrentKernelTime=0, Idx=0; Idx<(ULONG)SystemBasicInfo.NumberOfProcessors; Idx++) {
286  CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].KernelTime);
287  CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].DpcTime);
288  CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].InterruptTime);
289  }
290 
291  /* If it's a first call - skip idle time calcs */
292  if (liOldIdleTime.QuadPart != 0) {
293  /* CurrentValue = NewValue - OldValue */
295  dbKernelTime = CurrentKernelTime - OldKernelTime;
297 
298  /* CurrentCpuIdle = IdleTime / SystemTime */
301 
302  /* CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors */
303  dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */
304  dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */
305  }
306 
307  /* Store new CPU's idle and system time */
308  liOldIdleTime = SysPerfInfo.IdleProcessTime;
309  liOldSystemTime = SysTimeInfo.CurrentTime;
310  OldKernelTime = CurrentKernelTime;
311 
312  /* Determine the process count
313  * We loop through the data we got from NtQuerySystemInformation
314  * and count how many structures there are (until RelativeOffset is 0)
315  */
317  ProcessCount = 0;
318  pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer;
319  while (pSPI) {
320  ProcessCount++;
321  if (pSPI->NextEntryOffset == 0)
322  break;
323  pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->NextEntryOffset);
324  }
325 
326  /* Now alloc a new PERFDATA array and fill in the data */
328 
329  pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer;
330  for (Idx=0; Idx<ProcessCount; Idx++) {
331  /* Get the old perf data for this process (if any) */
332  /* so that we can establish delta values */
333  pPDOld = NULL;
334  if (pPerfDataOld) {
335  for (Idx2=0; Idx2<ProcessCountOld; Idx2++) {
336  if (pPerfDataOld[Idx2].ProcessId == pSPI->UniqueProcessId) {
337  pPDOld = &pPerfDataOld[Idx2];
338  break;
339  }
340  }
341  }
342 
343  if (pSPI->ImageName.Buffer) {
344  /* Don't assume a UNICODE_STRING Buffer is zero terminated: */
345  int len = pSPI->ImageName.Length / 2;
346  /* Check against max size and allow for terminating zero (already zeroed): */
347  if(len >= MAX_PATH)len=MAX_PATH - 1;
348  wcsncpy(pPerfData[Idx].ImageName, pSPI->ImageName.Buffer, len);
349  } else {
351  sizeof(pPerfData[Idx].ImageName) / sizeof(pPerfData[Idx].ImageName[0]));
352  }
353 
354  pPerfData[Idx].ProcessId = pSPI->UniqueProcessId;
355 
356  if (pPDOld) {
357  double CurTime = Li2Double(pSPI->KernelTime) + Li2Double(pSPI->UserTime);
358  double OldTime = Li2Double(pPDOld->KernelTime) + Li2Double(pPDOld->UserTime);
359  double CpuTime = (CurTime - OldTime) / dbSystemTime;
360  CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */
361  pPerfData[Idx].CPUUsage = (ULONG)CpuTime;
362  }
366  if (pPDOld)
368  else
371  if (pPDOld)
373  else
378  pPerfData[Idx].BasePriority = pSPI->BasePriority;
379  pPerfData[Idx].HandleCount = pSPI->HandleCount;
381  pPerfData[Idx].SessionId = pSPI->SessionId;
382  pPerfData[Idx].UserName[0] = UNICODE_NULL;
383  pPerfData[Idx].USERObjectCount = 0;
384  pPerfData[Idx].GDIObjectCount = 0;
385  ProcessUser = SystemUserSid;
386  ProcessSD = NULL;
387 
388  if (pSPI->UniqueProcessId != NULL) {
390  if (hProcess) {
391  /* don't query the information of the system process. It's possible but
392  returns Administrators as the owner of the process instead of SYSTEM */
393  if (pSPI->UniqueProcessId != (HANDLE)0x4)
394  {
395  if (OpenProcessToken(hProcess, TOKEN_QUERY, &hProcessToken))
396  {
397  DWORD RetLen = 0;
398  BOOL Ret;
399 
400  Ret = GetTokenInformation(hProcessToken, TokenUser, (LPVOID)Buffer, sizeof(Buffer), &RetLen);
401  CloseHandle(hProcessToken);
402 
403  if (Ret)
404  ProcessUser = ((PTOKEN_USER)Buffer)->User.Sid;
405  else
406  goto ReadProcOwner;
407  }
408  else
409  {
410 ReadProcOwner:
411  GetSecurityInfo(hProcess, SE_KERNEL_OBJECT, OWNER_SECURITY_INFORMATION, &ProcessUser, NULL, NULL, NULL, &ProcessSD);
412  }
413 
414  pPerfData[Idx].USERObjectCount = GetGuiResources(hProcess, GR_USEROBJECTS);
415  pPerfData[Idx].GDIObjectCount = GetGuiResources(hProcess, GR_GDIOBJECTS);
416  }
417 
418  GetProcessIoCounters(hProcess, &pPerfData[Idx].IOCounters);
419  CloseHandle(hProcess);
420  } else {
421  goto ClearInfo;
422  }
423  } else {
424 ClearInfo:
425  /* clear information we were unable to fetch */
426  ZeroMemory(&pPerfData[Idx].IOCounters, sizeof(IO_COUNTERS));
427  }
428 
429  cwcUserName = sizeof(pPerfData[0].UserName) / sizeof(pPerfData[0].UserName[0]);
430  CachedGetUserFromSid(ProcessUser, pPerfData[Idx].UserName, &cwcUserName);
431 
432  if (ProcessSD != NULL)
433  {
434  LocalFree((HLOCAL)ProcessSD);
435  }
436 
439  pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->NextEntryOffset);
440  }
441  HeapFree(GetProcessHeap(), 0, pBuffer);
442  if (pPerfDataOld) {
444  }
447 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo
Definition: perfdata.c:48
struct _PERFDATA * PPERFDATA
#define CloseHandle
Definition: compat.h:398
PSID SystemUserSid
Definition: perfdata.c:49
WCHAR UserName[MAX_PATH]
Definition: perfdata.h:35
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:158
ULONG ProcessCountOld
Definition: perfdata.c:36
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, PSID *ppsidOwner, PSID *ppsidGroup, PACL *ppDacl, PACL *ppSacl, PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
Definition: misc.c:1244
ULONG SessionId
Definition: perfdata.h:36
#define ZeroMemory
Definition: winbase.h:1635
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
EXTINLINE DWORD WINAPI GetGuiResources(HANDLE hProcess, DWORD uiFlags)
Definition: ntwrapper.h:64
ULONG USERObjectCount
Definition: perfdata.h:50
ULONG CPUUsage
Definition: perfdata.h:37
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
ULONG ProcessCount
Definition: perfdata.c:37
LARGE_INTEGER CurrentTime
Definition: extypes.h:846
struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
unsigned char * LPBYTE
Definition: typedefs.h:52
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
ULONG NonPagedPoolUsagePages
Definition: perfdata.h:46
double dbKernelTime
Definition: perfdata.c:39
LARGE_INTEGER IdleProcessTime
Definition: memtest.h:11
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
PPERFDATA pPerfData
Definition: perfdata.c:35
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
double OldKernelTime
Definition: perfdata.c:42
Definition: bufpool.h:45
#define SystemPerformanceInformation
Definition: memtest.h:87
ULONG WorkingSetSizeDelta
Definition: perfdata.h:41
BOOL WINAPI GetProcessIoCounters(IN HANDLE hProcess, OUT PIO_COUNTERS lpIoCounters)
Definition: proc.c:1891
SYSTEM_HANDLE_INFORMATION SystemHandleInfo
Definition: perfdata.c:47
#define PtrToUlong(p)
Definition: basetsd.h:83
SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo
Definition: perfdata.c:44
ULONG HandleCount
Definition: perfdata.h:48
double dbSystemTime
Definition: perfdata.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
LARGE_INTEGER liOldIdleTime
Definition: perfdata.c:41
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define TOKEN_QUERY
Definition: setypes.h:874
ULONG PageFaultCountDelta
Definition: perfdata.h:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
SYSTEM_BASIC_INFORMATION SystemBasicInfo
Definition: perfdata.c:45
#define MAX_PATH
Definition: compat.h:26
VOID WINAPI CachedGetUserFromSid(PSID pSid, LPWSTR pUserName, PULONG pcwcUserName)
Definition: perfdata.c:127
#define BufferSize
Definition: classpnp.h:419
ULONG BasePriority
Definition: perfdata.h:47
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION * PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
#define READ_CONTROL
Definition: nt_native.h:58
UNICODE_STRING ImageName
Definition: extypes.h:890
ULONG WorkingSetSizeBytes
Definition: perfdata.h:39
static const char * ImageName
Definition: image.c:34
LARGE_INTEGER liOldSystemTime
Definition: perfdata.c:43
#define IDS_IDLE_PROCESS
Definition: resource.h:3
struct _PERFDATA PERFDATA
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
LARGE_INTEGER CPUTime
Definition: perfdata.h:38
SYSTEM_FILECACHE_INFORMATION SystemCacheInfo
Definition: perfdata.c:46
ULONG ThreadCount
Definition: perfdata.h:49
struct _SYSTEM_PROCESS_INFORMATION * PSYSTEM_PROCESS_INFORMATION
HANDLE ProcessId
Definition: perfdata.h:34
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1257
HINSTANCE hInst
Definition: dxdiag.c:13
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
LARGE_INTEGER KernelTime
Definition: extypes.h:889
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
ULONG PeakWorkingSetSizeBytes
Definition: perfdata.h:40
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
ULONG PageFaultCount
Definition: perfdata.h:42
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:292
PPERFDATA pPerfDataOld
Definition: perfdata.c:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define Li2Double(x)
Definition: perfdata.h:29
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
unsigned int ULONG
Definition: retypes.h:1
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:409
ULONG GDIObjectCount
Definition: perfdata.h:51
struct _TOKEN_USER * PTOKEN_USER
LARGE_INTEGER UserTime
Definition: extypes.h:888
_Check_return_ long __cdecl labs(_In_ long x)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
LARGE_INTEGER KernelTime
Definition: perfdata.h:55
ULONG VirtualMemorySizeBytes
Definition: perfdata.h:44
static SERVICE_STATUS status
Definition: service.c:31
LARGE_INTEGER UserTime
Definition: perfdata.h:54
#define HeapFree(x, y, z)
Definition: compat.h:394
LONGLONG QuadPart
Definition: typedefs.h:112
double dbIdleTime
Definition: perfdata.c:38
ULONG PagedPoolUsagePages
Definition: perfdata.h:45

◆ PerfDataUninitialize()

void PerfDataUninitialize ( void  )

Definition at line 85 of file perfdata.c.

Referenced by wWinMain().

86 {
87  PLIST_ENTRY pCur;
88  PSIDTOUSERNAME pEntry;
89 
90  if (pPerfData != NULL)
92 
94 
95  if (SystemUserSid != NULL)
96  {
99  }
100 
101  /* Free user names cache list */
102  pCur = SidToUserNameHead.Flink;
103  while (pCur != &SidToUserNameHead)
104  {
105  pEntry = CONTAINING_RECORD(pCur, SIDTOUSERNAME, List);
106  pCur = pCur->Flink;
107  HeapFree(GetProcessHeap(), 0, pEntry);
108  }
109 
112  }
113 }
PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo
Definition: perfdata.c:48
PSID SystemUserSid
Definition: perfdata.c:49
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:573
PPERFDATA pPerfData
Definition: perfdata.c:35
static LIST_ENTRY SidToUserNameHead
Definition: perfdata.c:62
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define GetProcessHeap()
Definition: compat.h:395
LIST_ENTRY List
Definition: psmgr.c:57
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
Definition: typedefs.h:117
CRITICAL_SECTION PerfDataCriticalSection
Definition: perfdata.c:33
#define HeapFree(x, y, z)
Definition: compat.h:394