[1046] | 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 | #if __GNUC__ >=3
|
---|
| 16 | #pragma GCC system_header
|
---|
| 17 | #endif
|
---|
| 18 |
|
---|
| 19 | #ifdef __cplusplus
|
---|
| 20 | extern "C" {
|
---|
| 21 | #endif
|
---|
| 22 | #define HF32_DEFAULT 1
|
---|
| 23 | #define HF32_SHARED 2
|
---|
| 24 | #define LF32_FIXED 0x1
|
---|
| 25 | #define LF32_FREE 0x2
|
---|
| 26 | #define LF32_MOVEABLE 0x4
|
---|
| 27 | #define MAX_MODULE_NAME32 255
|
---|
| 28 | #define TH32CS_SNAPHEAPLIST 0x1
|
---|
| 29 | #define TH32CS_SNAPPROCESS 0x2
|
---|
| 30 | #define TH32CS_SNAPTHREAD 0x4
|
---|
| 31 | #define TH32CS_SNAPMODULE 0x8
|
---|
| 32 | #define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST|TH32CS_SNAPPROCESS|TH32CS_SNAPTHREAD|TH32CS_SNAPMODULE)
|
---|
| 33 | #define TH32CS_INHERIT 0x80000000
|
---|
| 34 | typedef struct tagHEAPLIST32 {
|
---|
| 35 | DWORD dwSize;
|
---|
| 36 | DWORD th32ProcessID;
|
---|
| 37 | DWORD th32HeapID;
|
---|
| 38 | DWORD dwFlags;
|
---|
| 39 | } HEAPLIST32,*PHEAPLIST32,*LPHEAPLIST32;
|
---|
| 40 | typedef struct tagHEAPENTRY32 {
|
---|
| 41 | DWORD dwSize;
|
---|
| 42 | HANDLE hHandle;
|
---|
| 43 | DWORD dwAddress;
|
---|
| 44 | DWORD dwBlockSize;
|
---|
| 45 | DWORD dwFlags;
|
---|
| 46 | DWORD dwLockCount;
|
---|
| 47 | DWORD dwResvd;
|
---|
| 48 | DWORD th32ProcessID;
|
---|
| 49 | DWORD th32HeapID;
|
---|
| 50 | } HEAPENTRY32,*PHEAPENTRY32,*LPHEAPENTRY32;
|
---|
| 51 | typedef struct tagPROCESSENTRY32W {
|
---|
| 52 | DWORD dwSize;
|
---|
| 53 | DWORD cntUsage;
|
---|
| 54 | DWORD th32ProcessID;
|
---|
| 55 | DWORD th32DefaultHeapID;
|
---|
| 56 | DWORD th32ModuleID;
|
---|
| 57 | DWORD cntThreads;
|
---|
| 58 | DWORD th32ParentProcessID;
|
---|
| 59 | LONG pcPriClassBase;
|
---|
| 60 | DWORD dwFlags;
|
---|
| 61 | WCHAR szExeFile[MAX_PATH];
|
---|
| 62 | } PROCESSENTRY32W,*PPROCESSENTRY32W,*LPPROCESSENTRY32W;
|
---|
| 63 | typedef struct tagPROCESSENTRY32 {
|
---|
| 64 | DWORD dwSize;
|
---|
| 65 | DWORD cntUsage;
|
---|
| 66 | DWORD th32ProcessID;
|
---|
| 67 | DWORD th32DefaultHeapID;
|
---|
| 68 | DWORD th32ModuleID;
|
---|
| 69 | DWORD cntThreads;
|
---|
| 70 | DWORD th32ParentProcessID;
|
---|
| 71 | LONG pcPriClassBase;
|
---|
| 72 | DWORD dwFlags;
|
---|
| 73 | CHAR szExeFile[MAX_PATH];
|
---|
| 74 | } PROCESSENTRY32,*PPROCESSENTRY32,*LPPROCESSENTRY32;
|
---|
| 75 | typedef struct tagTHREADENTRY32 {
|
---|
| 76 | DWORD dwSize;
|
---|
| 77 | DWORD cntUsage;
|
---|
| 78 | DWORD th32ThreadID;
|
---|
| 79 | DWORD th32OwnerProcessID;
|
---|
| 80 | LONG tpBasePri;
|
---|
| 81 | LONG tpDeltaPri;
|
---|
| 82 | DWORD dwFlags;
|
---|
| 83 | } THREADENTRY32,*PTHREADENTRY32,*LPTHREADENTRY32;
|
---|
| 84 | typedef struct tagMODULEENTRY32W {
|
---|
| 85 | DWORD dwSize;
|
---|
| 86 | DWORD th32ModuleID;
|
---|
| 87 | DWORD th32ProcessID;
|
---|
| 88 | DWORD GlblcntUsage;
|
---|
| 89 | DWORD ProccntUsage;
|
---|
| 90 | BYTE *modBaseAddr;
|
---|
| 91 | DWORD modBaseSize;
|
---|
| 92 | HMODULE hModule;
|
---|
| 93 | WCHAR szModule[MAX_MODULE_NAME32 + 1];
|
---|
| 94 | WCHAR szExePath[MAX_PATH];
|
---|
| 95 | } MODULEENTRY32W,*PMODULEENTRY32W,*LPMODULEENTRY32W;
|
---|
| 96 | typedef struct tagMODULEENTRY32 {
|
---|
| 97 | DWORD dwSize;
|
---|
| 98 | DWORD th32ModuleID;
|
---|
| 99 | DWORD th32ProcessID;
|
---|
| 100 | DWORD GlblcntUsage;
|
---|
| 101 | DWORD ProccntUsage;
|
---|
| 102 | BYTE *modBaseAddr;
|
---|
| 103 | DWORD modBaseSize;
|
---|
| 104 | HMODULE hModule;
|
---|
| 105 | char szModule[MAX_MODULE_NAME32 + 1];
|
---|
| 106 | char szExePath[MAX_PATH];
|
---|
| 107 | } MODULEENTRY32,*PMODULEENTRY32,*LPMODULEENTRY32;
|
---|
| 108 | BOOL WINAPI Heap32First(LPHEAPENTRY32,DWORD,DWORD);
|
---|
| 109 | BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
|
---|
| 110 | BOOL WINAPI Heap32ListNext(HANDLE,LPHEAPLIST32);
|
---|
| 111 | BOOL WINAPI Heap32Next(LPHEAPENTRY32);
|
---|
| 112 | BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32);
|
---|
| 113 | BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W);
|
---|
| 114 | BOOL WINAPI Module32Next(HANDLE,LPMODULEENTRY32);
|
---|
| 115 | BOOL WINAPI Module32NextW(HANDLE,LPMODULEENTRY32W);
|
---|
| 116 | BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32);
|
---|
| 117 | BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W);
|
---|
| 118 | BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32);
|
---|
| 119 | BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W);
|
---|
| 120 | BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32);
|
---|
| 121 | BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32);
|
---|
| 122 | BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,DWORD,LPDWORD);
|
---|
| 123 | HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD);
|
---|
| 124 | #ifdef UNICODE
|
---|
| 125 | #define LPMODULEENTRY32 LPMODULEENTRY32W
|
---|
| 126 | #define LPPROCESSENTRY32 LPPROCESSENTRY32W
|
---|
| 127 | #define MODULEENTRY32 MODULEENTRY32W
|
---|
| 128 | #define Module32First Module32FirstW
|
---|
| 129 | #define Module32Next Module32NextW
|
---|
| 130 | #define PMODULEENTRY32 PMODULEENTRY32W
|
---|
| 131 | #define PPROCESSENTRY32 PPROCESSENTRY32W
|
---|
| 132 | #define PROCESSENTRY32 PROCESSENTRY32W
|
---|
| 133 | #define Process32First Process32FirstW
|
---|
| 134 | #define Process32Next Process32NextW
|
---|
| 135 | #endif /* UNICODE */
|
---|
| 136 | #ifdef __cplusplus
|
---|
| 137 | }
|
---|
| 138 | #endif
|
---|
| 139 | #endif /* _TLHELP32_H */
|
---|
| 140 |
|
---|