1 | /*
|
---|
2 | * Copyright (C) 1998 Patrick Spinler
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef __WINE_TLHELP32_H
|
---|
29 | #define __WINE_TLHELP32_H
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | /*
|
---|
36 | * CreateToolhelp32Snapshot
|
---|
37 | */
|
---|
38 |
|
---|
39 | #define TH32CS_SNAPHEAPLIST 0x00000001
|
---|
40 | #define TH32CS_SNAPPROCESS 0x00000002
|
---|
41 | #define TH32CS_SNAPTHREAD 0x00000004
|
---|
42 | #define TH32CS_SNAPMODULE 0x00000008
|
---|
43 | #define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE)
|
---|
44 | #define TH32CS_INHERIT 0x80000000
|
---|
45 |
|
---|
46 | HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD);
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * thread entry list as created by CreateToolHelp32Snapshot
|
---|
50 | */
|
---|
51 |
|
---|
52 | typedef struct tagTHREADENTRY32
|
---|
53 | {
|
---|
54 | DWORD dwSize;
|
---|
55 | DWORD cntUsage;
|
---|
56 | DWORD th32ThreadID;
|
---|
57 | DWORD th32OwnerProcessID;
|
---|
58 | LONG tpBasePri;
|
---|
59 | LONG tpDeltaPri;
|
---|
60 | DWORD dwFlags;
|
---|
61 | } THREADENTRY32, *PTHREADENTRY32, *LPTHREADENTRY32;
|
---|
62 |
|
---|
63 | BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32);
|
---|
64 | BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32);
|
---|
65 |
|
---|
66 | /*
|
---|
67 | * Process entry list as created by CreateToolHelp32Snapshot
|
---|
68 | */
|
---|
69 |
|
---|
70 | typedef struct tagPROCESSENTRY32
|
---|
71 | {
|
---|
72 | DWORD dwSize;
|
---|
73 | DWORD cntUsage;
|
---|
74 | DWORD th32ProcessID;
|
---|
75 | ULONG_PTR th32DefaultHeapID;
|
---|
76 | DWORD th32ModuleID;
|
---|
77 | DWORD cntThreads;
|
---|
78 | DWORD th32ParentProcessID;
|
---|
79 | LONG pcPriClassBase;
|
---|
80 | DWORD dwFlags;
|
---|
81 | char szExeFile[MAX_PATH];
|
---|
82 | } PROCESSENTRY32, *PPROCESSENTRY32, *LPPROCESSENTRY32;
|
---|
83 |
|
---|
84 | typedef struct tagPROCESSENTRY32W
|
---|
85 | {
|
---|
86 | DWORD dwSize;
|
---|
87 | DWORD cntUsage;
|
---|
88 | DWORD th32ProcessID;
|
---|
89 | ULONG_PTR th32DefaultHeapID;
|
---|
90 | DWORD th32ModuleID;
|
---|
91 | DWORD cntThreads;
|
---|
92 | DWORD th32ParentProcessID;
|
---|
93 | LONG pcPriClassBase;
|
---|
94 | DWORD dwFlags;
|
---|
95 | WCHAR szExeFile[MAX_PATH];
|
---|
96 | } PROCESSENTRY32W, *PPROCESSENTRY32W, *LPPROCESSENTRY32W;
|
---|
97 |
|
---|
98 | BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32);
|
---|
99 | BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W);
|
---|
100 | BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32);
|
---|
101 | BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W);
|
---|
102 |
|
---|
103 | #ifdef UNICODE
|
---|
104 | #define Process32First Process32FirstW
|
---|
105 | #define Process32Next Process32NextW
|
---|
106 | #define PROCESSENTRY32 PROCESSENTRY32W
|
---|
107 | #define PPROCESSENTRY32 PPROCESSENTRY32W
|
---|
108 | #define LPPROCESSENTRY32 LPPROCESSENTRY32W
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | /*
|
---|
112 | * Module entry list as created by CreateToolHelp32Snapshot
|
---|
113 | */
|
---|
114 |
|
---|
115 | #define MAX_MODULE_NAME32 255
|
---|
116 |
|
---|
117 | typedef struct tagMODULEENTRY32
|
---|
118 | {
|
---|
119 | DWORD dwSize;
|
---|
120 | DWORD th32ModuleID;
|
---|
121 | DWORD th32ProcessID;
|
---|
122 | DWORD GlblcntUsage;
|
---|
123 | DWORD ProccntUsage;
|
---|
124 | BYTE *modBaseAddr;
|
---|
125 | DWORD modBaseSize;
|
---|
126 | HMODULE hModule;
|
---|
127 | char szModule[MAX_MODULE_NAME32 + 1];
|
---|
128 | char szExePath[MAX_PATH];
|
---|
129 | } MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32;
|
---|
130 |
|
---|
131 | typedef struct tagMODULEENTRY32W
|
---|
132 | {
|
---|
133 | DWORD dwSize;
|
---|
134 | DWORD th32ModuleID;
|
---|
135 | DWORD th32ProcessID;
|
---|
136 | DWORD GlblcntUsage;
|
---|
137 | DWORD ProccntUsage;
|
---|
138 | BYTE *modBaseAddr;
|
---|
139 | DWORD modBaseSize;
|
---|
140 | HMODULE hModule;
|
---|
141 | WCHAR szModule[MAX_MODULE_NAME32 + 1];
|
---|
142 | WCHAR szExePath[MAX_PATH];
|
---|
143 | } MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W;
|
---|
144 |
|
---|
145 | BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32);
|
---|
146 | BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W);
|
---|
147 | BOOL WINAPI Module32Next(HANDLE,LPMODULEENTRY32);
|
---|
148 | BOOL WINAPI Module32NextW(HANDLE,LPMODULEENTRY32W);
|
---|
149 |
|
---|
150 | #ifdef UNICODE
|
---|
151 | #define Module32First Module32FirstW
|
---|
152 | #define Module32Next Module32NextW
|
---|
153 | #define MODULEENTRY32 MODULEENTRY32W
|
---|
154 | #define PMODULEENTRY32 PMODULEENTRY32W
|
---|
155 | #define LPMODULEENTRY32 LPMODULEENTRY32W
|
---|
156 | #endif
|
---|
157 |
|
---|
158 | typedef struct tagHEAPLIST32
|
---|
159 | {
|
---|
160 | SIZE_T dwSize;
|
---|
161 | DWORD th32ProcessID;
|
---|
162 | ULONG_PTR th32HeapID;
|
---|
163 | DWORD dwFlags;
|
---|
164 | } HEAPLIST32, *PHEAPLIST32, *LPHEAPLIST32;
|
---|
165 |
|
---|
166 | #define HF32_DEFAULT 1
|
---|
167 | #define HF32_SHARED 2
|
---|
168 |
|
---|
169 | BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
|
---|
170 | BOOL WINAPI Heap32ListNext(HANDLE,LPHEAPLIST32);
|
---|
171 | BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,SIZE_T,SIZE_T*);
|
---|
172 |
|
---|
173 | typedef struct tagHEAPENTRY32
|
---|
174 | {
|
---|
175 | SIZE_T dwSize;
|
---|
176 | HANDLE hHandle;
|
---|
177 | ULONG_PTR dwAddress;
|
---|
178 | SIZE_T dwBlockSize;
|
---|
179 | DWORD dwFlags;
|
---|
180 | DWORD dwLockCount;
|
---|
181 | DWORD dwResvd;
|
---|
182 | DWORD th32ProcessID;
|
---|
183 | ULONG_PTR th32HeapID;
|
---|
184 | } HEAPENTRY32, *PHEAPENTRY32, *LPHEAPENTRY32;
|
---|
185 |
|
---|
186 | BOOL WINAPI Heap32First(LPHEAPENTRY32,DWORD,ULONG_PTR);
|
---|
187 | BOOL WINAPI Heap32Next(LPHEAPENTRY32);
|
---|
188 |
|
---|
189 | #ifdef __cplusplus
|
---|
190 | } /* extern "C" */
|
---|
191 | #endif
|
---|
192 |
|
---|
193 | #endif /* __WINE_TLHELP32_H */
|
---|