Yep. I'm working on a rebase right now and I've already cleaned this up. I'm using tolower (i.e. ASCII-only, but I think that's OK) because this code runs very early, before we init the NLS data, so I think it will explode with towlower and RtlDowncaseUnicodeChar.
Edit: Actually reading the code, RtlDowncaseUnicodeChar may actually function before the NLS data is initted. Not sure.
RtlDowncaseUnicodeChar() does work before the NLS data is initialized, but I suggested tolower() instead since I don't think we want to be locale-sensitive here.
I think this is fixed in 5.13.
Nothing extracted yet.
This is the normal version used throughout loader.c which was added for the steamclient swap:
https://github.com/ValveSoftware/wine/blob/2409bd1f74be116172688a25df725290637c255a/dlls/ntdll/loader.c#L1618
And this second one was added specifically for the AoE3 game check:
https://github.com/ValveSoftware/wine/blob/2409bd1f74be116172688a25df725290637c255a/dlls/ntdll/loader.c#L206
It's the exact same function with a different name.
Used specifically for:
https://github.com/ValveSoftware/wine/blob/2409bd1f74be116172688a25df725290637c255a/dlls/ntdll/loader.c#L3205
So you can remove the duplicate function and change strcasestrW on that line to strstriW
Also for future proofing, you can use RtlDowncaseUnicodeChar in the function instead of tolowerW: