Skip to content

Commit

Permalink
fixed permission bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sava41 committed Jan 22, 2024
1 parent 0376fec commit 3b1a62f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/dll/dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,12 @@ struct monitorData
int numMonitors;
monitorData *monitors;

extern "C" IMAGE_DOS_HEADER __ImageBase;
bool ParseSettings()
{
char dllPath[MAX_PATH];
HMODULE hModule = NULL;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)ParseSettings, &hModule);

if (!GetModuleFileName(hModule, dllPath, MAX_PATH))
if (!GetModuleFileName((HMODULE)&__ImageBase, dllPath, MAX_PATH))
{
return false;
}
Expand Down

0 comments on commit 3b1a62f

Please sign in to comment.