Skip to content

Commit c0dd98c

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) - 5 -> ge (Windows 11 24H2+) - Return std::nullopt on failure instead of empty string - Unsupported builds (1, 3, 4) now fail with log message
1 parent d21345b commit c0dd98c

1 file changed

Lines changed: 39 additions & 34 deletions

File tree

--ep-taskbar-loader.wh.cpp

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -294,66 +294,71 @@ inline const std::optional<std::wstring> PickTaskbarDll() {
294294
info.dwOSVersionInfoSize = sizeof(info);
295295

296296
HMODULE ntos = LoadLibraryW(L"ntdll.dll");
297-
RtlGetVersion_t RtlGetVersion;
298-
RtlGetVersion = (RtlGetVersion_t)GetProcAddress(ntos, "RtlGetVersion");
297+
RtlGetVersion_t RtlGetVersion =
298+
(RtlGetVersion_t)GetProcAddress(ntos, "RtlGetVersion");
299299

300300
if (RtlGetVersion == NULL) {
301301
Wh_Log(L"RtlGetVersion was not found");
302-
return std::wstring();
302+
return std::nullopt;
303303
}
304-
RtlGetVersion((OSVERSIONINFOW *)&info);
305304

305+
RtlGetVersion((OSVERSIONINFOW *)&info);
306306
DWORD b = info.dwBuildNumber;
307307

308-
PCWSTR res = Wh_GetStringSetting(L"pinned_version");
308+
// Fix: settings block defines "dll_name", not "pinned_version"
309+
PCWSTR res = Wh_GetStringSetting(L"dll_name");
309310
if (wcslen(res) > 0) {
310311
std::wstring pinned = res;
311312
Wh_FreeStringSetting(res);
313+
Wh_Log(L"Using pinned DLL: %s", pinned.c_str());
312314
return pinned;
313315
}
314316
Wh_FreeStringSetting(res);
315317

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

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

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";
335+
// Windows 11 22H2/23H2 Nickel-era: public ni DLL
336+
if ((b >= 22621 && b <= 22635) || // 22H2-23H2 Release, Release Preview, Beta
337+
(b >= 23403 && b <= 25197)) { // Early Dev channel
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 25201-25915: needs ep_taskbar.3, no public equivalent
342+
if (b >= 25201 && 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) {

0 commit comments

Comments
 (0)