Changeset 420 for trunk/src/helpers/procstat.c
- Timestamp:
- Dec 8, 2014, 3:25:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/procstat.c
r240 r420 33 33 /* 34 34 * Copyright (C) 1992-1994 Kai Uwe Rommel. 35 * Copyright (C) 1998-20 00Ulrich Mller.35 * Copyright (C) 1998-2014 Ulrich Mller. 36 36 * This file is part of the "XWorkplace helpers" source package. 37 37 * This is free software; you can redistribute it and/or modify … … 52 52 #define INCL_DOSMODULEMGR 53 53 #define INCL_DOSERRORS 54 #define INCL_DOSPROCESS 54 55 #include <os2.h> 55 56 … … 789 790 } 790 791 791 792 /* 793 *@@ prc32KillProcessTree: 794 * 795 *@@added XWP V1.0.10 (2014-12-07) [pr] 796 */ 797 798 void prc32KillProcessTree(ULONG pid) 799 { 800 APIRET arc; 801 PQTOPLEVEL32 pInfo = prc32GetInfo2(QS32_PROCESS, &arc); 802 803 if (arc == NO_ERROR) 804 { 805 prc32KillProcessTree2(pInfo->pProcessData, pid); 806 DosKillProcess(DKP_PROCESS, pid); 807 prc32FreeInfo(pInfo); 808 } 809 } 810 811 /* 812 *@@ prc32KillProcessTree2: 813 * 814 *@@added XWP V1.0.10 (2014-12-07) [pr] 815 */ 816 817 void prc32KillProcessTree2(PQPROCESS32 pProcThis, ULONG pid) 818 { 819 while (pProcThis && pProcThis->ulRecType == 1) 820 { 821 PQTHREAD32 t = pProcThis->pThreads; 822 823 if (pProcThis->usPPID == pid) 824 { 825 prc32KillProcessTree2(pProcThis, pProcThis->usPID); 826 DosKillProcess(DKP_PROCESS, pProcThis->usPID); 827 } 828 829 // for next process, skip the threads info; 830 // the next process block comes after the threads 831 t += pProcThis->usThreadCount; 832 pProcThis = (PQPROCESS32)t; 833 } 834 } 835
Note:
See TracChangeset
for help on using the changeset viewer.