tlhelp32.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. tlhelp32.h - Include file for Tool help functions.
  3. Written by Mumit Khan <khan@nanotech.wisc.edu>
  4. This file is part of a free library for the Win32 API.
  5. This library is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. */
  9. #ifndef _TLHELP32_H
  10. #define _TLHELP32_H
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define HF32_DEFAULT 1
  15. #define HF32_SHARED 2
  16. #define LF32_FIXED 0x1
  17. #define LF32_FREE 0x2
  18. #define LF32_MOVEABLE 0x4
  19. #define MAX_MODULE_NAME32 255
  20. #define TH32CS_SNAPHEAPLIST 0x1
  21. #define TH32CS_SNAPPROCESS 0x2
  22. #define TH32CS_SNAPTHREAD 0x4
  23. #define TH32CS_SNAPMODULE 0x8
  24. #define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST|TH32CS_SNAPPROCESS|TH32CS_SNAPTHREAD|TH32CS_SNAPMODULE)
  25. #define TH32CS_INHERIT 0x80000000
  26. typedef struct tagHEAPLIST32 {
  27. DWORD dwSize;
  28. DWORD th32ProcessID;
  29. DWORD th32HeapID;
  30. DWORD dwFlags;
  31. } HEAPLIST32,*PHEAPLIST32,*LPHEAPLIST32;
  32. typedef struct tagHEAPENTRY32 {
  33. DWORD dwSize;
  34. HANDLE hHandle;
  35. DWORD dwAddress;
  36. DWORD dwBlockSize;
  37. DWORD dwFlags;
  38. DWORD dwLockCount;
  39. DWORD dwResvd;
  40. DWORD th32ProcessID;
  41. DWORD th32HeapID;
  42. } HEAPENTRY32,*PHEAPENTRY32,*LPHEAPENTRY32;
  43. typedef struct tagPROCESSENTRY32W {
  44. DWORD dwSize;
  45. DWORD cntUsage;
  46. DWORD th32ProcessID;
  47. DWORD th32DefaultHeapID;
  48. DWORD th32ModuleID;
  49. DWORD cntThreads;
  50. DWORD th32ParentProcessID;
  51. LONG pcPriClassBase;
  52. DWORD dwFlags;
  53. WCHAR szExeFile[MAX_PATH];
  54. } PROCESSENTRY32W,*PPROCESSENTRY32W,*LPPROCESSENTRY32W;
  55. typedef struct tagPROCESSENTRY32 {
  56. DWORD dwSize;
  57. DWORD cntUsage;
  58. DWORD th32ProcessID;
  59. DWORD th32DefaultHeapID;
  60. DWORD th32ModuleID;
  61. DWORD cntThreads;
  62. DWORD th32ParentProcessID;
  63. LONG pcPriClassBase;
  64. DWORD dwFlags;
  65. CHAR szExeFile[MAX_PATH];
  66. } PROCESSENTRY32,*PPROCESSENTRY32,*LPPROCESSENTRY32;
  67. typedef struct tagTHREADENTRY32 {
  68. DWORD dwSize;
  69. DWORD cntUsage;
  70. DWORD th32ThreadID;
  71. DWORD th32OwnerProcessID;
  72. LONG tpBasePri;
  73. LONG tpDeltaPri;
  74. DWORD dwFlags;
  75. } THREADENTRY32,*PTHREADENTRY32,*LPTHREADENTRY32;
  76. typedef struct tagMODULEENTRY32W {
  77. DWORD dwSize;
  78. DWORD th32ModuleID;
  79. DWORD th32ProcessID;
  80. DWORD GlblcntUsage;
  81. DWORD ProccntUsage;
  82. BYTE *modBaseAddr;
  83. DWORD modBaseSize;
  84. HMODULE hModule;
  85. WCHAR szModule[MAX_MODULE_NAME32 + 1];
  86. WCHAR szExePath[MAX_PATH];
  87. } MODULEENTRY32W,*PMODULEENTRY32W,*LPMODULEENTRY32W;
  88. typedef struct tagMODULEENTRY32 {
  89. DWORD dwSize;
  90. DWORD th32ModuleID;
  91. DWORD th32ProcessID;
  92. DWORD GlblcntUsage;
  93. DWORD ProccntUsage;
  94. BYTE *modBaseAddr;
  95. DWORD modBaseSize;
  96. HMODULE hModule;
  97. char szModule[MAX_MODULE_NAME32 + 1];
  98. char szExePath[MAX_PATH];
  99. } MODULEENTRY32,*PMODULEENTRY32,*LPMODULEENTRY32;
  100. BOOL WINAPI Heap32First(LPHEAPENTRY32,DWORD,DWORD);
  101. BOOL WINAPI Heap32ListFirst(HANDLE,LPHEAPLIST32);
  102. BOOL WINAPI Heap32ListNext(HANDLE,LPHEAPLIST32);
  103. BOOL WINAPI Heap32Next(LPHEAPENTRY32);
  104. BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32);
  105. BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W);
  106. BOOL WINAPI Module32Next(HANDLE,LPMODULEENTRY32);
  107. BOOL WINAPI Module32NextW(HANDLE,LPMODULEENTRY32W);
  108. BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32);
  109. BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W);
  110. BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32);
  111. BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W);
  112. BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32);
  113. BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32);
  114. BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,DWORD,LPDWORD);
  115. HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD);
  116. #ifdef UNICODE
  117. #define LPMODULEENTRY32 LPMODULEENTRY32W
  118. #define LPPROCESSENTRY32 LPPROCESSENTRY32W
  119. #define MODULEENTRY32 MODULEENTRY32W
  120. #define Module32First Module32FirstW
  121. #define Module32Next Module32NextW
  122. #define PMODULEENTRY32 PMODULEENTRY32W
  123. #define PPROCESSENTRY32 PPROCESSENTRY32W
  124. #define PROCESSENTRY32 PROCESSENTRY32W
  125. #define Process32First Process32FirstW
  126. #define Process32Next Process32NextW
  127. #endif /* UNICODE */
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif /* _TLHELP32_H */