source: branch/egtra-stream-without-en_dec/api_tlhelp32.sbp@ 675

Last change on this file since 675 was 497, checked in by イグトランス (egtra), 17 years ago

インクルードガードとその他不要な前処理定義などの削除

File size: 3.7 KB
Line 
1' api_tlhelp32.sbp
2
3Const MAX_MODULE_NAME32 = 255
4
5
6
7'-----------------------
8' Shapshot function
9'-----------------------
10
11Const TH32CS_SNAPHEAPLIST = &H00000001
12Const TH32CS_SNAPPROCESS = &H00000002
13Const TH32CS_SNAPTHREAD = &H00000004
14Const TH32CS_SNAPMODULE = &H00000008
15Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST or TH32CS_SNAPPROCESS or TH32CS_SNAPTHREAD or TH32CS_SNAPMODULE)
16Const TH32CS_INHERIT = &H80000000
17Declare Function CreateToolhelp32Snapshot Lib "kernel32" (dwFlags As DWord, th32ProcessID As DWord) As HANDLE
18
19
20
21'-----------------------
22' heap walking
23'-----------------------
24
25Type HEAPLIST32
26 dwSize As DWord
27 th32ProcessID As DWord
28 th32HeapID As DWord
29 dwFlags As DWord
30End Type
31TypeDef PHEAPLIST32 = *HEAPLIST32
32TypeDef LPHEAPLIST32 = *HEAPLIST32
33
34'dwFlags
35Const HF32_DEFAULT = 1 ' process's default heap
36Const HF32_SHARED = 2 ' is shared heap
37
38Declare Function Heap32ListFirst Lib "kernel32" (hSnapshot As HANDLE, ByRef hi As HEAPLIST32) As BOOL
39Declare Function Heap32ListNext Lib "kernel32" (hSnapshot As HANDLE, ByRef hi As HEAPLIST32) As BOOL
40
41Type HEAPENTRY32
42 dwSize As DWord
43 hHandle As DWord
44 dwAddress As DWord
45 dwBlockSize As DWord
46 dwFlags As DWord
47 dwLockCount As DWord
48 dwResvd As DWord
49 th32ProcessID As DWord
50 th32HeapID As DWord
51End Type
52TypeDef PHEAPENTRY32 = *HEAPENTRY32
53TypeDef LPHEAPENTRY32 = *HEAPENTRY32
54
55'dwFlags
56Const LF32_FIXED = &H00000001
57Const LF32_FREE = &H00000002
58Const LF32_MOVEABLE = &H00000004
59
60Declare Function Heap32First Lib "kernel32" (ByRef he As HEAPENTRY32, th32ProcessID As DWord, th32HeapID As DWord) As BOOL
61Declare Function Heap32Next Lib "kernel32" (ByRef he As HEAPENTRY32) As BOOL
62
63Declare Function Toolhelp32ReadProcessMemory Lib "kernel32" (th32ProcessID As DWord, lpBaseAddress As VoidPtr, lpBuffer As VoidPtr, cbRead As DWord, ByRef NumberOfBytesRead As DWord) As BOOL
64
65
66
67'-----------------------
68' Process walking
69'-----------------------
70
71Type PROCESSENTRY32
72 dwSize As DWord
73 cntUsage As DWord
74 th32ProcessID As DWord
75 th32DefaultHeapID As DWord
76 th32ModuleID As DWord
77 cntThreads As DWord
78 th32ParentProcessID As DWord
79 pcPriClassBase As Long
80 dwFlags As DWord
81 szExeFile[ELM(MAX_PATH)] As Byte
82End Type
83TypeDef PPROCESSENTRY32 = *PROCESSENTRY32
84TypeDef LPPROCESSENTRY32 = *PROCESSENTRY32
85
86Declare Function Process32First Lib "kernel32" (hSnapshot As HANDLE, ByRef pe As PROCESSENTRY32) As BOOL
87Declare Function Process32Next Lib "kernel32" (hSnapshot As HANDLE, ByRef pe As PROCESSENTRY32) As BOOL
88
89
90
91'-----------------------
92' Thread walking
93'-----------------------
94
95Type THREADENTRY32
96 dwSize As DWord
97 cntUsage As DWord
98 th32ThreadID As DWord
99 th32OwnerProcessID As DWord
100 tpBasePri As Long
101 tpDeltaPri As Long
102 dwFlags As DWord
103End Type
104TypeDef PTHREADENTRY32 = *THREADENTRY32
105TypeDef LPTHREADENTRY32 = *THREADENTRY32
106
107Declare Function Thread32First Lib "kernel32" (hSnapshot As HANDLE, ByRef te As THREADENTRY32) As BOOL
108Declare Function Thread32Next Lib "kernel32" (hSnapshot As HANDLE, ByRef te As THREADENTRY32) As BOOL
109
110
111
112'-----------------------
113' Module walking
114'-----------------------
115
116Type MODULEENTRY32
117 dwSize As DWord
118 th32ModuleID As DWord
119 th32ProcessID As DWord
120 GlblcntUsage As DWord
121 ProccntUsage As DWord
122 modBaseAddr As *Byte
123 modBaseSize As DWord
124 hModule As HANDLE
125 szModule[ELM(MAX_MODULE_NAME32 + 1)] As Byte
126 szExePath[ELM(MAX_PATH)] As Byte
127End Type
128TypeDef PMODULEENTRY32 = *MODULEENTRY32
129TypeDef LPMODULEENTRY32 = *MODULEENTRY32
130
131Declare Function Module32First Lib "kernel32" (hSnapshot As HANDLE, ByRef me As MODULEENTRY32) As BOOL
132Declare Function Module32Next Lib "kernel32" (hSnapshot As HANDLE, ByRef me As MODULEENTRY32) As BOOL
Note: See TracBrowser for help on using the repository browser.