Skip to content

Commit

Permalink
UIFILE Override v1.0.1 (#862)
Browse files Browse the repository at this point in the history
* Fix issue with Explorer not hooking shell32 sometimes at startup
* Free ShellStyle module at uninit
  • Loading branch information
tetawaves authored Aug 14, 2024
1 parent c541b56 commit 632302a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mods/uifile-override.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @id uifile-override
// @name UIFILE Override
// @description Override UIFILE resources
// @version 1.0
// @version 1.0.1
// @author xalejandro
// @github https://github.com/tetawaves
// @include *
Expand Down Expand Up @@ -174,7 +174,7 @@ BOOL Wh_ModInit() {
Wh_Log(L"Failed to load dui70.dll");
}

if (lstrcmpW(L"C:\\Windows\\explorer.exe", exePath)) {
if (lstrcmpiW(L"C:\\Windows\\explorer.exe", exePath)) {
return TRUE;
}

Expand All @@ -184,7 +184,7 @@ BOOL Wh_ModInit() {
return FALSE;
}

WindhawkUtils::SYMBOL_HOOK hooks[] = {
WindhawkUtils::SYMBOL_HOOK shell32DllHooks[] = {
{{L"long " STHISCALL " DUI_LoadUIFileFromResources(struct HINSTANCE__ "
"*,unsigned int,unsigned short * *)"},
(void**)&DUILoadUIFileFromResources_orig,
Expand All @@ -199,10 +199,16 @@ BOOL Wh_ModInit() {

};

if (!WindhawkUtils::HookSymbols(hShell32, hooks, 2)) {
if (!WindhawkUtils::HookSymbols(hShell32, shell32DllHooks, 2)) {
Wh_Log(L"Failed to hook shell32.dll");
return FALSE;
}

return TRUE;
}

void Wh_ModUninit(void) {
if (g_ShellStyleMod) {
FreeLibrary(g_ShellStyleMod);
}
}

0 comments on commit 632302a

Please sign in to comment.