summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessWin32.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-30 21:30:19 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-30 21:30:19 (GMT)
commit2aaa96771558799f07b9a8562b69f58cf580b041 (patch)
treecdf2a9e1dadf63eaea965e138af5f66eb43a59fd /Source/kwsys/ProcessWin32.c
parentb286e6ec7fea280caa41eba2f5f586a0cac34cf8 (diff)
downloadCMake-2aaa96771558799f07b9a8562b69f58cf580b041.zip
CMake-2aaa96771558799f07b9a8562b69f58cf580b041.tar.gz
CMake-2aaa96771558799f07b9a8562b69f58cf580b041.tar.bz2
KWSys: Fix process tree kill on 64-bit Windows
We enumerate processes to identify those whose parent is being killed so that we can recursively kill the children. Enumeration uses the Process32(First|Next) windows API functions, which accept PROCESSENTRY32 objects to be filled. This commit corrects the declaration of the entry structure to account for its size on 64-bit Windows.
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r--Source/kwsys/ProcessWin32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index ae3bde1..c5ea6db 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -2516,6 +2516,11 @@ struct _SYSTEM_PROCESS_INFORMATION
/*--------------------------------------------------------------------------*/
/* Toolhelp32 API definitions. */
#define TH32CS_SNAPPROCESS 0x00000002
+#if defined(_WIN64)
+typedef unsigned __int64 ProcessULONG_PTR;
+#else
+typedef unsigned long ProcessULONG_PTR;
+#endif
typedef struct tagPROCESSENTRY32 PROCESSENTRY32;
typedef PROCESSENTRY32* LPPROCESSENTRY32;
struct tagPROCESSENTRY32
@@ -2523,7 +2528,7 @@ struct tagPROCESSENTRY32
DWORD dwSize;
DWORD cntUsage;
DWORD th32ProcessID;
- DWORD th32DefaultHeapID;
+ ProcessULONG_PTR th32DefaultHeapID;
DWORD th32ModuleID;
DWORD cntThreads;
DWORD th32ParentProcessID;