[Bug 46697] New: ntQueryDirectoryFileEx needed
https://bugs.winehq.org/show_bug.cgi?id=46697 Bug ID: 46697 Summary: ntQueryDirectoryFileEx needed Product: Wine Version: 4.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: ntdll Assignee: wine-bugs(a)winehq.org Reporter: springrat(a)protonmail.com Distribution: --- Mod Organizer 2 fails to load the userspace virtual file system (USVFS) .dll due to a lack of the function, "ntQueryDirectoryFileEx" in ntdll.dll. As a result, the program itself cannot be used for its intended purposes of organizing and loading mods directly, and some critical features such as using tools within the virtual environment break. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Lydia <springrat(a)protonmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |ArchLinux -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Louis Lenders <xerox.xerox2000x(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox.xerox2000x(a)gmail.com --- Comment #1 from Louis Lenders <xerox.xerox2000x(a)gmail.com> --- Created attachment 63690 --> https://bugs.winehq.org/attachment.cgi?id=63690 stub for NtQueryDirectoryFileEx This seems to be brand new api, only present in win10 (newer versions). Maybe you could get away with the attached patch, could you try if it helps anything? Also, what windowsversion have you set in winecfg? Does changing it help anything? Thanks in advance for reporting back -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Louis Lenders <xerox.xerox2000x(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ntQueryDirectoryFileEx |NtQueryDirectoryFileEx |needed |needed by Mod Organizer 2. Keywords| |source Severity|major |normal URL| |https://github.com/ModOrgan | |izer2/usvfs --- Comment #2 from Louis Lenders <xerox.xerox2000x(a)gmail.com> --- Change title. Also the source can be found apparently in url i added above -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 cetedus(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cetedus(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 pattietreutel <katyaberezyaka(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katyaberezyaka(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Jacob Hrbek <werifGX(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |werifGX(a)gmail.com --- Comment #3 from Jacob Hrbek <werifGX(a)gmail.com> --- I'm getting errors: https://user-images.githubusercontent.com/11302521/58620121-9b2c0680-82c6-11... https://user-images.githubusercontent.com/11302521/58620039-6c159500-82c6-11... as refferenced on https://github.com/PhoenicisOrg/scripts/issues/955 Can you confirm that this is affected by WineBug #46697 ? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 qsniyg <qsniyg(a)mail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |qsniyg(a)mail.com --- Comment #4 from qsniyg <qsniyg(a)mail.com> --- Created attachment 65236 --> https://bugs.winehq.org/attachment.cgi?id=65236 USVFS patch This patch allows USVFS to run under my system -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 petteyg359(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |petteyg359(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 traverseda <traverse.da(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |traverse.da(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Jarrard Lo <overlord.jarrard(a)tutamail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |overlord.jarrard(a)tutamail.c | |om --- Comment #5 from Jarrard Lo <overlord.jarrard(a)tutamail.com> --- It seems the USVFS system is broken again in latest wines. It works in 4.21 (doesn't load DLL's however), and maybe a few versions above that but doesn't work in 5.7.5 which I've tested. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #6 from Jarrard Lo <overlord.jarrard(a)tutamail.com> --- lutris-fshack-5.0-x86_64 which is based off wine5.0 works great. USVFS FULLY works. I guess its a matter of finding exactly which wine version broke USVFS compatibility. It should also be noted that 5.0 appears to load the game real fast, no mod prefetch delay on the fallout4.exe, so that's interesting. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 joaopa <jeremielapuree(a)yahoo.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree(a)yahoo.fr --- Comment #7 from joaopa <jeremielapuree(a)yahoo.fr> --- Lutris is not supported in this bugzilla. Please plain wine (wine-5.12 is the current one). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #8 from Jarrard Lo <overlord.jarrard(a)tutamail.com> --- (In reply to joaopa from comment #7)
Lutris is not supported in this bugzilla. Please plain wine (wine-5.12 is the current one).
I tested on Wine 5.9 on my system as well, same result. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #9 from Jarrard Lo <overlord.jarrard(a)tutamail.com> --- Also proton builds -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Anya <animegirl(a)stronzi.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |animegirl(a)stronzi.org -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 rtentser(a)yandex.ru changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rtentser(a)yandex.ru -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #10 from Nikolay Sivov <bunglehead(a)gmail.com> --- What's the status of this? If NtQueryDirectoryFileEx() is really needed it's easy to add and use it for NtQueryDirectoryFile(), but does that solve the problem? If this library intercepts calls to NtQueryDirectoryFileEx() maybe we'll also have to use where we now we're using NtQueryDirectoryFile(). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #11 from qsniyg <qsniyg(a)mail.com> --- (In reply to Nikolay Sivov from comment #10)
What's the status of this? If NtQueryDirectoryFileEx() is really needed it's easy to add and use it for NtQueryDirectoryFile(), but does that solve the problem? If this library intercepts calls to NtQueryDirectoryFileEx() maybe we'll also have to use where we now we're using NtQueryDirectoryFile().
It's not needed, unless something in USVFS changed recently (and according to a quick look at the commit log, no). It was a red herring from the beginning, as USVFS prints an error, but will work just fine without it (NtQueryDirectoryFileEx is only implemented on later versions of Windows 10, but USVFS works on Windows 7 as well). There are apparently some issues with USVFS and later versions of wine (haven't had the chance to test lately, it _could_ be due to wine calling the functions directly, rather than the syscall thunks - as was the case with wine-staging before 5.0), but it's almost certainly not due to NtQueryDirectoryFileEx. Earlier versions of wine (4.21+) worked fine, as both of of the patches needed to get it working got upstreamed (an earlier version of the patches are linked in #4). That being said, as you said, they had to add that function because NtQueryDirectoryFileEx was being called instead of NtQueryDirectoryFile in later versions of Windows 10. So if wine wants to emulate the later versions of windows 10, this can be done. However, it's not necessary to get USVFS working. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #12 from qsniyg <qsniyg(a)mail.com> --- (In reply to qsniyg from comment #11)
it _could_ be due to wine calling the functions directly, rather than the syscall thunks
Just to clarify: I don't know if this is actually what wine does, it's just a guess for the possible reason, without having checked the code in too much detail yet. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 knight00819(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |knight00819(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Anastasius Focht <focht(a)gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download CC| |focht(a)gmx.net Ever confirmed|0 |1 URL|https://github.com/ModOrgan |https://web.archive.org/202 |izer2/usvfs |10201214656/https://github. | |com/ModOrganizer2/modorgani | |zer/releases/download/v2.2. | |0/Mod.Organizer-2.2.0.0.exe Status|UNCONFIRMED |NEW Summary|NtQueryDirectoryFileEx |USVFS (User Space Virtual |needed by Mod Organizer 2. |File System), part of Mod | |Organizer 2 v2.1.1+ wants | |'ntdll.NtQueryDirectoryFile | |Ex' (Windows 10 build 1709+ | |syscall) --- Comment #13 from Anastasius Focht <focht(a)gmx.net> --- Hello folks, adding stable download link via Internet Archive: https://web.archive.org/20210201214656/https://github.com/ModOrganizer2/modo... Based on MO2 version information in https://github.com/PhoenicisOrg/scripts/issues/955 which references this bug. Checking all binaries in the WINEPREFIX after installation: --- snip --- $ grep -ralZ NtQueryDirectoryFileEx .wine/drive_c | \ xargs -r0i bash -c "echo \"{}\" && winedump -j import \"{}\" | \ grep NtQueryDirectoryFileEx" .wine/drive_c/Modding/MO2/usvfs_x64.dll .wine/drive_c/Modding/MO2/usvfs_proxy_x64.exe .wine/drive_c/Modding/MO2/usvfs_proxy_x86.exe .wine/drive_c/Modding/MO2/usvfs_x86.dll --- snip ---
From the USVFS project:
https://github.com/ModOrganizer2/usvfs Locating 'NtQueryDirectoryFileEx' references in source code: https://github.com/ModOrganizer2/usvfs/search?q=NtQueryDirectoryFileEx https://github.com/ModOrganizer2/usvfs/blob/0a115a1d46703ee7959d382cef24b4c8... https://github.com/ModOrganizer2/usvfs/blob/0a115a1d46703ee7959d382cef24b4c8... It's as qsniyg said: this native API function is not essential for MO2 to work. Failure to install a hook for this function is not critical. It would be only important iff Wine core dlls would call out to 'NtQueryDirectoryFileEx' instead of 'NtQueryDirectoryFile' (dlls/kernelbase/file.c, dlls/ntdll/actctx.c). Information on 'NtQueryDirectoryFileEx': https://github.com/processhacker/phnt/pull/8 Which refers to: --- quote --- def https://docs.microsoft.com/en-us/previous-versions/mt812582(v%3dvs.85) Windows_versions: https://github.com/j00ru/windows-syscalls/blob/0c48cd8f365899157f5d08ca04eb5... --- quote --- The syscall was added starting with Windows 10 build 1709. Summarizing: Adding / implementing 'ntdll.NtQueryDirectoryFileEx' alone doesn't make much sense unless your only goal is to silence the warn/error message from the hooker. Functionally it won't do anything since no callouts are being made from Wine code. It would make sense iff Wine changes all 'NtQueryDirectoryFile' calls to 'NtQueryDirectoryFileEx'. But that could end up being problematic if there are applications which *expect* 'NtQueryDirectoryFile' being called, such as various application virtualization / native API sandboxing schemes (Xenocode etc.). Calling 'NtQueryDirectoryFileEx' through 'NtQueryDirectoryFile' is not a good idea because both are being hooked and separate syscalls on Windows 10 (see windows-syscalls table from github project). $ sha1sum Mod.Organizer-2.2.0.0.exe d311b3124f7e2027b03acfd46875356c12fb4579 Mod.Organizer-2.2.0.0.exe $ du -sh Mod.Organizer-2.2.0.0.exe 75M Mod.Organizer-2.2.0.0.exe $ wine --version wine-6.1 Regards -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 Forest <forestix(a)sonic.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |forestix(a)sonic.net -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=46697 soredake <broaden_acid002(a)simplelogin.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|broaden_acid002(a)simplelogin | |.com | -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=46697 --- Comment #14 from zyfgs2012 <zyfgs2012@gmail.com> --- Additional affected configuration: ASTLIBRA Revision v1.4.1 startup failure in a DLL hooking the missing ZwQueryDirectoryFileEx export This is downstream compatibility evidence related to bug 46697, not a claim of a regression reproduced on stock upstream Wine. Environment - Android 16 / Snapdragon 8 Elite Gen 5 (ARM64) - DroidDeck 0.4.0, Linux runtime r9 - Proton Experimental ARM64: experimental-11.0-20261014-arm64 - Export absence also checked in DroidDeck-Proton 11-9.1 - An x86-64 Windows game directory labeled ASTLIBRA Revision v1.4.1. The supplied DLL is named steam_api64.dll; its provenance has not been independently verified. This report must not be interpreted as confirmation that an unmodified official Steam build has the same failure. Observed behavior Starting ASTLIBRA.exe from Steam produces a black screen / no visible game window. Two native ptrace captures show a null branch during initialization of the supplied steam_api64.dll. Export inspection Both installed Wine ntdll.dll images export NtQueryDirectoryFile and ZwQueryDirectoryFile, but neither exports NtQueryDirectoryFileEx nor ZwQueryDirectoryFileEx. Inspection of current upstream dlls/ntdll/ntdll.spec also finds the legacy exports but not the Ex variants. Call-chain evidence (RVAs relative to this specific steam_api64.dll) - +0x10E77 resolves "ZwQueryDirectoryFileEx" from "NTDLL". - +0x10E94 calls a hook-installation helper (+0x7A810) with the resolved target. - The missing export results in a null target being passed into a code-decoding / byte-reader path. - At +0x8C5B1, instruction bytes FF 11 (call qword ptr [rcx]) encounter a null callback; the captured slot [RCX] is zero. - The translated native instruction is BLR X11 with X11=0, followed by SIGSEGV at PC=0 / si_addr=0. This evidence alone does not establish a FEX translation bug. Local workaround used to establish the affected path The DLL already has a fallback to the old ZwQueryDirectoryFile hook if installation of the Ex hook reports failure. However, the hook helper crashes on the null target before it can return failure. For this exact DLL only, replacing the five-byte call at RVA +0x10E94 (E8 77 99 06 00) with xor eax,eax and three NOPs (31 C0 90 90 90) lets its existing legacy fallback execute. This is a local binary workaround, not a Wine source patch or an implementation of the Ex API. After that change, the same original Steam entry and Proton runtime initialize DXVK and display the opening sequence and title menu. A fresh normal launch with diagnostic environment overrides removed also succeeds. Long gameplay and full save/load coverage have not been verified. Original DLL SHA-256: 65259d162a4cb9a57abd214723db0555f1c5c8b65dda828f4a641e2083f70e6c Scope and request The DLL's missing null check is an application-side defect. The separate upstream compatibility gap is the missing Nt/ZwQueryDirectoryFileEx API. This case may be additional impact evidence for that gap, even though the application can fall back after correcting its error handling. The same game directory reportedly works on Windows; its exact Windows export/call path has not been captured. No stock desktop Wine reproduction or Wine source-level fix is claimed here. Would implementation and export of both API names belong under this existing issue? The local workaround and any historical stub patch should not be assumed to provide full API semantics. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (3)
-
wine-bugs@winehq.org -
WineHQ Bugzilla -
WineHQ Bugzilla