[PATCH] ntdll: Implement CDROM_GetInterfaceInfo() on Mac OS.
Charles Davis
cdavis at mymail.mines.edu
Tue Mar 1 13:59:44 CST 2011
This version uses another IOCTL I devised and implemented in a kernel
driver. You'll need this driver for this to be available.
---
dlls/ntdll/cdrom.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index c51ef6b..2722998 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -103,7 +103,16 @@ typedef struct
uint64_t senseLen;
} dk_scsi_command_t;
+typedef struct
+{
+ uint64_t bus;
+ uint64_t port;
+ uint64_t target;
+ uint64_t lun;
+} dk_scsi_identify_t;
+
#define DKIOCSCSICOMMAND _IOWR('d', 253, dk_scsi_command_t)
+#define DKIOCSCSIIDENTIFY _IOR('d', 254, dk_scsi_identify_t)
#endif
@@ -630,6 +639,17 @@ static int CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* devi
}
}
return 0;
+#elif defined(__APPLE__)
+ dk_scsi_identify_t addr;
+ if (ioctl(fd, DKIOCSCSIIDENTIFY, &addr) != -1)
+ {
+ *port = addr.bus;
+ *iface = addr.port;
+ *device = addr.target;
+ *lun = addr.lun;
+ return 1;
+ }
+ return 0;
#else
FIXME("not implemented on this O/S\n");
return 0;
--
1.7.4.rc3
More information about the wine-patches
mailing list