xref: /reactos/sdk/include/psdk/tlhelp32.h (revision c2c66aff)
1 /*
2 	tlhelp32.h - Include file for Tool help functions.
3 
4 	Written by Mumit Khan <khan@nanotech.wisc.edu>
5 
6 	This file is part of a free library for the Win32 API.
7 
8 	This library is distributed in the hope that it will be useful,
9 	but WITHOUT ANY WARRANTY; without even the implied warranty of
10 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 
12 */
13 #ifndef _TLHELP32_H
14 #define _TLHELP32_H
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 #define HF32_DEFAULT	1
20 #define HF32_SHARED	2
21 #define LF32_FIXED	0x1
22 #define LF32_FREE	0x2
23 #define LF32_MOVEABLE	0x4
24 #define MAX_MODULE_NAME32	255
25 #define TH32CS_SNAPHEAPLIST	0x1
26 #define TH32CS_SNAPPROCESS	0x2
27 #define TH32CS_SNAPTHREAD	0x4
28 #define TH32CS_SNAPMODULE	0x8
29 #define TH32CS_SNAPALL	(TH32CS_SNAPHEAPLIST|TH32CS_SNAPPROCESS|TH32CS_SNAPTHREAD|TH32CS_SNAPMODULE)
30 #define TH32CS_INHERIT	0x80000000
31 typedef struct tagHEAPLIST32 {
32 	DWORD dwSize;
33 	DWORD th32ProcessID;
34 	DWORD th32HeapID;
35 	DWORD dwFlags;
36 } HEAPLIST32,*PHEAPLIST32,*LPHEAPLIST32;
37 typedef struct tagHEAPENTRY32 {
38 	DWORD dwSize;
39 	HANDLE hHandle;
40 	DWORD dwAddress;
41 	DWORD dwBlockSize;
42 	DWORD dwFlags;
43 	DWORD dwLockCount;
44 	DWORD dwResvd;
45 	DWORD th32ProcessID;
46 	DWORD th32HeapID;
47 } HEAPENTRY32,*PHEAPENTRY32,*LPHEAPENTRY32;
48 typedef struct tagPROCESSENTRY32W {
49 	DWORD dwSize;
50 	DWORD cntUsage;
51 	DWORD th32ProcessID;
52 	DWORD th32DefaultHeapID;
53 	DWORD th32ModuleID;
54 	DWORD cntThreads;
55 	DWORD th32ParentProcessID;
56 	LONG pcPriClassBase;
57 	DWORD dwFlags;
58 	WCHAR szExeFile[MAX_PATH];
59 } PROCESSENTRY32W,*PPROCESSENTRY32W,*LPPROCESSENTRY32W;
60 typedef struct tagPROCESSENTRY32 {
61 	DWORD dwSize;
62 	DWORD cntUsage;
63 	DWORD th32ProcessID;
64 	DWORD th32DefaultHeapID;
65 	DWORD th32ModuleID;
66 	DWORD cntThreads;
67 	DWORD th32ParentProcessID;
68 	LONG pcPriClassBase;
69 	DWORD dwFlags;
70 	CHAR  szExeFile[MAX_PATH];
71 } PROCESSENTRY32,*PPROCESSENTRY32,*LPPROCESSENTRY32;
72 typedef struct tagTHREADENTRY32 {
73 	DWORD dwSize;
74 	DWORD cntUsage;
75 	DWORD th32ThreadID;
76 	DWORD th32OwnerProcessID;
77 	LONG tpBasePri;
78 	LONG tpDeltaPri;
79 	DWORD dwFlags;
80 } THREADENTRY32,*PTHREADENTRY32,*LPTHREADENTRY32;
81 typedef struct tagMODULEENTRY32W {
82 	DWORD dwSize;
83 	DWORD th32ModuleID;
84 	DWORD th32ProcessID;
85 	DWORD GlblcntUsage;
86 	DWORD ProccntUsage;
87 	BYTE *modBaseAddr;
88 	DWORD modBaseSize;
89 	HMODULE hModule;
90 	WCHAR szModule[MAX_MODULE_NAME32 + 1];
91 	WCHAR szExePath[MAX_PATH];
92 } MODULEENTRY32W,*PMODULEENTRY32W,*LPMODULEENTRY32W;
93 typedef struct tagMODULEENTRY32 {
94 	DWORD dwSize;
95 	DWORD th32ModuleID;
96 	DWORD th32ProcessID;
97 	DWORD GlblcntUsage;
98 	DWORD ProccntUsage;
99 	BYTE *modBaseAddr;
100 	DWORD modBaseSize;
101 	HMODULE hModule;
102 	char szModule[MAX_MODULE_NAME32 + 1];
103 	char szExePath[MAX_PATH];
104 } MODULEENTRY32,*PMODULEENTRY32,*LPMODULEENTRY32;
105 BOOL WINAPI Heap32First(LPHEAPENTRY32,DWORD,DWORD);
106 BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
107 BOOL WINAPI Heap32ListNext(HANDLE,LPHEAPLIST32);
108 BOOL WINAPI Heap32Next(LPHEAPENTRY32);
109 BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32);
110 BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W);
111 BOOL WINAPI Module32Next(HANDLE,LPMODULEENTRY32);
112 BOOL WINAPI Module32NextW(HANDLE,LPMODULEENTRY32W);
113 BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32);
114 BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W);
115 BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32);
116 BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W);
117 BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32);
118 BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32);
119 BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,SIZE_T,SIZE_T*);
120 HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD);
121 #ifdef UNICODE
122 #define LPMODULEENTRY32 LPMODULEENTRY32W
123 #define LPPROCESSENTRY32 LPPROCESSENTRY32W
124 #define MODULEENTRY32 MODULEENTRY32W
125 #define Module32First Module32FirstW
126 #define Module32Next Module32NextW
127 #define PMODULEENTRY32 PMODULEENTRY32W
128 #define PPROCESSENTRY32 PPROCESSENTRY32W
129 #define PROCESSENTRY32 PROCESSENTRY32W
130 #define Process32First Process32FirstW
131 #define Process32Next Process32NextW
132 #endif /* UNICODE */
133 #ifdef __cplusplus
134 }
135 #endif
136 #endif /* _TLHELP32_H */
137 
138