17 (x1 < x2 ? -1 : (x1 > x2 ? 1 : 0))
19#define CONST_STR_LEN(str) (_countof(str) - 1)
80 if (
pData->ProcessId == dwProcessId)
100 lvitem.iItem =
Index;
210 cx = rc.
left + nXDifference;
211 cy = rc.
top + nYDifference;
218 cy = rc.
top + nYDifference;
264 ColumnIndex = pnmdi->item.iSubItem;
322 INT cchGrouping, cchResult;
324 WCHAR wszDecimalSep[8], wszThousandSep[8];
325 WCHAR wszGrouping[12];
346 for (
i = 0;
i < cchGrouping;
i++)
348 WCHAR wch = wszGrouping[
i];
350 if (wch >=
L'0' && wch <=
L'9')
352 else if (wch !=
L';')
372 return cchResult - 1;
383 DWORD dwProcessPriorityClass;
384 WCHAR strDebugger[260];
385 DWORD dwDebuggerSize;
388 if (dwProcessId == 0)
407 switch (dwProcessPriorityClass) {
430 dwDebuggerSize =
sizeof(strDebugger);
434 if (
wcsstr(strDebugger,
L"DRWTSN32"))
578 bAlreadyInList =
TRUE;
737 *dwMinutes = (
DWORD)((largeint.
QuadPart % 36000000000L) / 600000000L);
738 *dwSeconds = (
DWORD)(((largeint.
QuadPart % 36000000000L) % 600000000L) / 10000000L);
741 *dwMinutes = (
DWORD)((largeint.
QuadPart % 36000000000LL) / 600000000LL);
742 *dwSeconds = (
DWORD)(((largeint.
QuadPart % 36000000000LL) % 600000000LL) / 10000000LL);
758 ret =
CMP(dwHours1, dwHours2);
761 ret =
CMP(dwMinutes1, dwMinutes2);
764 ret =
CMP(dwSeconds1, dwSeconds2);
1004 for (szDrive[0] =
L'A'; szDrive[0] <=
L'`'; szDrive[0]++)
1015 if (lpDosPath && (
dwLength >= dwRet))
1018 szDrive, lpDevicePath +
len);
1066 sizeof(StaticBuffer) -
sizeof(
WCHAR),
1134 if (dwProcessId == 0)
1138 if (dwProcessId == 4)
1140 static const WCHAR szKernelExe[] =
L"\\ntoskrnl.exe";
1157 if (lpExePath && (
dwLength >= dwRet))
1160 pszSystemDir, szKernelExe);
1207 info.lpVerb =
L"properties";
1208 info.lpFile = pszExePath;
1209 info.lpParameters =
L"";
1225 static const WCHAR szCmdFormat[] =
L"/select,\"%s\"";
WNDPROC OldProcessListWndProc
INT_PTR CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
#define ID_PROCESS_PAGE_SETPRIORITY_NORMAL
#define ID_PROCESS_PAGE_SETPRIORITY_REALTIME
#define ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL
#define IDC_SHOWALLPROCESSES
#define ID_PROCESS_PAGE_DEBUG
#define ID_PROCESS_PAGE_SETAFFINITY
#define ID_PROCESS_PAGE_SETPRIORITY_LOW
#define ID_PROCESS_PAGE_SETPRIORITY_HIGH
#define IDR_PROCESS_PAGE_CONTEXT
#define ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL
#define RegCloseKey(hKey)
void SaveColumnSettings(void)
UINT ColumnDataHints[COLUMN_NMAX]
void UpdateColumnDataHints(void)
#define COLUMN_MEMORYUSAGEDELTA
#define COLUMN_HANDLECOUNT
#define COLUMN_PAGEFAULTSDELTA
#define COLUMN_MEMORYUSAGE
#define COLUMN_COMMANDLINE
#define COLUMN_IOWRITEBYTES
#define COLUMN_USEROBJECTS
#define COLUMN_BASEPRIORITY
#define COLUMN_PEAKMEMORYUSAGE
#define COLUMN_IOOTHERBYTES
#define COLUMN_VIRTUALMEMORYSIZE
#define COLUMN_GDIOBJECTS
#define COLUMN_PAGEFAULTS
#define COLUMN_THREADCOUNT
#define COLUMN_IOREADBYTES
#define COLUMN_NONPAGEDPOOL
#define NT_SUCCESS(StatCode)
static const WCHAR szDeviceName[]
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define HeapFree(x, y, z)
static DWORD DWORD * dwLength
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
DWORD WINAPI GetPriorityClass(IN HANDLE hProcess)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
void ProcessPage_OnEndProcess(void)
UNICODE_STRING * PUNICODE_STRING
struct _UNICODE_STRING UNICODE_STRING
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define PROCESS_QUERY_INFORMATION
_In_ BOOL _In_ HANDLE hProcess
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define _Out_writes_to_opt_(s, c)
#define _Out_writes_z_(s)
#define PROCESS_ALL_ACCESS
#define LOCALE_USER_DEFAULT
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
ULONG PerfDataGetPagedPoolUsagePages(ULONG Index)
ULONG PerfDataGetWorkingSetSizeBytes(ULONG Index)
ULONG PerfDataGetWorkingSetSizeDelta(ULONG Index)
ULONG PerfDataGetPageFaultCountDelta(ULONG Index)
ULONG PerfDataGetProcessIndex(ULONG pid)
ULONG PerfDataGetPageFaultCount(ULONG Index)
ULONG PerfDataGetSessionId(ULONG Index)
LARGE_INTEGER PerfDataGetCPUTime(ULONG Index)
ULONG PerfDataGetHandleCount(ULONG Index)
ULONG PerfDataGetProcessId(ULONG Index)
ULONG PerfDataGetCPUUsage(ULONG Index)
BOOL PerfDataGetCommandLine(ULONG Index, LPWSTR lpCommandLine, ULONG nMaxCount)
ULONG PerfDataGetThreadCount(ULONG Index)
ULONG PerfDataGetBasePriority(ULONG Index)
BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, ULONG nMaxCount)
ULONG PerfDataGetUSERObjectCount(ULONG Index)
ULONG PerfDataGetNonPagedPoolUsagePages(ULONG Index)
ULONG PerfDataGetVirtualMemorySizeBytes(ULONG Index)
BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, ULONG nMaxCount)
ULONG PerfDataGetPeakWorkingSetSizeBytes(ULONG Index)
ULONG PerfDataGetGDIObjectCount(ULONG Index)
BOOL PerfDataGetIOCounters(ULONG Index, PIO_COUNTERS pIoCounters)
ULONG PerfDataGetProcessCount(void)
struct PROCESS_PAGE_LIST_ITEM * LPPROCESS_PAGE_LIST_ITEM
static DWORD GetProcessExecutablePath(_In_ HANDLE hProcess, _Out_writes_to_opt_(dwLength, return) LPWSTR lpExePath, _In_opt_ DWORD dwLength)
Retrieves the Win32 path of an executable image, by handle.
static DWORD DevicePathToDosPath(_In_ LPCWSTR lpDevicePath, _Out_writes_to_opt_(dwLength, return) LPWSTR lpDosPath, _In_opt_ DWORD dwLength)
Maps an NT "\Device\..." path to its Win32 "DOS" equivalent.
int ProcessRunning(ULONG ProcessId)
DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
void ProcessPage_OnOpenFileLocation(void)
UINT SH_FormatInteger(_In_ LONGLONG Num, _Out_writes_z_(cchResultMax) LPWSTR pwszResult, _In_ UINT cchResultMax)
static DWORD GetProcessExecutablePathById(_In_ DWORD dwProcessId, _Out_writes_to_opt_(dwLength, return) LPWSTR lpExePath, _In_opt_ DWORD dwLength)
Retrieves the Win32 path of an executable image, by identifier.
void gethmsfromlargeint(LARGE_INTEGER largeint, DWORD *dwHours, DWORD *dwMinutes, DWORD *dwSeconds)
INT_PTR CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
static DWORD dwProcessThread
static HWND hProcessPageEndProcessButton
BOOL bProcessPageSelectionMade
void AddProcess(ULONG Index)
DWORD GetSelectedProcessId(void)
static HWND hProcessPageShowAllProcessesButton
int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
static HANDLE hProcessThread
static int nProcessPageHeight
int largeintcmp(LARGE_INTEGER l1, LARGE_INTEGER l2)
static int nProcessPageWidth
#define CONST_STR_LEN(str)
void ProcessPageUpdate(void)
HWND hProcessPageHeaderCtrl
void RefreshProcessPage(void)
BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, ULONG nMaxCount)
void ProcessPage_OnProperties(void)
HWND hProcessPageListCtrl
void ProcessPageShowContextMenu(DWORD dwProcessId)
void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
int ProcGetIndexByProcessId(DWORD dwProcessId)
_Out_opt_ int _Out_opt_ int * cy
#define ListView_InsertItem(hwnd, pitem)
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_GetHeader(hwnd)
#define LVS_EX_HEADERDRAGDROP
#define ListView_GetNextItem(hwnd, i, flags)
#define LVS_EX_FULLROWSELECT
#define LPSTR_TEXTCALLBACK
#define ListView_GetItemCount(hwnd)
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
#define ListView_GetSelectionMark(hwnd)
#define ListView_GetSelectedCount(hwndLV)
#define ListView_DeleteItem(hwnd, i)
#define ListView_GetItem(hwnd, pitem)
#define ListView_GetExtendedListViewStyle(hwndLV)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
struct _SHELLEXECUTEINFOW SHELLEXECUTEINFOW
#define SEE_MASK_INVOKEIDLIST
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
ULONGLONG ReadOperationCount
ULONGLONG WriteTransferCount
ULONGLONG WriteOperationCount
ULONGLONG ReadTransferCount
ULONGLONG OtherOperationCount
ULONGLONG OtherTransferCount
DWORD dwNumberOfProcessors
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
TASKMANAGER_SETTINGS TaskManagerSettings
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define STATUS_INFO_LENGTH_MISMATCH
_In_ WDFCOLLECTION _In_ ULONG Index
#define NORMAL_PRIORITY_CLASS
#define REALTIME_PRIORITY_CLASS
#define BELOW_NORMAL_PRIORITY_CLASS
#define HIGH_PRIORITY_CLASS
#define IDLE_PRIORITY_CLASS
#define ABOVE_NORMAL_PRIORITY_CLASS
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define HKEY_LOCAL_MACHINE
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
#define PostThreadMessage
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define SWP_NOOWNERZORDER
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
#define SetWindowLongPtrW
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)