MCPcopy Create free account
hub / github.com/ThirteenAG/Ultimate-ASI-Loader / GetModuleFileNameW

Function GetModuleFileNameW

external/ModuleList/ModuleList.hpp:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <tuple>
7
8std::wstring GetModuleFileNameW(HMODULE hModule)
9{
10 static constexpr auto INITIAL_BUFFER_SIZE = MAX_PATH;
11 static constexpr auto MAX_ITERATIONS = 7;
12 std::wstring ret;
13 auto bufferSize = INITIAL_BUFFER_SIZE;
14 for (size_t iterations = 0; iterations < MAX_ITERATIONS; ++iterations)
15 {
16 ret.resize(bufferSize);
17 auto charsReturned = GetModuleFileNameW(hModule, &ret[0], bufferSize);
18 if (charsReturned < ret.length())
19 {
20 ret.resize(charsReturned);
21 return ret;
22 }
23 else
24 {
25 bufferSize *= 2;
26 }
27 }
28 return L"";
29}
30
31auto starts_with = [](const std::wstring &big_str, const std::wstring &small_str) -> auto
32{

Callers 11

GetApplicationIconFunction · 0.85
FolderExistsFunction · 0.85
GetModulePathFunction · 0.85
GetSelfNameFunction · 0.85
LoadOriginalLibraryFunction · 0.85
LoadPluginsFunction · 0.85
InitFunction · 0.85
GetModulePathFunction · 0.85
EnumerateInternalMethod · 0.85

Calls

no outgoing calls

Tested by 1

GetModulePathFunction · 0.68