While debugging League of Legends I noticed that `LoadLibraryEx()` is invoked with binary filename (non-text) and non-NULL `hFile`.
In Windows such call would return `NULL` with LastError set as `ERROR_INVALID_PARAMETER` but current Wine implementation would try to proceed ahead.
I don't know if this is intentional trick to mess up debugging/reversing tools or if we have some memory corruption before that overwrites filename buffer. But then I can't imagine how `hFile` could have gotten corrupted since shouldn't that be simple static value in register...
Having this MR causes very noticeable difference in LoL:
* without it - process deadlocks
* with it - no deadlock
Also while looking at this, I tried a lot of different flag combinations on Windows 10 and here I implemented so it works exactly like that.
I also implemented test case for non-NULL `hFile` but I didn't bother for other flags since I don't know if we even care about those.
--
v2: kernelbase: LoadLibraryEx validate flags like Win10
kernelbase: LoadLibraryEx support LOAD_PACKAGED_LIBRARY
kernelbase: LoadLibraryEx enforce valid flag combinations
kernelbase: Add test case for LoadLibraryEx() when hFile is non-NULL
https://gitlab.winehq.org/wine/wine/-/merge_requests/4587
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v2: ntdll: Use public type for SystemSupportedProcessorArchitectures returned data.
include: Add missing enum to wdm.h.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4605
- Make it present some frames
- Make it check that the frames are from the new device, instead of checking TerminateDevice count; fixes https://bugs.winehq.org/show_bug.cgi?id=55649
- ~~Make it check for and avoid some absurd crash on Windows~~
~~I tried everything I could think of, but Windows absolutely refuses to present a frame after changing the D3D device, instead choosing to return various absurd errors (segfaults, deadlocks, out of memory, etc). I suspect the VMR9 is haunted.~~
edit: Works on Windows now
--
v10: quartz/tests: Improve VMR9 ChangeD3DDevice test.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3970