wnaspi32: Make winaspi.dll into a stand-alone 16-bit module.
authorAlexandre Julliard <julliard@winehq.org>
Mon, 23 Mar 2009 19:33:34 +0000 (20:33 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 23 Mar 2009 19:33:34 +0000 (20:33 +0100)
.gitignore
configure
configure.ac
dlls/Makefile.in
dlls/winaspi.dll16/Makefile.in [new file with mode: 0644]
dlls/winaspi.dll16/aspi.h [new file with mode: 0644]
dlls/winaspi.dll16/winaspi.c [moved from dlls/wnaspi32/winaspi16.c with 90% similarity]
dlls/winaspi.dll16/winaspi.dll16.spec [moved from dlls/wnaspi32/winaspi.spec with 100% similarity]
dlls/wnaspi32/Makefile.in

index 1c9e49cc21eb58539c3d89f91234501990ee7708..a5cf0b14fd5a78d7ebe5bb9b4237640ce64b9022 100644 (file)
@@ -97,7 +97,6 @@ dlls/user.exe16
 dlls/ver.dll16
 dlls/w32sys.dll16
 dlls/win32s16.dll16
-dlls/winaspi.dll16
 dlls/wineps16.drv16
 dlls/wing.dll16
 dlls/winnls.dll16
index cb0faa0df55dae79774563f8a7898f283a059e46..2e4b0dfe43249c591682d91207e2036513c3d1c4 100755 (executable)
--- a/configure
+++ b/configure
@@ -27439,6 +27439,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 dlls/win87em.dll16/Makefile: dlls/win87em.dll16/Makefile.in dlls/Makedll.rules"
 ac_config_files="$ac_config_files dlls/win87em.dll16/Makefile"
 
+ALL_MAKEFILES="$ALL_MAKEFILES \\
+       dlls/winaspi.dll16/Makefile"
+test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
+       winaspi.dll16"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/winaspi.dll16/Makefile: dlls/winaspi.dll16/Makefile.in dlls/Makedll.rules"
+ac_config_files="$ac_config_files dlls/winaspi.dll16/Makefile"
+
 ALL_MAKEFILES="$ALL_MAKEFILES \\
        dlls/windebug.dll16/Makefile"
 test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -29389,6 +29397,7 @@ do
     "dlls/vwin32.vxd/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/vwin32.vxd/Makefile" ;;
     "dlls/w32skrnl/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/w32skrnl/Makefile" ;;
     "dlls/win87em.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/win87em.dll16/Makefile" ;;
+    "dlls/winaspi.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/winaspi.dll16/Makefile" ;;
     "dlls/windebug.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/windebug.dll16/Makefile" ;;
     "dlls/winealsa.drv/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/winealsa.drv/Makefile" ;;
     "dlls/wineaudioio.drv/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/wineaudioio.drv/Makefile" ;;
index baa2c95e5f522218038b13b7a280e2fee9543236..d1b27293ce8dc55f5aa35e83ad31819b85ab567a 100644 (file)
@@ -2244,6 +2244,7 @@ WINE_CONFIG_MAKEFILE([dlls/vtdapi.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL
 WINE_CONFIG_MAKEFILE([dlls/vwin32.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
 WINE_CONFIG_MAKEFILE([dlls/w32skrnl/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
 WINE_CONFIG_MAKEFILE([dlls/win87em.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
+WINE_CONFIG_MAKEFILE([dlls/winaspi.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
 WINE_CONFIG_MAKEFILE([dlls/windebug.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
 WINE_CONFIG_MAKEFILE([dlls/winealsa.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
 WINE_CONFIG_MAKEFILE([dlls/wineaudioio.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
index 484d1c8e9c82c541c048dc052ba510f87eb6ccba..2022039b5566437924912c8d258ef478ae8ce48a 100644 (file)
@@ -36,7 +36,6 @@ WIN16_FILES = \
        ver.dll16 \
        w32sys.dll16 \
        win32s16.dll16 \
-       winaspi.dll16 \
        wineps16.drv16 \
        wing.dll16 \
        winnls.dll16 \
@@ -99,9 +98,6 @@ mmsystem.dll16 sound.drv16:
 winnls.dll16:
        echo "winnls32.dll" >$@
 
-winaspi.dll16:
-       echo "wnaspi32.dll" >$@
-
 winsock.dll16:
        echo "ws2_32.dll" >$@
 
diff --git a/dlls/winaspi.dll16/Makefile.in b/dlls/winaspi.dll16/Makefile.in
new file mode 100644 (file)
index 0000000..318e321
--- /dev/null
@@ -0,0 +1,15 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = winaspi.dll16
+IMPORTS   = advapi32 kernel32
+EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,wnaspi32.dll
+
+SPEC_SRCS = winaspi.dll16.spec
+
+C_SRCS = winaspi.c
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/winaspi.dll16/aspi.h b/dlls/winaspi.dll16/aspi.h
new file mode 100644 (file)
index 0000000..a9912ff
--- /dev/null
@@ -0,0 +1,84 @@
+/* ASPI definitions used for both WINASPI and WNASPI32
+ *
+ * Copyright (C) 2000 David Elliott
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_ASPI_H
+#define __WINE_ASPI_H
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+
+#include "pshpack1.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* #ifdef __cplusplus */
+
+/*********** OLD ****************/
+
+/* Target status codes */
+#define STATUS_GOOD             0x00
+#define STATUS_CHKCOND          0x02
+#define STATUS_BUSY             0x08
+#define STATUS_RESCONF          0x18
+
+#define ASPI_POSTING(prb) (prb->SRB_Flags & 0x1)
+
+/* WNASPI32/WINASPI defs */
+#define HOST_TO_TARGET(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x2)
+#define TARGET_TO_HOST(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x1)
+#define NO_DATA_TRANSFERRED(prb) (((prb->SRB_Flags>>3) & 0x3) == 0x3)
+
+
+#define INQUIRY_VENDOR          8
+
+#define MUSTEK_SCSI_AREA_AND_WINDOWS 0x04
+#define MUSTEK_SCSI_READ_SCANNED_DATA 0x08
+#define MUSTEK_SCSI_GET_IMAGE_STATUS 0x0f
+#define MUSTEK_SCSI_ADF_AND_BACKTRACE 0x10
+#define MUSTEK_SCSI_CCD_DISTANCE 0x11
+#define MUSTEK_SCSI_START_STOP 0x1b
+
+#define CMD_TEST_UNIT_READY 0x00
+#define CMD_REQUEST_SENSE 0x03
+#define CMD_INQUIRY 0x12
+
+/* scanner commands - just for debug */
+#define CMD_SCAN_GET_DATA_BUFFER_STATUS 0x34
+#define CMD_SCAN_GET_WINDOW 0x25
+#define CMD_SCAN_OBJECT_POSITION 0x31
+#define CMD_SCAN_READ 0x28
+#define CMD_SCAN_RELEASE_UNIT 0x17
+#define CMD_SCAN_RESERVE_UNIT 0x16
+#define CMD_SCAN_SCAN 0x1b
+#define CMD_SCAN_SEND 0x2a
+#define CMD_SCAN_CHANGE_DEFINITION 0x40
+
+#define INQURIY_CMDLEN 6
+#define INQURIY_REPLY_LEN 96
+#define INQUIRY_VENDOR 8
+
+#define SENSE_BUFFER(prb) (&prb->CDBByte[prb->SRB_CDBLen])
+
+#ifdef __cplusplus
+}
+#endif /* #ifdef __cplusplus */
+#include "poppack.h"
+
+#endif
similarity index 90%
rename from dlls/wnaspi32/winaspi16.c
rename to dlls/winaspi.dll16/winaspi.c
index 74297808ca86d5edd50ba025dcbd6b4ec2d62462..9ef9974e5be06314abb4eea700238860fe801d29 100644 (file)
@@ -37,7 +37,6 @@
 #include "winreg.h"
 #include "wownt32.h"
 #include "aspi.h"
-#include "winescsi.h"
 #include "wine/winaspi.h"
 #include "wine/debug.h"
 
 
 #ifdef linux
 
+/* Copy of info from 2.2.x kernel */
+#define SG_MAX_SENSE 16   /* too little, unlikely to change in 2.2.x */
+
+struct sg_header
+{
+    int pack_len;    /* [o] reply_len (ie useless), ignored as input */
+    int reply_len;   /* [i] max length of expected reply (inc. sg_header) */
+    int pack_id;     /* [io] id number of packet (use ints >= 0) */
+    int result;      /* [o] 0==ok, else (+ve) Unix errno (best ignored) */
+    unsigned int twelve_byte:1;
+        /* [i] Force 12 byte command length for group 6 & 7 commands  */
+    unsigned int target_status:5;   /* [o] scsi status from target */
+    unsigned int host_status:8;     /* [o] host status (see "DID" codes) */
+    unsigned int driver_status:8;   /* [o] driver status+suggestion */
+    unsigned int other_flags:10;    /* unused */
+    unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases:
+           when target_status is CHECK_CONDITION or
+           when target_status is COMMAND_TERMINATED or
+           when (driver_status & DRIVER_SENSE) is true. */
+};      /* This structure is 36 bytes long on i386 */
+
+#define SCSI_OFF sizeof(struct sg_header)
+
 #define PTR_TO_LIN(ptr,mode) \
   ((mode) == ASPI_DOS ? ((void*)(((unsigned int)SELECTOROF(ptr) << 4) + OFFSETOF(ptr))) : MapSL(ptr))
 
 WINE_DEFAULT_DEBUG_CHANNEL(aspi);
 
+/* Just a container for seeing what devices are open */
+struct ASPI_DEVICE_INFO {
+    struct ASPI_DEVICE_INFO *   next;
+    int                         fd;
+    int                         hostId;
+    int                         target;
+    int                         lun;
+};
+
+typedef struct ASPI_DEVICE_INFO ASPI_DEVICE_INFO;
+
 static ASPI_DEVICE_INFO *ASPI_open_devices = NULL;
 
 static FARPROC16 ASPIChainFunc = NULL;
index 12707b59c6eda108492d8098852580ea083d4cb9..36cbf72229ea52f1bd5d076735cfb2663e74793f 100644 (file)
@@ -10,11 +10,6 @@ C_SRCS = \
        aspi.c \
        winaspi32.c
 
-C_SRCS16 = \
-       winaspi16.c
-
-SPEC_SRCS16 = winaspi.spec
-
 @MAKE_DLL_RULES@
 
 @DEPENDENCIES@  # everything below this line is overwritten by make depend