MCPcopy Create free account
hub / github.com/The-Powder-Toy/The-Powder-Toy / GetModuleInfo

Function GetModuleInfo

src/common/platform/stacktrace/Windows.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 uintptr_t displacement;
37};
38static std::optional<ModuleInfo> GetModuleInfo(HANDLE process, uintptr_t offset)
39{
40 IMAGEHLP_MODULEW64 module{};
41 module.SizeOfStruct = sizeof(module);
42 if (SymGetModuleInfoW64(process, offset, &module))
43 {
44 auto displacement = offset - uintptr_t(module.BaseOfImage);
45 return ModuleInfo{ WinNarrow(&module.LoadedImageName[0]).FromUtf8(), displacement };
46 }
47 return std::nullopt;
48}
49
50std::optional<std::vector<String>> StackTrace()
51{

Callers 1

StackTraceFunction · 0.85

Calls 2

WinNarrowFunction · 0.85
FromUtf8Method · 0.80

Tested by

no test coverage detected