mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 721564 - Get module information for the profiler on Windows; r=BenWa
This commit is contained in:
parent
9fc0ba862e
commit
838b8d9023
@ -40,20 +40,25 @@
|
||||
#include <tlhelp32.h>
|
||||
|
||||
#include "shared-libraries.h"
|
||||
#include "nsWindowsHelpers.h"
|
||||
|
||||
SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
|
||||
{
|
||||
SharedLibraryInfo sharedLibraryInfo;
|
||||
|
||||
/*
|
||||
HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
|
||||
nsAutoHandle snap(CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId()));
|
||||
|
||||
MODULEENTRY32 module;
|
||||
Module32First(snap, &module);
|
||||
do {
|
||||
// process module
|
||||
} while (Module32Next(snap, &module));
|
||||
*/
|
||||
MODULEENTRY32 module = {0};
|
||||
module.dwSize = sizeof(MODULEENTRY32);
|
||||
if (Module32First(snap, &module)) {
|
||||
do {
|
||||
SharedLibrary shlib((uintptr_t)module.modBaseAddr,
|
||||
(uintptr_t)module.modBaseAddr+module.modBaseSize,
|
||||
0, // DLLs are always mapped at offset 0 on Windows
|
||||
module.szModule);
|
||||
sharedLibraryInfo.AddSharedLibrary(shlib);
|
||||
} while (Module32Next(snap, &module));
|
||||
}
|
||||
|
||||
return sharedLibraryInfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user