Skip to content

Commit dcbc7c9

Browse files
committed
Update DLL naming to codename scheme (rs2, ni, ge)
- Fix dll_name setting (was reading nonexistent "pinned_version") - Map numeric versions to codenames: - 0 -> rs2 (Windows 10) - 2 -> ni (Windows 11 22H2/23H2, builds 22621-22635 and 23403-23620) - 5 -> ge (Windows 11 24H2+) - Correct build ranges per EP wiki: - ni: 23403-23620 (not 25197) - .3 request-only: 25115-25915 (not 25201) - Return std::nullopt on failure instead of empty string - Fix memory leak: move install_path allocation after PickTaskbarDll() check - Update settings description and README for codename filenames - Add UBR limitation comment for 22621 < .1343
1 parent d21345b commit dcbc7c9

2 files changed

Lines changed: 45 additions & 40 deletions

File tree

--ep-taskbar-loader.wh.cpp

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
/*
1616
- install_path: "C:\\Program Files\\ep_taskbar"
1717
$name: ep_taskbar install path
18-
$description: "This folder should contain `ep_taskbar.X.dll`, corresponding
19-
to your Windows version, requires a restart"
18+
$description: "Folder containing ep_taskbar DLLs (rs2/ni/ge) from ep_taskbar_releases, requires restart"
2019
- dll_name: ""
2120
$name: DLL Name
2221
$description: "ONLY FOR DEBUG: Pin a specific DLL, requires a restart"
@@ -293,67 +292,73 @@ inline const std::optional<std::wstring> PickTaskbarDll() {
293292
ZeroMemory(&info, sizeof(info));
294293
info.dwOSVersionInfoSize = sizeof(info);
295294

296-
HMODULE ntos = LoadLibraryW(L"ntdll.dll");
297-
RtlGetVersion_t RtlGetVersion;
298-
RtlGetVersion = (RtlGetVersion_t)GetProcAddress(ntos, "RtlGetVersion");
295+
HMODULE ntos = GetModuleHandleW(L"ntdll.dll");
296+
RtlGetVersion_t RtlGetVersion =
297+
(RtlGetVersion_t)GetProcAddress(ntos, "RtlGetVersion");
299298

300299
if (RtlGetVersion == NULL) {
301300
Wh_Log(L"RtlGetVersion was not found");
302-
return std::wstring();
301+
return std::nullopt;
303302
}
304-
RtlGetVersion((OSVERSIONINFOW *)&info);
305303

304+
RtlGetVersion((OSVERSIONINFOW *)&info);
306305
DWORD b = info.dwBuildNumber;
307306

308-
PCWSTR res = Wh_GetStringSetting(L"pinned_version");
307+
// Fix: settings block defines "dll_name", not "pinned_version"
308+
PCWSTR res = Wh_GetStringSetting(L"dll_name");
309309
if (wcslen(res) > 0) {
310310
std::wstring pinned = res;
311311
Wh_FreeStringSetting(res);
312+
Wh_Log(L"Using pinned DLL: %s", pinned.c_str());
312313
return pinned;
313314
}
314315
Wh_FreeStringSetting(res);
315316

316-
if (b == 15063 // Windows 10 1703
317-
|| b == 16299 // Windows 10 1709
318-
|| b == 17134 // Windows 10 1803
319-
|| b == 17763 // Windows 10 1809
320-
|| (b >= 18362 && b <= 18363) // Windows 10 1903, 1909
321-
|| (b >= 19041 && b <= 19045)) // Windows 10 20H2, 21H2, 22H2
322-
{
323-
return L"ep_taskbar.0." ARCH_STR ".dll";
317+
// Windows 10 1703-22H2: public rs2 DLL
318+
if (b == 15063 || // Windows 10 1703
319+
b == 16299 || // Windows 10 1709
320+
b == 17134 || // Windows 10 1803
321+
b == 17763 || // Windows 10 1809
322+
(b >= 18362 && b <= 18363) || // Windows 10 1903, 1909
323+
(b >= 19041 && b <= 19045)) { // Windows 10 20H2, 21H2, 22H2
324+
return L"ep_taskbar.rs2." ARCH_STR ".dll";
324325
}
325326

326-
if (b >= 21343 && b <= 22000) // Windows 11 21H2
327-
{
328-
return L"ep_taskbar.1." ARCH_STR ".dll";
327+
// Windows 11 21H2: needs ep_taskbar.1, no public equivalent
328+
if (b >= 21343 && b <= 22000) {
329+
Wh_Log(L"Build %lu requires ep_taskbar.1 (request-only, no public equivalent). "
330+
L"Pin a DLL manually via dll_name setting.", b);
331+
return std::nullopt;
329332
}
330333

331-
if ((b >= 22621 && b <= 22635) // 22H2-23H2 Release, Release Preview, and Beta channels
332-
|| (b >= 23403 && b <= 25197)) // Early pre-reboot Dev channel until
333-
// post-reboot Dev channel
334-
{
335-
return L"ep_taskbar.2." ARCH_STR ".dll";
334+
// Windows 11 22H2/23H2 Nickel-era: public ni DLL
335+
// Note: 22621 < .1343 is not supported per wiki, but we cannot check UBR here
336+
if ((b >= 22621 && b <= 22635) || // 22H2-23H2 Release, Release Preview, Beta
337+
(b >= 23403 && b <= 23620)) { // Dev channel through 23620
338+
return L"ep_taskbar.ni." ARCH_STR ".dll";
336339
}
337340

338-
if (b >= 25201 && b <= 25915) // Pre-reboot Dev channel until early Canary
339-
// channel, nuked ITrayComponentHost methods
340-
// related to classic search box
341-
{
342-
return L"ep_taskbar.3." ARCH_STR ".dll";
341+
// Dev 25115-25915: needs ep_taskbar.3, no public equivalent
342+
if (b >= 25115 && b <= 25915) {
343+
Wh_Log(L"Build %lu requires ep_taskbar.3 (request-only, no public equivalent). "
344+
L"Pin a DLL manually via dll_name setting.", b);
345+
return std::nullopt;
343346
}
344347

345-
if (b >= 25921 && b <= 26040) // Canary channel with nuked classic system tray
346-
{
347-
return L"ep_taskbar.4." ARCH_STR ".dll";
348+
// Canary 25921-26040: needs ep_taskbar.4, no public equivalent
349+
if (b >= 25921 && b <= 26040) {
350+
Wh_Log(L"Build %lu requires ep_taskbar.4 (request-only, no public equivalent). "
351+
L"Pin a DLL manually via dll_name setting.", b);
352+
return std::nullopt;
348353
}
349354

350-
if (b >= 26052) // Same as 4 but with 2 new methods in ITrayComponentHost
351-
// between GetTrayUI and ProgrammableTaskbarReportClick
352-
{
353-
return L"ep_taskbar.5." ARCH_STR ".dll";
355+
// Windows 11 24H2+ Germanium-era: public ge DLL
356+
if (b >= 26052) {
357+
return L"ep_taskbar.ge." ARCH_STR ".dll";
354358
}
355359

356-
return L""; // Empty = failure
360+
Wh_Log(L"Unsupported build for ep_taskbar: %lu", b);
361+
return std::nullopt;
357362
}
358363

359364
BOOL FileExists(LPCTSTR szPath) {
@@ -373,11 +378,11 @@ BOOL Wh_ModInit() {
373378
return TRUE;
374379
}
375380

376-
PCWSTR installPath = Wh_GetStringSetting(L"install_path");
377381
std::optional<std::wstring> dllVer = PickTaskbarDll();
378-
// We didn't detect a compatible version, exit
379382
if (!dllVer)
380383
return FALSE;
384+
385+
PCWSTR installPath = Wh_GetStringSetting(L"install_path");
381386
std::wstring finalInstallPath = installPath;
382387
Wh_FreeStringSetting(installPath);
383388
if (finalInstallPath.length() == 0) {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Installation
99

10-
- Grab a copy of `ep_taskbar` for your Windows version from <https://github.com/ExplorerPatcher/ep_taskbar_releases/releases>, and place it in `C:\Program Files\ep_taskbar`, you should get both the `.dll` and `.pdb`. If you are unsure of what version to get, just get all available versions
10+
- Grab the `ep_taskbar` DLL for your Windows version from <https://github.com/ExplorerPatcher/ep_taskbar_releases/releases> and place it in `C:\Program Files\ep_taskbar`. Current releases use codename filenames: `ep_taskbar.rs2` (Win10), `ep_taskbar.ni` (Win11 22H2/23H2), `ep_taskbar.ge` (Win11 24H2+)
1111
- Download the mod from <https://github.com/Reabstraction/ep_taskbar_loader/releases>
1212
- Create a new mod in WindHawk, and copy over the contents of the `.wh.cpp` file into it
1313
- Compile and enable the mod, it should automatically restart explorer. If it gets stuck restarting or pops up a messagebox, disable the mod and send the logs

0 commit comments

Comments
 (0)