summaryrefslogtreecommitdiff
path: root/includes/cdabstract.h
diff options
context:
space:
mode:
authorpixel <pixel>2003-10-12 05:15:00 +0000
committerpixel <pixel>2003-10-12 05:15:00 +0000
commit7787631c6ee37a489732c95cb0864422e3a3bdd1 (patch)
tree4f6374a3dcc58661ea7b116e2b87cdf84e14e414 /includes/cdabstract.h
parent7cf5187c0a8cedba390a5455b63ed4ecf867be32 (diff)
AT LAST!!!
Windows 2k/XP CD reading works using raw ioctls!!!! HURRAY!!!!!!!!
Diffstat (limited to 'includes/cdabstract.h')
-rw-r--r--includes/cdabstract.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/includes/cdabstract.h b/includes/cdabstract.h
index 66aa909..60061d4 100644
--- a/includes/cdabstract.h
+++ b/includes/cdabstract.h
@@ -1,8 +1,44 @@
#ifndef __CD_ABSTRACT_H__
#define __CD_ABSTRACT_H__
-#include "Handle.h"
+#if defined (_MSC_VER) || defined (__MINGW32__)
+#include <windowsx.h>
+
+#define IOCTL_SCSI_BASE 0x00000004
+
+#define METHOD_BUFFERED 0
+#define METHOD_OUT_DIRECT 2
+
+#define FILE_ANY_ACCESS 0
+#define FILE_READ_ACCESS 0x0001
+
+#define CTL_CODE( DevType, Function, Method, Access ) ( \
+ ((DevType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
+)
+#define IOCTL_SCSI_GET_ADDRESS CTL_CODE( IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS )
+#define FILE_DEVICE_CD_ROM 0x00000002
+#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
+#define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
+
+#endif
+
+#include <vector>
+#include <Exceptions.h>
+#include <Handle.h>
-Handle * open_iso(const String &);
+class cdabstract : public Base {
+ public:
+ static Handle * open_cd(const String &);
+ static bool canprobe();
+ static std::vector<String> probe() throw (GeneralException);
+#if defined (_MSC_VER) || defined (__MINGW32__)
+ protected:
+ static HANDLE OpenIOCTLFile(char cLetter);
+ static void GetIOCTLAdapter(HANDLE hF, int * iDA, int * iDT, int * iDL);
+#endif
+ private:
+ static bool subprobe(String &);
+ friend class cdreader;
+};
#endif