GetModuleSize - get size of a module at address `hModule` returns the size of hModule, and 0 if hModule is invalid or error occurs */
| 469 | returns the size of hModule, and 0 if hModule is invalid or error occurs |
| 470 | */ |
| 471 | DWORD Process::GetModuleSize(__in const HMODULE hModule) |
| 472 | { |
| 473 | if (hModule == NULL) |
| 474 | { |
| 475 | return 0; |
| 476 | } |
| 477 | |
| 478 | MODULEINFO moduleInfo; |
| 479 | |
| 480 | if (!GetModuleInformation(GetCurrentProcess(), hModule, &moduleInfo, sizeof(moduleInfo))) |
| 481 | { |
| 482 | return 0; |
| 483 | } |
| 484 | |
| 485 | DWORD moduleSize = moduleInfo.SizeOfImage; |
| 486 | return moduleSize; |
| 487 | } |
| 488 | |
| 489 | /* |
| 490 | FillModuleList - fills the `ModuleList` class member with a list of module information |
nothing calls this directly
no outgoing calls
no test coverage detected