| 7 | |
| 8 | namespace FEX::Windows { |
| 9 | fextl::string GetExecutableFilePath() { |
| 10 | std::array<WCHAR, PATH_MAX> Buf; |
| 11 | UNICODE_STRING PathW {.Length = 0, .MaximumLength = Buf.size() * sizeof(WCHAR), .Buffer = Buf.data()}; |
| 12 | |
| 13 | if (LdrGetDllFullName(nullptr, &PathW)) { |
| 14 | return {}; |
| 15 | } |
| 16 | |
| 17 | STRING PathA; |
| 18 | RtlUnicodeStringToAnsiString(&PathA, &PathW, TRUE); |
| 19 | fextl::string Path(PathA.Buffer); |
| 20 | RtlFreeAnsiString(&PathA); |
| 21 | |
| 22 | return Path.substr(Path.find_last_of('\\') + 1); |
| 23 | } |
| 24 | |
| 25 | fextl::string GetSectionFilePath(uint64_t Address) { |
| 26 | struct { |
no test coverage detected