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

This commit is contained in:
Alexandre Julliard 2008-01-16 14:57:20 +01:00
parent 44b52b128c
commit 5b71d645f0
2 changed files with 9 additions and 8 deletions

View File

@ -2141,7 +2141,12 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
piosb->Information = 0; 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 ((status = CDROM_Open(fd, &dev)))
{ {
if (needs_close) close( fd ); if (needs_close) close( fd );
@ -2415,12 +2420,8 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
break; break;
default: default:
FIXME("Unsupported IOCTL %x (type=%x access=%x func=%x meth=%x)\n", if (needs_close) close( fd );
dwIoControlCode, dwIoControlCode >> 16, (dwIoControlCode >> 14) & 3, return STATUS_NOT_SUPPORTED;
(dwIoControlCode >> 2) & 0xFFF, dwIoControlCode & 3);
sz = 0;
status = STATUS_INVALID_PARAMETER;
break;
} }
if (needs_close) close( fd ); if (needs_close) close( fd );
error: error:

View File

@ -1104,7 +1104,7 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
break; 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, status = server_ioctl_file( handle, event, apc, apc_context, io, code,
in_buffer, in_size, out_buffer, out_size ); in_buffer, in_size, out_buffer, out_size );