Skip to content

Commit 1bbe207

Browse files
committed
Taskbar10: Fix TrayThreadBSTA (54481602) taskbar thread flags for compatibility with taskbar toolbars
1 parent ab99f26 commit 1bbe207

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

ExplorerPatcher/dllmain.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10226,6 +10226,24 @@ void PatchPnidui(HMODULE hPnidui)
1022610226
#endif
1022710227
#pragma endregion
1022810228

10229+
10230+
#pragma region "Fix TrayThreadBSTA (54481602) taskbar thread flags for compatibility with taskbar toolbars"
10231+
#if WITH_MAIN_PATCHER
10232+
BOOL STDAPICALLTYPE explorer_SHCreateThread(
10233+
LPTHREAD_START_ROUTINE pfnThreadProc, void* pData, SHCT_FLAGS flags, LPTHREAD_START_ROUTINE pfnCallback)
10234+
{
10235+
static BOOL bPatched;
10236+
if (!bPatched && flags == CTF_THREAD_REF | CTF_REF_COUNTED | CTF_NOADDREFLIB)
10237+
{
10238+
bPatched = TRUE;
10239+
flags |= CTF_COINIT_STA | CTF_OLEINITIALIZE; // Add back the removed flags
10240+
}
10241+
return SHCreateThread(pfnThreadProc, pData, flags, pfnCallback);
10242+
}
10243+
#endif
10244+
#pragma endregion
10245+
10246+
1022910247
DWORD Inject(BOOL bIsExplorer)
1023010248
{
1023110249
#if defined(DEBUG) | defined(_DEBUG)
@@ -10676,6 +10694,10 @@ DWORD Inject(BOOL bIsExplorer)
1067610694
VnPatchIAT(hExplorer, "user32.dll", "SetWindowCompositionAttribute", explorer_SetWindowCompositionAttribute);
1067710695
}
1067810696
}
10697+
if (global_rovi.dwBuildNumber >= 26100)
10698+
{
10699+
VnPatchIAT(hExplorer, "api-ms-win-shcore-thread-l1-1-0.dll", "SHCreateThread", explorer_SHCreateThread);
10700+
}
1067910701
}
1068010702
if (IsWindows11())
1068110703
{

0 commit comments

Comments
 (0)