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
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
// Copyright © 2015, Gigih Aji Ibrahim
// Licensed under the MIT License <LICENSE.md>
pub const MAX_MODULE_NAME32: usize = 255;
pub const TH32CS_SNAPHEAPLIST: ::DWORD = 0x00000001;
pub const TH32CS_SNAPPROCESS: ::DWORD = 0x00000002;
pub const TH32CS_SNAPTHREAD: ::DWORD = 0x00000004;
pub const TH32CS_SNAPMODULE: ::DWORD = 0x00000008;
pub const TH32CS_SNAPMODULE32: ::DWORD = 0x00000010;
pub const TH32CS_SNAPALL: ::DWORD =
    (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE);
pub const TH32CS_INHERIT: ::DWORD = 0x80000000;
STRUCT!{struct HEAPLIST32 {
    dwSize: ::SIZE_T,
    th32ProcessID: ::DWORD,
    th32HeapID: :: ULONG_PTR,
    dwFlags: ::DWORD,
}}
pub type PHEAPLIST32 = *mut HEAPLIST32;
pub type LPHEAPLIST32 = *mut HEAPLIST32;
pub const HF32_DEFAULT: ::DWORD = 1;
pub const HF32_SHARED: ::DWORD = 2;
STRUCT!{struct HEAPENTRY32 {
    dwSize: ::SIZE_T,
    hHandle: ::HANDLE,
    dwAddress: ::ULONG_PTR,
    dwBlockSize: ::SIZE_T,
    dwFlags: ::DWORD,
    dwLockCount: ::DWORD,
    dwResvd: ::DWORD,
    th32ProcessID: ::DWORD,
    th32HeapID: ::ULONG_PTR,
}}
pub type PHEAPENTRY32 = *mut HEAPENTRY32;
pub type LPHEAPENTRY32 = *mut HEAPENTRY32;
pub const LF32_FIXED: ::DWORD = 0x00000001;
pub const LF32_FREE: ::DWORD = 0x00000002;
pub const LF32_MOVEABLE: ::DWORD = 0x00000004;
STRUCT!{nodebug struct PROCESSENTRY32W {
    dwSize: ::DWORD,
    cntUsage: ::DWORD,
    th32ProcessID: ::DWORD,
    th32DefaultHeapID: ::ULONG_PTR,
    th32ModuleID: ::DWORD,
    cntThreads: ::DWORD,
    th32ParentProcessID: ::DWORD,
    pcPriClassBase: ::LONG,
    dwFlags: ::DWORD,
    szExeFile: [::WCHAR; ::MAX_PATH],
}}
pub type PPROCESSENTRY32W = *mut PROCESSENTRY32W;
pub type LPPROCESSENTRY32W = *mut PROCESSENTRY32W;
STRUCT!{nodebug struct PROCESSENTRY32 {
    dwSize: ::DWORD,
    cntUsage: ::DWORD,
    th32ProcessID: ::DWORD,
    th32DefaultHeapID: ::ULONG_PTR,
    th32ModuleID: ::DWORD,
    cntThreads: ::DWORD,
    th32ParentProcessID: ::DWORD,
    pcPriClassBase: ::LONG,
    dwFlags: ::DWORD,
    szExeFile: [::CHAR; ::MAX_PATH],
}}
pub type PPROCESSENTRY32 = *mut PROCESSENTRY32;
pub type LPPROCESSENTRY32 = *mut PROCESSENTRY32;
STRUCT!{struct THREADENTRY32 {
    dwSize: ::DWORD,
    cntUsage: ::DWORD,
    th32ThreadID: ::DWORD,
    th32OwnerProcessID: ::DWORD,
    tpBasePri: ::LONG,
    tpDeltaPri: ::LONG,
    dwFlags: ::DWORD,
}}
pub type PTHREADENTRY32 = *mut THREADENTRY32;
pub type LPTHREADENTRY32 = *mut THREADENTRY32;
STRUCT!{nodebug struct MODULEENTRY32W {
    dwSize: ::DWORD,
    th32ModuleID: ::DWORD,
    th32ProcessID: ::DWORD,
    GlblcntUsage: ::DWORD,
    ProccntUsage: ::DWORD,
    modBaseAddr: *mut ::BYTE,
    modBaseSize: ::DWORD,
    hModule: ::HMODULE,
    szModule: [::WCHAR; ::MAX_MODULE_NAME32 + 1],
    szExePath: [::WCHAR; ::MAX_PATH],
}}
pub type PMODULEENTRY32W = *mut MODULEENTRY32W;
pub type LPMODULEENTRY32W = *mut MODULEENTRY32W;
STRUCT!{nodebug struct MODULEENTRY32 {
    dwSize: ::DWORD,
    th32ModuleID: ::DWORD,
    th32ProcessID: ::DWORD,
    GlblcntUsage: ::DWORD,
    ProccntUsage: ::DWORD,
    modBaseAddr: *mut ::BYTE,
    modBaseSize: ::DWORD,
    hModule: ::HMODULE,
    szModule: [::CHAR; ::MAX_MODULE_NAME32 + 1],
    szExePath: [::CHAR; ::MAX_PATH],
}}
pub type PMODULEENTRY32 = *mut MODULEENTRY32;
pub type LPMODULEENTRY32 = *mut MODULEENTRY32;