diff options
Diffstat (limited to 'includes/cdabstract.h')
-rw-r--r-- | includes/cdabstract.h | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/includes/cdabstract.h b/includes/cdabstract.h index 9a728ec..a5dcd0e 100644 --- a/includes/cdabstract.h +++ b/includes/cdabstract.h @@ -1,65 +1,65 @@ -/* - * PSX-Tools Bundle Pack - * Copyright (C) 2002-2003 Nicolas "Pixel" Noble - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* $Id: cdabstract.h,v 1.5 2003-12-11 16:53:42 pixel Exp $ */ - -#ifndef __CD_ABSTRACT_H__ -#define __CD_ABSTRACT_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> - -class cdabstract : public Base { - public: - static Handle * open_cd(const String &); - static bool canprobe(); - static std::vector<String> probe() throw (GeneralException); -#ifdef _WIN32 - 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 +/*
+ * PSX-Tools Bundle Pack
+ * Copyright (C) 2002-2003 Nicolas "Pixel" Noble
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* $Id: cdabstract.h,v 1.6 2004-11-27 21:44:46 pixel Exp $ */
+
+#ifndef __CD_ABSTRACT_H__
+#define __CD_ABSTRACT_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>
+
+class cdabstract : public Base {
+ public:
+ static Handle * open_cd(const String &);
+ static bool canprobe();
+ static std::vector<String> probe() throw (GeneralException);
+#ifdef _WIN32
+ 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
|