| 36 | uintptr_t displacement; |
| 37 | }; |
| 38 | static 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 | |
| 50 | std::optional<std::vector<String>> StackTrace() |
| 51 | { |
no test coverage detected