/
TlHelp32.go
48 lines (45 loc) · 1.63 KB
/
TlHelp32.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package win
const (
//
// The th32ProcessID argument is only used if TH32CS_SNAPHEAPLIST or
// TH32CS_SNAPMODULE is specified. th32ProcessID == 0 means the current
// process.
//
// NOTE that all of the snapshots are global except for the heap and module
// lists which are process specific. To enumerate the heap or module
// state for all WIN32 processes call with TH32CS_SNAPALL and the
// current process. Then for each process in the TH32CS_SNAPPROCESS
// list that isn't the current process, do a call with just
// TH32CS_SNAPHEAPLIST and/or TH32CS_SNAPMODULE.
//
// dwFlags
//
TH32CS_SNAPHEAPLIST = 0x00000001
TH32CS_SNAPPROCESS = 0x00000002
TH32CS_SNAPTHREAD = 0x00000004
TH32CS_SNAPMODULE = 0x00000008
TH32CS_SNAPMODULE32 = 0x00000010
TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE)
TH32CS_INHERIT = 0x80000000
)
/***** Process walking *************************************************/
type tagPROCESSENTRY32W struct {
DwSize uint32
cntUsage uint32
Th32ProcessID uint32 // this process
th32DefaultHeapID uint32
th32ModuleID uint32 // associated exe
cntThreads uint32
th32ParentProcessID uint32 // this process's parent process
pcPriClassBase int32 // Base priority of process's threads
dwFlags uint32
SzExeFile []uint16 // Path
}
type (
PROCESSENTRY32W tagPROCESSENTRY32W
PPROCESSENTRY32W *PROCESSENTRY32W
LPPROCESSENTRY32W *PROCESSENTRY32W
PROCESSENTRY32 PROCESSENTRY32W
PPROCESSENTRY32 *PROCESSENTRY32
LPPROCESSENTRY32 *PROCESSENTRY32
)