https://bugs.winehq.org/show_bug.cgi?id=48410
Bug ID: 48410 Summary: The "Add syscall thunks for 64 bit" patch partly breaks USVFS Product: Wine-staging Version: 5.0-rc3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: qsniyg@mail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
This is the patch that breaks USVFS: https://github.com/wine-staging/wine-staging/blob/d36d63ac848dadbc2c8ffc933f... (discussion: https://github.com/ModOrganizer2/modorganizer/issues/372). I've only tested 64-bit, so it's possible https://github.com/wine-staging/wine-staging/blob/master/patches/winebuild-F... also affects it.
Although USVFS works for the most part, loading DLLs fails, because LdrLoadDll (within ntdll) calls NtOpenFile (through open_dll_file), but for some reason, USVFS doesn't recognize that specific NtOpenFile call (even though it hooks other NtOpenFile calls that aren't called from ntdll without issue).
I haven't looked through the patch in much detail, but from what I can tell I believe the reason why this patch breaks USVFS is because the calls to NtOpenFile from within ntdll use the direct function address, whereas with the patch, USVFS now hooks a new "wrapper" around the function, instead of the same address that ntdll calls internally.