MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / GetOwnFileName

Function GetOwnFileName

shared/VersionInfo.h:117–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115#undef _IS_BUILD_MACRO
116
117static ALWAYS_INLINE HRESULT GetOwnFileName(LPWSTR *filename) {
118 *filename = (LPWSTR)LocalAlloc(LPTR, MAX_PATH * sizeof(WCHAR));
119 if (GetModuleFileName(OWN_MODULE, *filename, MAX_PATH) == 0) {
120 HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
121 LocalFree(*filename);
122 *filename = NULL;
123 return hr;
124 }
125
126 return S_OK;
127}

Callers 3

UpdateRegistrationFunction · 0.85
SelfElevateFunction · 0.85
RunOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected