Added the implementation for CDROM_GetIdeInterface on NetBSD.

diff --git a/configure b/configure
index 5755c62..4beb745 100755
--- a/configure
+++ b/configure
@@ -13238,6 +13238,7 @@
 
 
 
+
 for ac_header in \
 	arpa/inet.h \
 	arpa/nameser.h \
@@ -13289,6 +13290,7 @@
 	sys/poll.h \
 	sys/ptrace.h \
 	sys/reg.h \
+	sys/scsiio.h \
 	sys/shm.h \
 	sys/signal.h \
 	sys/socket.h \
diff --git a/configure.ac b/configure.ac
index 80f7438..43b1fa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1007,6 +1007,7 @@
 	sys/poll.h \
 	sys/ptrace.h \
 	sys/reg.h \
+	sys/scsiio.h \
 	sys/shm.h \
 	sys/signal.h \
 	sys/socket.h \
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index 6d4f7b3..a542aa5 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -60,6 +60,9 @@
 #ifdef HAVE_SYS_CDIO_H
 # include <sys/cdio.h>
 #endif
+#ifdef HAVE_SYS_SCSIIO_H
+# include <sys/scsiio.h>
+#endif
 
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
@@ -379,7 +382,24 @@
         *device = (minor(st.st_rdev) == 63 ? 1 : 0);
         return 1;
     }
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__NetBSD__)
+    {
+       struct scsi_addr addr;
+       if (ioctl(fd, SCIOCIDENTIFY, &addr) != -1) {
+            switch (addr.type) {
+                /* for SCSI copy linux case, i.e. start at *iface = 11 */
+                case TYPE_SCSI:  *iface = 11 + addr.addr.scsi.scbus;
+                                 *device = addr.addr.scsi.target;
+                                 break;
+                case TYPE_ATAPI: *iface = addr.addr.atapi.atbus;
+                                 *device = addr.addr.atapi.drive;
+                                 break;
+            }
+            return 1;
+       }
+       return 0;
+    }
+#elif defined(__FreeBSD__)
     FIXME("not implemented for BSD\n");
     return 0;
 #else
diff --git a/include/config.h.in b/include/config.h.in
index 6fadc14..5eff5ab 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -560,6 +560,9 @@
 /* Define to 1 if you have the <sys/reg.h> header file. */
 #undef HAVE_SYS_REG_H
 
+/* Define to 1 if you have the <sys/scsiio.h> header file. */
+#undef HAVE_SYS_SCSIIO_H
+
 /* Define to 1 if you have the <sys/shm.h> header file. */
 #undef HAVE_SYS_SHM_H