Alexandre Julliard : ntdll: Fall back to a server device ioctl for files with no associated fd.

Alexandre Julliard julliard at winehq.org
Wed Jan 16 13:19:34 CST 2008


Module: wine
Branch: master
Commit: 5b71d645f05d9728ab28c8f3be5709a5fd5365f1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5b71d645f05d9728ab28c8f3be5709a5fd5365f1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jan 16 14:57:20 2008 +0100

ntdll: Fall back to a server device ioctl for files with no associated fd.

---

 dlls/ntdll/cdrom.c |   15 ++++++++-------
 dlls/ntdll/file.c  |    2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index 56a138e..9da442c 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -2141,7 +2141,12 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
 
     piosb->Information = 0;
 
-    if ((status = server_get_unix_fd( hDevice, 0, &fd, &needs_close, NULL, NULL ))) goto error;
+    if ((status = server_get_unix_fd( hDevice, 0, &fd, &needs_close, NULL, NULL )))
+    {
+        if (status == STATUS_BAD_DEVICE_TYPE) return status;  /* no associated fd */
+        goto error;
+    }
+
     if ((status = CDROM_Open(fd, &dev)))
     {
         if (needs_close) close( fd );
@@ -2415,12 +2420,8 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
         break;
 
     default:
-        FIXME("Unsupported IOCTL %x (type=%x access=%x func=%x meth=%x)\n", 
-              dwIoControlCode, dwIoControlCode >> 16, (dwIoControlCode >> 14) & 3,
-              (dwIoControlCode >> 2) & 0xFFF, dwIoControlCode & 3);
-        sz = 0;
-        status = STATUS_INVALID_PARAMETER;
-        break;
+        if (needs_close) close( fd );
+        return STATUS_NOT_SUPPORTED;
     }
     if (needs_close) close( fd );
  error:
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index d4e80ab..5a99616 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1104,7 +1104,7 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
         break;
     }
 
-    if (status == STATUS_NOT_SUPPORTED)
+    if (status == STATUS_NOT_SUPPORTED || status == STATUS_BAD_DEVICE_TYPE)
         status = server_ioctl_file( handle, event, apc, apc_context, io, code,
                                     in_buffer, in_size, out_buffer, out_size );
 




More information about the wine-cvs mailing list