tlhelp32.h 4.82 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 1998 Patrick Spinler
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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 21 22 23 24 25
#ifndef __WINE_TLHELP32_H
#define __WINE_TLHELP32_H

#ifdef __cplusplus
extern "C" {
#endif

26 27 28
/*
 * CreateToolhelp32Snapshot
 */
29 30 31 32 33 34 35 36

#define TH32CS_SNAPHEAPLIST 0x00000001
#define TH32CS_SNAPPROCESS  0x00000002
#define TH32CS_SNAPTHREAD   0x00000004
#define TH32CS_SNAPMODULE   0x00000008
#define TH32CS_SNAPALL     (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE)
#define TH32CS_INHERIT     0x80000000

37 38 39
HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD);

/*
40
 * thread entry list as created by CreateToolHelp32Snapshot
41 42 43 44
 */

typedef struct tagTHREADENTRY32
{
45 46 47 48 49 50 51 52
    DWORD dwSize;
    DWORD cntUsage;
    DWORD th32ThreadID;
    DWORD th32OwnerProcessID;
    LONG  tpBasePri;
    LONG  tpDeltaPri;
    DWORD dwFlags;
} THREADENTRY32, *PTHREADENTRY32, *LPTHREADENTRY32;
53 54 55 56 57

BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32);
BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32);

/*
58
 * Process entry list as created by CreateToolHelp32Snapshot
59 60 61 62
 */

typedef struct tagPROCESSENTRY32
{
63 64 65 66 67 68 69 70 71 72 73
    DWORD dwSize;
    DWORD cntUsage;
    DWORD th32ProcessID;
    DWORD th32DefaultHeapID;
    DWORD th32ModuleID;
    DWORD cntThreads;
    DWORD th32ParentProcessID;
    LONG  pcPriClassBase;
    DWORD dwFlags;
    char szExeFile[MAX_PATH];
} PROCESSENTRY32, *PPROCESSENTRY32, *LPPROCESSENTRY32;
74 75 76

typedef struct tagPROCESSENTRY32W
{
77 78 79 80 81 82 83 84 85 86 87
    DWORD dwSize;
    DWORD cntUsage;
    DWORD th32ProcessID;
    DWORD th32DefaultHeapID;
    DWORD th32ModuleID;
    DWORD cntThreads;
    DWORD th32ParentProcessID;
    LONG  pcPriClassBase;
    DWORD dwFlags;
    WCHAR szExeFile[MAX_PATH];
} PROCESSENTRY32W, *PPROCESSENTRY32W, *LPPROCESSENTRY32W;
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102

BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32);
BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W);
BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32);
BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W);

#ifdef UNICODE
#define Process32First Process32FirstW
#define Process32Next Process32NextW
#define PROCESSENTRY32 PROCESSENTRY32W
#define PPROCESSENTRY32 PPROCESSENTRY32W
#define LPPROCESSENTRY32 LPPROCESSENTRY32W
#endif

/*
103
 * Module entry list as created by CreateToolHelp32Snapshot
104 105 106 107 108 109
 */

#define MAX_MODULE_NAME32 255

typedef struct tagMODULEENTRY32
{
110
    DWORD  dwSize;
111
    DWORD  th32ModuleID;
112
    DWORD  th32ProcessID;
113 114 115 116
    DWORD  GlblcntUsage;
    DWORD  ProccntUsage;
    BYTE  *modBaseAddr;
    DWORD  modBaseSize;
117
    HMODULE hModule;
118
    char   szModule[MAX_MODULE_NAME32 + 1];
119 120
    char   szExePath[MAX_PATH];
} MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32;
121 122 123

typedef struct tagMODULEENTRY32W
{
124
    DWORD  dwSize;
125
    DWORD  th32ModuleID;
126
    DWORD  th32ProcessID;
127 128 129 130
    DWORD  GlblcntUsage;
    DWORD  ProccntUsage;
    BYTE  *modBaseAddr;
    DWORD  modBaseSize;
131
    HMODULE hModule;
132
    WCHAR  szModule[MAX_MODULE_NAME32 + 1];
133 134
    WCHAR  szExePath[MAX_PATH];
} MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W;
135 136 137 138 139 140 141 142 143 144 145 146 147 148

BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32);
BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W);
BOOL WINAPI Module32Next(HANDLE,LPMODULEENTRY32);
BOOL WINAPI Module32NextW(HANDLE,LPMODULEENTRY32W);

#ifdef UNICODE
#define Module32First Module32FirstW
#define Module32Next Module32NextW
#define MODULEENTRY32 MODULEENTRY32W
#define PMODULEENTRY32 PMODULEENTRY32W
#define LPMODULEENTRY32 LPMODULEENTRY32W
#endif

149 150
typedef struct tagHEAPLIST32
{
151 152 153 154 155 156
    SIZE_T dwSize;
    DWORD th32ProcessID;
    ULONG_PTR th32HeapID;
    DWORD dwFlags;
} HEAPLIST32, *PHEAPLIST32, *LPHEAPLIST32;

157 158 159
#define HF32_DEFAULT 1
#define HF32_SHARED  2

160
BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
161
BOOL WINAPI Heap32ListNext(HANDLE,LPHEAPLIST32);
162
BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,SIZE_T,SIZE_T*);
163

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
typedef struct tagHEAPENTRY32
{
    SIZE_T dwSize;
    HANDLE hHandle;
    ULONG_PTR dwAddress;
    SIZE_T dwBlockSize;
    DWORD dwFlags;
    DWORD dwLockCount;
    DWORD dwResvd;
    DWORD th32ProcessID;
    ULONG_PTR th32HeapID;
} HEAPENTRY32, *PHEAPENTRY32, *LPHEAPENTRY32;

BOOL WINAPI Heap32First(LPHEAPENTRY32,DWORD,ULONG_PTR);
BOOL WINAPI Heap32Next(LPHEAPENTRY32);

180
#ifdef __cplusplus
Patrik Stridvall's avatar
Patrik Stridvall committed
181
} /* extern "C" */
182 183 184
#endif

#endif /* __WINE_TLHELP32_H */