Zebediah Figura : ntdll: Add a fast path for NtDeviceIoControlFile(INVALID_HANDLE_VALUE).
Module: wine Branch: master Commit: d0f34c232abb07c0e679d92917254c2f05b001c1 URL: https://gitlab.winehq.org/wine/wine/-/commit/d0f34c232abb07c0e679d92917254c2... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Sep 19 23:31:43 2022 -0500 ntdll: Add a fast path for NtDeviceIoControlFile(INVALID_HANDLE_VALUE). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53706 --- dlls/ntdll/unix/file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index b31ce4fbb3d..7eb8dbe7ad4 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -5760,6 +5760,11 @@ NTSTATUS WINAPI NtDeviceIoControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUT TRACE( "(%p,%p,%p,%p,%p,0x%08x,%p,0x%08x,%p,0x%08x)\n", handle, event, apc, apc_context, io, code, in_buffer, in_size, out_buffer, out_size ); + /* some broken applications call this frequently with INVALID_HANDLE_VALUE, + * and run slowly if we make a server call every time */ + if (HandleToLong( handle ) == ~0) + return STATUS_INVALID_HANDLE; + switch (device) { case FILE_DEVICE_BEEP:
participants (1)
-
Alexandre Julliard