ReactOS 0.4.15-dev-5893-g1bb4167
procpage.c
Go to the documentation of this file.
1/*
2 * ReactOS Task Manager
3 *
4 * procpage.c
5 *
6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7 * Copyright (C) 2009 Maxime Vernier <maxime.vernier@gmail.com>
8 * Copyright (C) 2022 Thamatip Chitpong <tangaming123456@outlook.com>
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25#include "precomp.h"
26
27#include "proclist.h"
28
29#include <strsafe.h>
30
31#include <ndk/psfuncs.h>
32
33#define CMP(x1, x2)\
34 (x1 < x2 ? -1 : (x1 > x2 ? 1 : 0))
35
36typedef struct
37{
40
41HWND hProcessPage; /* Process List Property Page */
42
43HWND hProcessPageListCtrl; /* Process ListCtrl Window */
44HWND hProcessPageHeaderCtrl; /* Process Header Control */
45HWND hProcessPageEndProcessButton; /* Process End Process button */
46HWND hProcessPageShowAllProcessesButton;/* Process Show All Processes checkbox */
47BOOL bProcessPageSelectionMade = FALSE; /* Is item in ListCtrl selected */
48
51#ifdef RUN_PROC_PAGE
54#endif
55
56int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
58void UpdateProcesses();
59void gethmsfromlargeint(LARGE_INTEGER largeint, DWORD *dwHours, DWORD *dwMinutes, DWORD *dwSeconds);
61void ProcessPageShowContextMenu(DWORD dwProcessId);
63DWORD WINAPI ProcessPageRefreshThread(void *lpParameter);
65
66void Cleanup(void)
67{
68 int i;
72 {
73 memset(&item, 0, sizeof(LV_ITEM));
74 item.mask = LVIF_PARAM;
75 item.iItem = i;
79 }
80}
81
83{
84 int i;
87
89 {
90 memset(&item, 0, sizeof(LV_ITEM));
91 item.mask = LVIF_PARAM;
92 item.iItem = i;
95 if (pData->ProcessId == dwProcessId)
96 {
97 return i;
98 }
99 }
100 return 0;
101}
102
104{
105 int Index;
106 LVITEM lvitem;
107
109 {
111
112 memset(&lvitem, 0, sizeof(LVITEM));
113
114 lvitem.mask = LVIF_PARAM;
115 lvitem.iItem = Index;
116
118
119 if (lvitem.lParam)
120 return ((LPPROCESS_PAGE_LIST_ITEM)lvitem.lParam)->ProcessId;
121 }
122
123 return 0;
124}
125
127{
128 /* Enable or disable the "End Process" button */
131 else
133}
134
137{
138 RECT rc;
139 int nXDifference;
140 int nYDifference;
141 int cx, cy;
142
143 switch (message) {
144 case WM_INITDIALOG:
145 /*
146 * Save the width and height
147 */
148 GetClientRect(hDlg, &rc);
151
152 /* Update window position */
154
155 /*
156 * Get handles to the controls
157 */
162
163 /*
164 * Set the title, and extended window styles for the list control
165 */
168
169 AddColumns();
170
171 /*
172 * Subclass the process list control so we can intercept WM_ERASEBKGND
173 */
175
176#ifdef RUN_PROC_PAGE
177 /* Start our refresh thread */
179#endif
180
181 /* Refresh page */
183
184 return TRUE;
185
186 case WM_DESTROY:
187 /* Close the event handle, this will make the */
188 /* refresh thread exit when the wait fails */
189#ifdef RUN_PROC_PAGE
191#endif
193 Cleanup();
194 break;
195
196 case WM_COMMAND:
197 /* Handle the button clicks */
198 switch (LOWORD(wParam))
199 {
200 case IDC_ENDPROCESS:
202 }
203 break;
204
205 case WM_SIZE:
206 if (wParam == SIZE_MINIMIZED)
207 return 0;
208
209 cx = LOWORD(lParam);
210 cy = HIWORD(lParam);
211 nXDifference = cx - nProcessPageWidth;
212 nYDifference = cy - nProcessPageHeight;
215
216 /* Reposition the application page's controls */
218 cx = (rc.right - rc.left) + nXDifference;
219 cy = (rc.bottom - rc.top) + nYDifference;
222
224 MapWindowPoints(hProcessPageEndProcessButton, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
225 cx = rc.left + nXDifference;
226 cy = rc.top + nYDifference;
229
232 cx = rc.left;
233 cy = rc.top + nYDifference;
236 break;
237
238 case WM_NOTIFY:
240 break;
241
242 case WM_KEYDOWN:
243 if (wParam == VK_DELETE)
245 break;
246 }
247
248 return 0;
249}
250
252{
253 LPNMHDR pnmh;
254 NMLVDISPINFO* pnmdi;
255 LPNMHEADER pnmhdr;
256 ULONG Index;
257 ULONG ColumnIndex;
259
260 pnmh = (LPNMHDR) lParam;
261 pnmdi = (NMLVDISPINFO*) lParam;
262 pnmhdr = (LPNMHEADER) lParam;
263
264 if (pnmh->hwndFrom == hProcessPageListCtrl)
265 {
266 switch (pnmh->code)
267 {
268 case LVN_ITEMCHANGED:
270 break;
271
272 case LVN_GETDISPINFO:
273
274 if (!(pnmdi->item.mask & LVIF_TEXT))
275 break;
276
277 pData = (LPPROCESS_PAGE_LIST_ITEM)pnmdi->item.lParam;
278 Index = PerfDataGetProcessIndex(pData->ProcessId);
279 ColumnIndex = pnmdi->item.iSubItem;
280
281 PerfDataGetText(Index, ColumnIndex, pnmdi->item.pszText, (ULONG)pnmdi->item.cchTextMax);
282
283 break;
284
285 case NM_RCLICK:
286
288 break;
289
290 case LVN_KEYDOWN:
291
292 if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE)
294 break;
295
296 }
297 }
298 else if (pnmh->hwndFrom == hProcessPageHeaderCtrl)
299 {
300 switch (pnmh->code)
301 {
302 case HDN_ITEMCLICK:
303
307
308 break;
309
310 case HDN_ITEMCHANGED:
311
313
314 break;
315
316 case HDN_ENDDRAG:
317
319
320 break;
321
322 }
323 }
324}
325
326/*
327 * Adapted from SH_FormatInteger in dll/win32/shell32/dialogs/filedefext.cpp.
328 */
329UINT
331 _In_ LONGLONG Num,
332 _Out_writes_z_(cchResultMax) LPWSTR pwszResult,
333 _In_ UINT cchResultMax)
334{
335 NUMBERFMTW nf;
336 INT i;
337 INT cchGrouping, cchResult;
338 WCHAR wszNumber[24];
339 WCHAR wszDecimalSep[8], wszThousandSep[8];
340 WCHAR wszGrouping[12];
341
342 /* Print the number in uniform mode */
343 StringCchPrintfW(wszNumber, _countof(wszNumber), L"%I64u", Num);
344
345 /* Get system strings for decimal and thousand separators */
346 GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, wszDecimalSep, _countof(wszDecimalSep));
347 GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, wszThousandSep, _countof(wszThousandSep));
348
349 /* Initialize format for printing the number in bytes */
350 ZeroMemory(&nf, sizeof(nf));
351 nf.lpDecimalSep = wszDecimalSep;
352 nf.lpThousandSep = wszThousandSep;
353
354 /* Get system string for groups separator */
357 wszGrouping,
358 _countof(wszGrouping));
359
360 /* Convert grouping specs from string to integer */
361 for (i = 0; i < cchGrouping; i++)
362 {
363 WCHAR wch = wszGrouping[i];
364
365 if (wch >= L'0' && wch <= L'9')
366 nf.Grouping = nf.Grouping * 10 + (wch - L'0');
367 else if (wch != L';')
368 break;
369 }
370
371 if ((nf.Grouping % 10) == 0)
372 nf.Grouping /= 10;
373 else
374 nf.Grouping *= 10;
375
376 /* Format the number */
378 0,
379 wszNumber,
380 &nf,
381 pwszResult,
382 cchResultMax);
383 if (!cchResult)
384 return 0;
385
386 /* GetNumberFormatW returns number of characters including UNICODE_NULL */
387 return cchResult - 1;
388}
389
391{
392 HMENU hMenu;
393 HMENU hSubMenu;
394 HMENU hPriorityMenu;
395 POINT pt;
396 SYSTEM_INFO si;
398 DWORD dwProcessPriorityClass;
399 WCHAR strDebugger[260];
400 DWORD dwDebuggerSize;
401 HKEY hKey;
402
403 if (dwProcessId == 0)
404 return;
405
406 memset(&si, 0, sizeof(SYSTEM_INFO));
407
409 GetSystemInfo(&si);
410
412 hSubMenu = GetSubMenu(hMenu, 0);
413 hPriorityMenu = GetSubMenu(hSubMenu, 4);
414
416 dwProcessPriorityClass = GetPriorityClass(hProcess);
418
419 if (si.dwNumberOfProcessors < 2)
421
422 switch (dwProcessPriorityClass) {
425 break;
428 break;
431 break;
434 break;
437 break;
440 break;
441 }
442
443 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
444 {
445 dwDebuggerSize = sizeof(strDebugger);
446 if (RegQueryValueExW(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS)
447 {
448 CharUpper(strDebugger);
449 if (wcsstr(strDebugger, L"DRWTSN32"))
451 }
452 else
454
456 } else {
458 }
460 DestroyMenu(hMenu);
461}
462
464{
465#ifdef RUN_PROC_PAGE
466 /* Signal the event so that our refresh thread */
467 /* will wake up and refresh the process page */
469#endif
470}
471
473{
474 MSG msg;
475
476 while (1) {
477 /* Wait for an the event or application close */
478 if (GetMessage(&msg, NULL, 0, 0) <= 0)
479 return 0;
480
481 if (msg.message == WM_TIMER) {
482
484
487
489 }
490 }
491 return 0;
492}
493
495{
496 int i;
497 ULONG l;
500
502
503 /* Remove old processes */
505 {
506 memset(&item, 0, sizeof (LV_ITEM));
507 item.mask = LVIF_PARAM;
508 item.iItem = i;
511 if (!ProcessRunning(pData->ProcessId))
512 {
515 }
516 }
517
518 /* Check for difference in listview process and performance process counts */
520 {
521 /* Add new processes by checking against the current items */
522 for (l = 0; l < PerfDataGetProcessCount(); l++)
523 {
524 AddProcess(l);
525 }
526 }
527
529 {
531 }
532
534
535 /* Select first item if any */
538 {
541 }
542 /*
543 else
544 {
545 bProcessPageSelectionMade = FALSE;
546 }
547 */
548}
549
551{
553 DWORD exitCode;
554
555 if (ProcessId == 0) {
556 return TRUE;
557 }
558
560 if (hProcess == NULL) {
561 return FALSE;
562 }
563
564 if (GetExitCodeProcess(hProcess, &exitCode)) {
566 return (exitCode == STILL_ACTIVE);
567 }
568
570 return FALSE;
571}
572
574{
576 int i;
578 BOOL bAlreadyInList = FALSE;
579 ULONG pid;
580
582
583 /* Check to see if it's already in our list */
585 {
586 memset(&item, 0, sizeof(LV_ITEM));
587 item.mask = LVIF_PARAM;
588 item.iItem = i;
591 if (pData->ProcessId == pid)
592 {
593 bAlreadyInList = TRUE;
594 break;
595 }
596 }
597 if (!bAlreadyInList) /* Add */
598 {
600 pData->ProcessId = pid;
601
602 /* Add the item to the list */
603 memset(&item, 0, sizeof(LV_ITEM));
605 item.pszText = LPSTR_TEXTCALLBACK;
607 item.lParam = (LPARAM)pData;
609 }
610}
611
613{
614 IO_COUNTERS iocounters;
615
616 switch (ColumnDataHints[ColumnIndex])
617 {
618 case COLUMN_IMAGENAME:
620 return TRUE;
621
622 case COLUMN_PID:
624 return TRUE;
625
626 case COLUMN_USERNAME:
628 return TRUE;
629
632 return TRUE;
633
634 case COLUMN_SESSIONID:
636 return TRUE;
637
638 case COLUMN_CPUUSAGE:
640 return TRUE;
641
642 case COLUMN_CPUTIME:
643 {
645 DWORD dwHours;
646 DWORD dwMinutes;
647 DWORD dwSeconds;
648
650 gethmsfromlargeint(time, &dwHours, &dwMinutes, &dwSeconds);
651 StringCchPrintfW(lpText, nMaxCount, L"%lu:%02lu:%02lu", dwHours, dwMinutes, dwSeconds);
652 return TRUE;
653 }
654
657 StringCchCatW(lpText, nMaxCount, L" K");
658 return TRUE;
659
662 StringCchCatW(lpText, nMaxCount, L" K");
663 return TRUE;
664
667 StringCchCatW(lpText, nMaxCount, L" K");
668 return TRUE;
669
672 return TRUE;
673
676 return TRUE;
677
680 StringCchCatW(lpText, nMaxCount, L" K");
681 return TRUE;
682
683 case COLUMN_PAGEDPOOL:
685 StringCchCatW(lpText, nMaxCount, L" K");
686 return TRUE;
687
690 StringCchCatW(lpText, nMaxCount, L" K");
691 return TRUE;
692
695 return TRUE;
696
699 return TRUE;
700
703 return TRUE;
704
707 return TRUE;
708
711 return TRUE;
712
713 case COLUMN_IOREADS:
714 PerfDataGetIOCounters(Index, &iocounters);
715 SH_FormatInteger(iocounters.ReadOperationCount, lpText, nMaxCount);
716 return TRUE;
717
718 case COLUMN_IOWRITES:
719 PerfDataGetIOCounters(Index, &iocounters);
721 return TRUE;
722
723 case COLUMN_IOOTHER:
724 PerfDataGetIOCounters(Index, &iocounters);
726 return TRUE;
727
729 PerfDataGetIOCounters(Index, &iocounters);
730 SH_FormatInteger(iocounters.ReadTransferCount, lpText, nMaxCount);
731 return TRUE;
732
734 PerfDataGetIOCounters(Index, &iocounters);
735 SH_FormatInteger(iocounters.WriteTransferCount, lpText, nMaxCount);
736 return TRUE;
737
739 PerfDataGetIOCounters(Index, &iocounters);
740 SH_FormatInteger(iocounters.OtherTransferCount, lpText, nMaxCount);
741 return TRUE;
742 }
743
744 return FALSE;
745}
746
747
748void gethmsfromlargeint(LARGE_INTEGER largeint, DWORD *dwHours, DWORD *dwMinutes, DWORD *dwSeconds)
749{
750#ifdef _MSC_VER
751 *dwHours = (DWORD)(largeint.QuadPart / 36000000000L);
752 *dwMinutes = (DWORD)((largeint.QuadPart % 36000000000L) / 600000000L);
753 *dwSeconds = (DWORD)(((largeint.QuadPart % 36000000000L) % 600000000L) / 10000000L);
754#else
755 *dwHours = (DWORD)(largeint.QuadPart / 36000000000LL);
756 *dwMinutes = (DWORD)((largeint.QuadPart % 36000000000LL) / 600000000LL);
757 *dwSeconds = (DWORD)(((largeint.QuadPart % 36000000000LL) % 600000000LL) / 10000000LL);
758#endif
759}
760
762{
763 int ret = 0;
764 DWORD dwHours1;
765 DWORD dwMinutes1;
766 DWORD dwSeconds1;
767 DWORD dwHours2;
768 DWORD dwMinutes2;
769 DWORD dwSeconds2;
770
771 gethmsfromlargeint(l1, &dwHours1, &dwMinutes1, &dwSeconds1);
772 gethmsfromlargeint(l2, &dwHours2, &dwMinutes2, &dwSeconds2);
773 ret = CMP(dwHours1, dwHours2);
774 if (ret == 0)
775 {
776 ret = CMP(dwMinutes1, dwMinutes2);
777 if (ret == 0)
778 {
779 ret = CMP(dwSeconds1, dwSeconds2);
780 }
781 }
782 return ret;
783}
784
785int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
786{
787 int ret = 0;
790 ULONG IndexParam1;
791 ULONG IndexParam2;
792 WCHAR text1[260];
793 WCHAR text2[260];
794 ULONG l1;
795 ULONG l2;
796 LARGE_INTEGER time1;
797 LARGE_INTEGER time2;
798 IO_COUNTERS iocounters1;
799 IO_COUNTERS iocounters2;
800 ULONGLONG ull1;
801 ULONGLONG ull2;
802
804 Param1 = (LPPROCESS_PAGE_LIST_ITEM)lParam1;
805 Param2 = (LPPROCESS_PAGE_LIST_ITEM)lParam2;
806 } else {
807 Param1 = (LPPROCESS_PAGE_LIST_ITEM)lParam2;
808 Param2 = (LPPROCESS_PAGE_LIST_ITEM)lParam1;
809 }
810 IndexParam1 = PerfDataGetProcessIndex(Param1->ProcessId);
811 IndexParam2 = PerfDataGetProcessIndex(Param2->ProcessId);
812
814 {
815 PerfDataGetImageName(IndexParam1, text1, sizeof (text1) / sizeof (*text1));
816 PerfDataGetImageName(IndexParam2, text2, sizeof (text2) / sizeof (*text2));
817 ret = _wcsicmp(text1, text2);
818 }
820 {
821 l1 = Param1->ProcessId;
822 l2 = Param2->ProcessId;
823 ret = CMP(l1, l2);
824 }
826 {
827 PerfDataGetUserName(IndexParam1, text1, sizeof (text1) / sizeof (*text1));
828 PerfDataGetUserName(IndexParam2, text2, sizeof (text2) / sizeof (*text2));
829 ret = _wcsicmp(text1, text2);
830 }
832 {
833 PerfDataGetCommandLine(IndexParam1, text1, sizeof (text1) / sizeof (*text1));
834 PerfDataGetCommandLine(IndexParam2, text2, sizeof (text2) / sizeof (*text2));
835 ret = _wcsicmp(text1, text2);
836 }
838 {
839 l1 = PerfDataGetSessionId(IndexParam1);
840 l2 = PerfDataGetSessionId(IndexParam2);
841 ret = CMP(l1, l2);
842 }
844 {
845 l1 = PerfDataGetCPUUsage(IndexParam1);
846 l2 = PerfDataGetCPUUsage(IndexParam2);
847 ret = CMP(l1, l2);
848 }
850 {
851 time1 = PerfDataGetCPUTime(IndexParam1);
852 time2 = PerfDataGetCPUTime(IndexParam2);
853 ret = largeintcmp(time1, time2);
854 }
856 {
857 l1 = PerfDataGetWorkingSetSizeBytes(IndexParam1);
858 l2 = PerfDataGetWorkingSetSizeBytes(IndexParam2);
859 ret = CMP(l1, l2);
860 }
862 {
863 l1 = PerfDataGetPeakWorkingSetSizeBytes(IndexParam1);
864 l2 = PerfDataGetPeakWorkingSetSizeBytes(IndexParam2);
865 ret = CMP(l1, l2);
866 }
868 {
869 l1 = PerfDataGetWorkingSetSizeDelta(IndexParam1);
870 l2 = PerfDataGetWorkingSetSizeDelta(IndexParam2);
871 ret = CMP(l1, l2);
872 }
874 {
875 l1 = PerfDataGetPageFaultCount(IndexParam1);
876 l2 = PerfDataGetPageFaultCount(IndexParam2);
877 ret = CMP(l1, l2);
878 }
880 {
881 l1 = PerfDataGetPageFaultCountDelta(IndexParam1);
882 l2 = PerfDataGetPageFaultCountDelta(IndexParam2);
883 ret = CMP(l1, l2);
884 }
886 {
887 l1 = PerfDataGetVirtualMemorySizeBytes(IndexParam1);
888 l2 = PerfDataGetVirtualMemorySizeBytes(IndexParam2);
889 ret = CMP(l1, l2);
890 }
892 {
893 l1 = PerfDataGetPagedPoolUsagePages(IndexParam1);
894 l2 = PerfDataGetPagedPoolUsagePages(IndexParam2);
895 ret = CMP(l1, l2);
896 }
898 {
899 l1 = PerfDataGetNonPagedPoolUsagePages(IndexParam1);
900 l2 = PerfDataGetNonPagedPoolUsagePages(IndexParam2);
901 ret = CMP(l1, l2);
902 }
904 {
905 l1 = PerfDataGetBasePriority(IndexParam1);
906 l2 = PerfDataGetBasePriority(IndexParam2);
907 ret = CMP(l1, l2);
908 }
910 {
911 l1 = PerfDataGetHandleCount(IndexParam1);
912 l2 = PerfDataGetHandleCount(IndexParam2);
913 ret = CMP(l1, l2);
914 }
916 {
917 l1 = PerfDataGetThreadCount(IndexParam1);
918 l2 = PerfDataGetThreadCount(IndexParam2);
919 ret = CMP(l1, l2);
920 }
922 {
923 l1 = PerfDataGetUSERObjectCount(IndexParam1);
924 l2 = PerfDataGetUSERObjectCount(IndexParam2);
925 ret = CMP(l1, l2);
926 }
928 {
929 l1 = PerfDataGetGDIObjectCount(IndexParam1);
930 l2 = PerfDataGetGDIObjectCount(IndexParam2);
931 ret = CMP(l1, l2);
932 }
934 {
935 PerfDataGetIOCounters(IndexParam1, &iocounters1);
936 PerfDataGetIOCounters(IndexParam2, &iocounters2);
937 ull1 = iocounters1.ReadOperationCount;
938 ull2 = iocounters2.ReadOperationCount;
939 ret = CMP(ull1, ull2);
940 }
942 {
943 PerfDataGetIOCounters(IndexParam1, &iocounters1);
944 PerfDataGetIOCounters(IndexParam2, &iocounters2);
945 ull1 = iocounters1.WriteOperationCount;
946 ull2 = iocounters2.WriteOperationCount;
947 ret = CMP(ull1, ull2);
948 }
950 {
951 PerfDataGetIOCounters(IndexParam1, &iocounters1);
952 PerfDataGetIOCounters(IndexParam2, &iocounters2);
953 ull1 = iocounters1.OtherOperationCount;
954 ull2 = iocounters2.OtherOperationCount;
955 ret = CMP(ull1, ull2);
956 }
958 {
959 PerfDataGetIOCounters(IndexParam1, &iocounters1);
960 PerfDataGetIOCounters(IndexParam2, &iocounters2);
961 ull1 = iocounters1.ReadTransferCount;
962 ull2 = iocounters2.ReadTransferCount;
963 ret = CMP(ull1, ull2);
964 }
966 {
967 PerfDataGetIOCounters(IndexParam1, &iocounters1);
968 PerfDataGetIOCounters(IndexParam2, &iocounters2);
969 ull1 = iocounters1.WriteTransferCount;
970 ull2 = iocounters2.WriteTransferCount;
971 ret = CMP(ull1, ull2);
972 }
974 {
975 PerfDataGetIOCounters(IndexParam1, &iocounters1);
976 PerfDataGetIOCounters(IndexParam2, &iocounters2);
977 ull1 = iocounters1.OtherTransferCount;
978 ull2 = iocounters2.OtherTransferCount;
979 ret = CMP(ull1, ull2);
980 }
981 return ret;
982}
983
1002static DWORD
1004 _In_ LPCWSTR lpDevicePath,
1006 LPWSTR lpDosPath,
1008{
1009 DWORD dwRet = 0;
1010 WCHAR szDrive[3] = L"?:";
1012
1013 /* Check if lpDevicePath is a device path */
1014 if (_wcsnicmp(lpDevicePath, L"\\Device\\", _countof(L"\\Device\\")-1) != 0)
1015 {
1016 return 0;
1017 }
1018
1019 for (szDrive[0] = L'A'; szDrive[0] <= L'`'; szDrive[0]++)
1020 {
1022 {
1023 size_t len = wcslen(szDeviceName);
1024
1025 if (_wcsnicmp(lpDevicePath, szDeviceName, len) == 0)
1026 {
1027 /* Get the required length, including the NULL terminator */
1028 dwRet = _countof(szDrive) + wcslen(lpDevicePath + len);
1029
1030 if (lpDosPath && (dwLength >= dwRet))
1031 {
1032 StringCchPrintfW(lpDosPath, dwLength, L"%s%s",
1033 szDrive, lpDevicePath + len);
1034 }
1035
1036 break;
1037 }
1038 }
1039 }
1040
1041 return dwRet;
1042}
1043
1063static DWORD
1067 LPWSTR lpExePath,
1069{
1070 DWORD dwRet = 0;
1072 BYTE StaticBuffer[sizeof(UNICODE_STRING) + (MAX_PATH * sizeof(WCHAR))];
1074 PUNICODE_STRING ExePath;
1075 ULONG SizeNeeded;
1076
1079 StaticBuffer,
1080 /* Reserve a NULL terminator */
1081 sizeof(StaticBuffer) - sizeof(WCHAR),
1082 &SizeNeeded);
1083 if (NT_SUCCESS(Status))
1084 {
1085 ExePath = (PUNICODE_STRING)StaticBuffer;
1086 }
1088 {
1089 /* Allocate the buffer, reserving space for a NULL terminator */
1090 DynamicBuffer = HeapAlloc(GetProcessHeap(), 0, SizeNeeded + sizeof(WCHAR));
1091 if (!DynamicBuffer)
1092 return 0;
1093
1097 SizeNeeded,
1098 &SizeNeeded);
1099 if (!NT_SUCCESS(Status))
1100 goto Cleanup;
1101
1102 ExePath = DynamicBuffer;
1103 }
1104 else
1105 {
1106 return 0;
1107 }
1108
1109 /* Manually NULL-terminate */
1110 ExePath->Buffer[ExePath->Length / sizeof(WCHAR)] = UNICODE_NULL;
1111
1112 /* HACK: Convert device path format into Win32 path format.
1113 * Use ProcessImageFileNameWin32 instead if the kernel supports it. */
1114 dwRet = DevicePathToDosPath(ExePath->Buffer, lpExePath, dwLength);
1115
1116Cleanup:
1118
1119 return dwRet;
1120}
1121
1140static DWORD
1142 _In_ DWORD dwProcessId,
1144 LPWSTR lpExePath,
1146{
1147 DWORD dwRet = 0;
1148
1149 if (dwProcessId == 0)
1150 return 0;
1151
1152 /* PID = 4 ("System") */
1153 if (dwProcessId == 4)
1154 {
1155 static const WCHAR szKernelExe[] = L"\\ntoskrnl.exe";
1156 LPWSTR pszSystemDir;
1157 UINT uLength;
1158
1159 uLength = GetSystemDirectoryW(NULL, 0);
1160 if (uLength == 0)
1161 return 0;
1162
1163 pszSystemDir = HeapAlloc(GetProcessHeap(), 0, uLength * sizeof(WCHAR));
1164 if (!pszSystemDir)
1165 return 0;
1166
1167 if (GetSystemDirectoryW(pszSystemDir, uLength) != 0)
1168 {
1169 /* Get the required length, including the NULL terminator */
1170 dwRet = uLength + _countof(szKernelExe) - 1;
1171
1172 if (lpExePath && (dwLength >= dwRet))
1173 {
1174 StringCchPrintfW(lpExePath, dwLength, L"%s%s",
1175 pszSystemDir, szKernelExe);
1176 }
1177 }
1178
1179 HeapFree(GetProcessHeap(), 0, pszSystemDir);
1180 }
1181 else
1182 {
1184
1186 if (hProcess)
1187 {
1188 dwRet = GetProcessExecutablePath(hProcess, lpExePath, dwLength);
1190 }
1191 }
1192
1193 return dwRet;
1194}
1195
1197{
1198 DWORD dwProcessId;
1200 LPWSTR pszExePath;
1201 SHELLEXECUTEINFOW info = { 0 };
1202
1203 dwProcessId = GetSelectedProcessId();
1204
1205 /* Retrieve the image path length */
1206 dwLength = GetProcessExecutablePathById(dwProcessId, NULL, 0);
1207 if (dwLength == 0)
1208 return;
1209
1210 /* Allocate and retrieve the image path */
1211 pszExePath = HeapAlloc(GetProcessHeap(), 0, dwLength * sizeof(WCHAR));
1212 if (!pszExePath)
1213 return;
1214
1215 if (GetProcessExecutablePathById(dwProcessId, pszExePath, dwLength) == 0)
1216 goto Cleanup;
1217
1218 /* Call the shell to display the file properties */
1219 info.cbSize = sizeof(SHELLEXECUTEINFOW);
1221 info.hwnd = NULL;
1222 info.lpVerb = L"properties";
1223 info.lpFile = pszExePath;
1224 info.lpParameters = L"";
1225 info.lpDirectory = NULL;
1226 info.nShow = SW_SHOW;
1227 info.hInstApp = NULL;
1228
1230
1231Cleanup:
1232 HeapFree(GetProcessHeap(), 0, pszExePath);
1233}
1234
1236{
1237 DWORD dwProcessId;
1239 LPWSTR pszExePath;
1240 LPWSTR pszCmdLine = NULL;
1241
1242 dwProcessId = GetSelectedProcessId();
1243
1244 /* Retrieve the image path length */
1245 dwLength = GetProcessExecutablePathById(dwProcessId, NULL, 0);
1246 if (dwLength == 0)
1247 return;
1248
1249 /* Allocate and retrieve the image path */
1250 pszExePath = HeapAlloc(GetProcessHeap(), 0, dwLength * sizeof(WCHAR));
1251 if (!pszExePath)
1252 return;
1253
1254 if (GetProcessExecutablePathById(dwProcessId, pszExePath, dwLength) == 0)
1255 goto Cleanup;
1256
1257 /* Build the shell command line */
1258 pszCmdLine = HeapAlloc(GetProcessHeap(), 0, (dwLength + 10) * sizeof(WCHAR));
1259 if (!pszCmdLine)
1260 goto Cleanup;
1261
1262 StringCchPrintfW(pszCmdLine, dwLength + 10, L"/select,\"%s\"", pszExePath);
1263
1264 /* Call the shell to open the file location and select it */
1265 ShellExecuteW(NULL, L"open", L"explorer.exe", pszCmdLine, NULL, SW_SHOWNORMAL);
1266
1267Cleanup:
1268 HeapFree(GetProcessHeap(), 0, pszCmdLine);
1269 HeapFree(GetProcessHeap(), 0, pszExePath);
1270}
#define msg(x)
Definition: auth_time.c:54
LONG NTSTATUS
Definition: precomp.h:26
WNDPROC OldProcessListWndProc
Definition: proclist.c:27
INT_PTR CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: proclist.c:31
#define ID_PROCESS_PAGE_SETPRIORITY_NORMAL
Definition: resource.h:179
#define IDC_ENDPROCESS
Definition: resource.h:36
#define ID_PROCESS_PAGE_SETPRIORITY_REALTIME
Definition: resource.h:176
#define ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL
Definition: resource.h:180
#define IDC_SHOWALLPROCESSES
Definition: resource.h:41
#define ID_PROCESS_PAGE_DEBUG
Definition: resource.h:174
#define ID_PROCESS_PAGE_SETAFFINITY
Definition: resource.h:175
#define ID_PROCESS_PAGE_SETPRIORITY_LOW
Definition: resource.h:181
#define ID_PROCESS_PAGE_SETPRIORITY_HIGH
Definition: resource.h:177
#define IDC_PROCESSLIST
Definition: resource.h:37
#define IDR_PROCESS_PAGE_CONTEXT
Definition: resource.h:25
#define ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL
Definition: resource.h:178
#define RegCloseKey(hKey)
Definition: registry.h:47
r l[0]
Definition: byte_order.h:167
void SaveColumnSettings(void)
Definition: column.c:105
void AddColumns(void)
Definition: column.c:63
UINT ColumnDataHints[COLUMN_NMAX]
Definition: column.c:26
void UpdateColumnDataHints(void)
Definition: column.c:203
#define COLUMN_MEMORYUSAGEDELTA
Definition: column.h:33
#define COLUMN_HANDLECOUNT
Definition: column.h:40
#define COLUMN_PAGEFAULTSDELTA
Definition: column.h:35
#define COLUMN_MEMORYUSAGE
Definition: column.h:31
#define COLUMN_COMMANDLINE
Definition: column.h:50
#define COLUMN_IOWRITEBYTES
Definition: column.h:48
#define COLUMN_IOREADS
Definition: column.h:44
#define COLUMN_USEROBJECTS
Definition: column.h:42
#define COLUMN_BASEPRIORITY
Definition: column.h:39
#define COLUMN_PAGEDPOOL
Definition: column.h:37
#define COLUMN_IOWRITES
Definition: column.h:45
#define COLUMN_PEAKMEMORYUSAGE
Definition: column.h:32
#define COLUMN_IOOTHERBYTES
Definition: column.h:49
#define COLUMN_IOOTHER
Definition: column.h:46
#define COLUMN_VIRTUALMEMORYSIZE
Definition: column.h:36
#define COLUMN_PID
Definition: column.h:26
#define COLUMN_CPUTIME
Definition: column.h:30
#define COLUMN_GDIOBJECTS
Definition: column.h:43
#define COLUMN_IMAGENAME
Definition: column.h:25
#define COLUMN_PAGEFAULTS
Definition: column.h:34
#define COLUMN_USERNAME
Definition: column.h:27
#define COLUMN_THREADCOUNT
Definition: column.h:41
#define COLUMN_SESSIONID
Definition: column.h:28
#define COLUMN_IOREADBYTES
Definition: column.h:47
#define COLUMN_CPUUSAGE
Definition: column.h:29
#define COLUMN_NONPAGEDPOOL
Definition: column.h:38
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR szDeviceName[]
Definition: provider.c:56
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
static DWORD DWORD * dwLength
Definition: fusion.c:86
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1227
DWORD WINAPI GetPriorityClass(IN HANDLE hProcess)
Definition: proc.c:1657
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:142
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)
Definition: thread.c:137
#define pt(x, y)
Definition: drawing.c:79
HINSTANCE hInst
Definition: dxdiag.c:13
void ProcessPage_OnEndProcess(void)
Definition: endproc.c:30
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
struct _UNICODE_STRING UNICODE_STRING
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
Status
Definition: gdiplustypes.h:25
GLenum GLsizei len
Definition: glext.h:6722
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
Definition: glfuncs.h:248
_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
Definition: pstypes.h:166
@ ProcessImageFileName
Definition: winternl.h:397
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1102
INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const NUMBERFMTW *lpFormat, LPWSTR lpNumberStr, int cchOut)
Definition: lcformat.c:1198
if(dx< 0)
Definition: linetemp.h:194
HWND hMainWnd
Definition: magnifier.c:32
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
__u16 time
Definition: mkdosfs.c:8
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static ATOM item
Definition: dde.c:856
#define _Out_writes_z_(size)
Definition: ms_sal.h:352
#define _Out_writes_to_opt_(size, count)
Definition: ms_sal.h:356
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
#define DWORD
Definition: nt_native.h:44
#define LOCALE_USER_DEFAULT
#define UNICODE_NULL
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
ULONG PerfDataGetPagedPoolUsagePages(ULONG Index)
Definition: perfdata.c:806
ULONG PerfDataGetWorkingSetSizeBytes(ULONG Index)
Definition: perfdata.c:710
ULONG PerfDataGetWorkingSetSizeDelta(ULONG Index)
Definition: perfdata.c:742
ULONG PerfDataGetPageFaultCountDelta(ULONG Index)
Definition: perfdata.c:774
ULONG PerfDataGetProcessIndex(ULONG pid)
Definition: perfdata.c:440
ULONG PerfDataGetPageFaultCount(ULONG Index)
Definition: perfdata.c:758
ULONG PerfDataGetSessionId(ULONG Index)
Definition: perfdata.c:664
LARGE_INTEGER PerfDataGetCPUTime(ULONG Index)
Definition: perfdata.c:696
ULONG PerfDataGetHandleCount(ULONG Index)
Definition: perfdata.c:854
ULONG PerfDataGetProcessId(ULONG Index)
Definition: perfdata.c:506
ULONG PerfDataGetCPUUsage(ULONG Index)
Definition: perfdata.c:680
BOOL PerfDataGetCommandLine(ULONG Index, LPWSTR lpCommandLine, ULONG nMaxCount)
Definition: perfdata.c:540
ULONG PerfDataGetThreadCount(ULONG Index)
Definition: perfdata.c:870
ULONG PerfDataGetBasePriority(ULONG Index)
Definition: perfdata.c:838
BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, ULONG nMaxCount)
Definition: perfdata.c:522
ULONG PerfDataGetUSERObjectCount(ULONG Index)
Definition: perfdata.c:886
ULONG PerfDataGetNonPagedPoolUsagePages(ULONG Index)
Definition: perfdata.c:822
ULONG PerfDataGetVirtualMemorySizeBytes(ULONG Index)
Definition: perfdata.c:790
BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, ULONG nMaxCount)
Definition: perfdata.c:490
ULONG PerfDataGetPeakWorkingSetSizeBytes(ULONG Index)
Definition: perfdata.c:726
ULONG PerfDataGetGDIObjectCount(ULONG Index)
Definition: perfdata.c:902
BOOL PerfDataGetIOCounters(ULONG Index, PIO_COUNTERS pIoCounters)
Definition: perfdata.c:918
ULONG PerfDataGetProcessCount(void)
Definition: perfdata.c:463
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.
Definition: procpage.c:1064
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.
Definition: procpage.c:1003
int ProcessRunning(ULONG ProcessId)
Definition: procpage.c:550
DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
Definition: procpage.c:472
void ProcessPage_OnOpenFileLocation(void)
Definition: procpage.c:1235
UINT SH_FormatInteger(_In_ LONGLONG Num, _Out_writes_z_(cchResultMax) LPWSTR pwszResult, _In_ UINT cchResultMax)
Definition: procpage.c:330
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.
Definition: procpage.c:1141
#define CMP(x1, x2)
Definition: procpage.c:33
void gethmsfromlargeint(LARGE_INTEGER largeint, DWORD *dwHours, DWORD *dwMinutes, DWORD *dwSeconds)
Definition: procpage.c:748
INT_PTR CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: procpage.c:136
static DWORD dwProcessThread
Definition: procpage.c:53
HWND hProcessPageEndProcessButton
Definition: procpage.c:45
BOOL bProcessPageSelectionMade
Definition: procpage.c:47
void AddProcess(ULONG Index)
Definition: procpage.c:573
DWORD GetSelectedProcessId(void)
Definition: procpage.c:103
HWND hProcessPageShowAllProcessesButton
Definition: procpage.c:46
int CALLBACK ProcessPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: procpage.c:785
void Cleanup(void)
Definition: procpage.c:66
static HANDLE hProcessThread
Definition: procpage.c:52
static int nProcessPageHeight
Definition: procpage.c:50
HWND hProcessPage
Definition: procpage.c:41
int largeintcmp(LARGE_INTEGER l1, LARGE_INTEGER l2)
Definition: procpage.c:761
static int nProcessPageWidth
Definition: procpage.c:49
void ProcessPageUpdate(void)
Definition: procpage.c:126
HWND hProcessPageHeaderCtrl
Definition: procpage.c:44
void RefreshProcessPage(void)
Definition: procpage.c:463
void UpdateProcesses()
Definition: procpage.c:494
BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, ULONG nMaxCount)
Definition: procpage.c:612
void ProcessPage_OnProperties(void)
Definition: procpage.c:1196
HWND hProcessPageListCtrl
Definition: procpage.c:43
void ProcessPageShowContextMenu(DWORD dwProcessId)
Definition: procpage.c:390
void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
Definition: procpage.c:251
int ProcGetIndexByProcessId(DWORD dwProcessId)
Definition: procpage.c:82
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2673
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2651
#define LVS_EX_HEADERDRAGDROP
Definition: commctrl.h:2733
#define LVN_GETDISPINFO
Definition: commctrl.h:3160
#define LVNI_FOCUSED
Definition: commctrl.h:2423
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define NMLVDISPINFO
Definition: commctrl.h:3182
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2383
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
#define HDN_ENDDRAG
Definition: commctrl.h:856
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2703
#define HDN_ITEMCLICK
Definition: commctrl.h:868
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2789
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2709
#define LVITEM
Definition: commctrl.h:2375
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LV_ITEM
Definition: commctrl.h:2337
#define LVIF_TEXT
Definition: commctrl.h:2309
#define NM_RCLICK
Definition: commctrl.h:133
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2411
#define LVN_KEYDOWN
Definition: commctrl.h:3184
#define HDN_ITEMCHANGED
Definition: commctrl.h:867
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define ListView_GetExtendedListViewStyle(hwndLV)
Definition: commctrl.h:2728
#define LPNMHEADER
Definition: commctrl.h:895
#define WM_NOTIFY
Definition: richedit.h:61
_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)
#define memset(x, y, z)
Definition: compat.h:39
struct _SHELLEXECUTEINFOW SHELLEXECUTEINFOW
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2335
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
ULONGLONG ReadOperationCount
Definition: pstypes.h:83
ULONGLONG WriteTransferCount
Definition: pstypes.h:87
ULONGLONG WriteOperationCount
Definition: pstypes.h:84
ULONGLONG ReadTransferCount
Definition: pstypes.h:86
ULONGLONG OtherOperationCount
Definition: pstypes.h:85
ULONGLONG OtherTransferCount
Definition: pstypes.h:88
DWORD dwNumberOfProcessors
Definition: winbase.h:1165
LPWSTR lpDecimalSep
Definition: winnls.h:645
UINT Grouping
Definition: winnls.h:644
LPWSTR lpThousandSep
Definition: winnls.h:646
Definition: tftpd.h:60
UINT code
Definition: winuser.h:3149
HWND hwndFrom
Definition: winuser.h:3147
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1181
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
int64_t LONGLONG
Definition: typedefs.h:68
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define HIWORD(l)
Definition: typedefs.h:247
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONGLONG QuadPart
Definition: typedefs.h:114
int ret
_In_ WDFCOLLECTION _In_ ULONG Index
#define NORMAL_PRIORITY_CLASS
Definition: winbase.h:181
#define ZeroMemory
Definition: winbase.h:1670
#define STILL_ACTIVE
Definition: winbase.h:233
#define REALTIME_PRIORITY_CLASS
Definition: winbase.h:184
#define BELOW_NORMAL_PRIORITY_CLASS
Definition: winbase.h:190
#define HIGH_PRIORITY_CLASS
Definition: winbase.h:183
#define IDLE_PRIORITY_CLASS
Definition: winbase.h:182
#define ABOVE_NORMAL_PRIORITY_CLASS
Definition: winbase.h:191
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define LOCALE_SGROUPING
Definition: winnls.h:44
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define LOCALE_STHOUSAND
Definition: winnls.h:43
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define MF_BYCOMMAND
Definition: winuser.h:202
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)
#define WM_SIZE
Definition: winuser.h:1601
#define SWP_NOMOVE
Definition: winuser.h:1234
#define WM_COMMAND
Definition: winuser.h:1730
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2639
#define SWP_NOSIZE
Definition: winuser.h:1235
#define SIZE_MINIMIZED
Definition: winuser.h:2496
#define WM_INITDIALOG
Definition: winuser.h:1729
#define PostThreadMessage
Definition: winuser.h:5823
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)
#define TPM_TOPALIGN
Definition: winuser.h:2373
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetMessage
Definition: winuser.h:5780
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
_In_ int nMaxCount
Definition: winuser.h:4867
#define WM_TIMER
Definition: winuser.h:1732
#define TPM_LEFTALIGN
Definition: winuser.h:2367
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5833
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define TPM_LEFTBUTTON
Definition: winuser.h:2369
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
#define SW_SHOW
Definition: winuser.h:769
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define VK_DELETE
Definition: winuser.h:2223
#define WM_DESTROY
Definition: winuser.h:1599
#define WM_KEYDOWN
Definition: winuser.h:1705
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define SWP_NOZORDER
Definition: winuser.h:1237
#define SetWindowLongPtrW
Definition: winuser.h:5336
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define CharUpper
Definition: winuser.h:5735
#define MF_GRAYED
Definition: winuser.h:129
#define WM_SETREDRAW
Definition: winuser.h:1606
#define MF_DISABLED
Definition: winuser.h:130
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193