Zebediah Figura : ntdll: Add a fast path for NtDeviceIoControlFile(INVALID_HANDLE_VALUE).
Module: wine Branch: oldstable Commit: bdc1b882cbd08703720b1ecd91e280834f282c6e URL: https://gitlab.winehq.org/wine/wine/-/commit/bdc1b882cbd08703720b1ecd91e2808... 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 (cherry picked from commit d0f34c232abb07c0e679d92917254c2f05b001c1) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- 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 a29b5cbb980..da2119b28d3 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -5707,6 +5707,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