Browse Source

Taskbar10: Added the entry point for the experimental Start Screen implementation in ep_taskbar

pull/4392/head
Amrsatrio 8 months ago
parent
commit
65d8b53697
  1. 2
      ExplorerPatcher-L10N
  2. 98
      ExplorerPatcher/dllmain.c
  3. 2
      ep_setup/ep_setup.c
  4. 2
      libs/sws
  5. 2
      libs/zlib

2
ExplorerPatcher-L10N

@ -1 +1 @@
Subproject commit 1ba2543f819ea94cefea48105631414da4de57f7 Subproject commit c6bdc68de7242c189d40ba90c67b97fc9e33f3ad

98
ExplorerPatcher/dllmain.c

@ -9932,9 +9932,48 @@ const WCHAR* GetTaskbarDllChecked(symbols_addr* symbols_PTRS)
// - Windows 11: Load our taskbar DLL with LOAD_LIBRARY_AS_DATAFILE for the old context menu // - Windows 11: Load our taskbar DLL with LOAD_LIBRARY_AS_DATAFILE for the old context menu
// - Windows 10: Skip loading // - Windows 10: Skip loading
// - Windows 10 (ExplorerPatcher): Load it fully // - Windows 10 (ExplorerPatcher): Load it fully
typedef enum _EP_TASKBAR_FEATURES
{
EPTF_None,
EPTF_Taskbar = 0x1,
EPTF_ClassicContextMenu = 0x2,
EPTF_WinBlueLauncher = 0x4,
EPTF_FullLoad = EPTF_Taskbar | EPTF_WinBlueLauncher
} EP_TASKBAR_FEATURES;
EP_TASKBAR_FEATURES GetEPTaskbarFeatures()
{
EP_TASKBAR_FEATURES eptf = EPTF_None;
if (IsWindows11() && bOldTaskbar == 0)
{
eptf |= EPTF_ClassicContextMenu;
}
if (bOldTaskbar >= 2)
{
eptf |= EPTF_Taskbar;
}
BOOL fValue = FALSE;
BOOL fUseImmersiveLauncher = SUCCEEDED(SHRegGetBOOLWithREGSAM(HKEY_CURRENT_USER, L"Software\\ExplorerPatcher", L"UseImmersiveLauncher", 0, &fValue)) && fValue;
if (fUseImmersiveLauncher)
{
eptf |= EPTF_WinBlueLauncher;
}
return eptf;
}
HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const WCHAR* pszTaskbarDll) HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const WCHAR* pszTaskbarDll)
{ {
if (bOldTaskbar == 1 || !symbols_PTRS || !pszTaskbarDll) if (!symbols_PTRS || !pszTaskbarDll)
{
return NULL;
}
EP_TASKBAR_FEATURES eptf = GetEPTaskbarFeatures();
if (eptf == EPTF_None)
{ {
return NULL; return NULL;
} }
@ -9944,7 +9983,8 @@ HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, szPath); SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, szPath);
wcscat_s(szPath, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\"); wcscat_s(szPath, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\");
wcscat_s(szPath, MAX_PATH, pszTaskbarDll); wcscat_s(szPath, MAX_PATH, pszTaskbarDll);
HMODULE hMyTaskbar = bOldTaskbar >= 2 ? LoadLibraryW(szPath) : LoadLibraryExW(szPath, NULL, LOAD_LIBRARY_AS_DATAFILE); BOOL bFullLoad = (eptf & EPTF_FullLoad) != 0;
HMODULE hMyTaskbar = bFullLoad ? LoadLibraryW(szPath) : LoadLibraryExW(szPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (!hMyTaskbar) if (!hMyTaskbar)
{ {
wprintf(L"[TB] '%s' not found\n", pszTaskbarDll); wprintf(L"[TB] '%s' not found\n", pszTaskbarDll);
@ -9952,9 +9992,9 @@ HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const
} }
g_hMyTaskbar = hMyTaskbar; g_hMyTaskbar = hMyTaskbar;
if (!bOldTaskbar) if (!bFullLoad)
{ {
return NULL; return NULL; // Prevent IAT hooks from being carried out
} }
typedef DWORD (*GetVersion_t)(); typedef DWORD (*GetVersion_t)();
@ -9967,24 +10007,44 @@ HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const
return NULL; return NULL;
} }
TrayUI_CreateInstance_t pfnMyTrayUICreateInstance = (TrayUI_CreateInstance_t)GetProcAddress(hMyTaskbar, "EP_TrayUI_CreateInstance"); if ((eptf & EPTF_Taskbar) != 0)
if (IsWindows11())
{
explorer_TrayUI_CreateInstanceFunc = pfnMyTrayUICreateInstance;
}
else if (explorer_TrayUI_CreateInstanceFunc)
{ {
funchook_prepare( TrayUI_CreateInstance_t pfnMyTrayUICreateInstance = (TrayUI_CreateInstance_t)GetProcAddress(hMyTaskbar, "EP_TrayUI_CreateInstance");
funchook, if (pfnMyTrayUICreateInstance)
(void**)&explorer_TrayUI_CreateInstanceFunc, {
pfnMyTrayUICreateInstance if (IsWindows11())
); {
explorer_TrayUI_CreateInstanceFunc = pfnMyTrayUICreateInstance;
}
else if (explorer_TrayUI_CreateInstanceFunc)
{
funchook_prepare(
funchook,
(void**)&explorer_TrayUI_CreateInstanceFunc,
pfnMyTrayUICreateInstance
);
}
else
{
printf("[TB] Failed to hook TrayUI_CreateInstance()\n");
FreeLibrary(hMyTaskbar);
return NULL;
}
}
} }
else
if ((eptf & EPTF_WinBlueLauncher) != 0)
{ {
printf("[TB] Failed to hook TrayUI_CreateInstance()\n"); typedef HRESULT (WINAPI *EP_Launcher_PatchTwinUIPCShell_t)();
FreeLibrary(hMyTaskbar); EP_Launcher_PatchTwinUIPCShell_t pfnEP_Launcher_PatchTwinUIPCShell = (EP_Launcher_PatchTwinUIPCShell_t)GetProcAddress(hMyTaskbar, "EP_Launcher_PatchTwinUIPCShell");
return NULL; if (pfnEP_Launcher_PatchTwinUIPCShell)
{
HRESULT hr = pfnEP_Launcher_PatchTwinUIPCShell();
if (FAILED(hr))
{
printf("[TB] Failed to perform immersive shell component patches\n");
}
}
} }
typedef void (*CopyExplorerSymbols_t)(symbols_addr* symbols); typedef void (*CopyExplorerSymbols_t)(symbols_addr* symbols);

2
ep_setup/ep_setup.c

@ -13,7 +13,7 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#ifdef WITH_ENCRYPTION #ifdef WITH_ENCRYPTION
#include "rijndael-alg-fst.c" // Include the C file for __forceinline to work #include "rijndael-alg-fst.c" // Include the C file for __forceinline to work
#endif #endif
#pragma comment(lib, "zlibstatic.lib") #pragma comment(lib, "zs.lib")
static UINT g_uFailureLine; static UINT g_uFailureLine;

2
libs/sws

@ -1 +1 @@
Subproject commit eea1e2a94c5c22c016c0cae8c0f7cfa8d48a121d Subproject commit 23fd4e6964b4cc78b99df825a08b252f0c0b3e57

2
libs/zlib

@ -1 +1 @@
Subproject commit ceadaf28dfa48dbf238a0ddb884d4c543b4170e8 Subproject commit 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71
Loading…
Cancel
Save