diff --git a/.gitignore b/.gitignore index 1c9e49cc21e..a5cf0b14fd5 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/configure b/configure index cb0faa0df55..2e4b0dfe432 100755 --- 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" ;; diff --git a/configure.ac b/configure.ac index baa2c95e5f5..d1b27293ce8 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 484d1c8e9c8..2022039b556 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -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 index 00000000000..318e321ce8c --- /dev/null +++ b/dlls/winaspi.dll16/Makefile.in @@ -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 index 00000000000..a9912ffc9e4 --- /dev/null +++ b/dlls/winaspi.dll16/aspi.h @@ -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 + +#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 diff --git a/dlls/wnaspi32/winaspi16.c b/dlls/winaspi.dll16/winaspi.c similarity index 90% rename from dlls/wnaspi32/winaspi16.c rename to dlls/winaspi.dll16/winaspi.c index 74297808ca8..9ef9974e5be 100644 --- a/dlls/wnaspi32/winaspi16.c +++ b/dlls/winaspi.dll16/winaspi.c @@ -37,7 +37,6 @@ #include "winreg.h" #include "wownt32.h" #include "aspi.h" -#include "winescsi.h" #include "wine/winaspi.h" #include "wine/debug.h" @@ -50,11 +49,45 @@ #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; diff --git a/dlls/wnaspi32/winaspi.spec b/dlls/winaspi.dll16/winaspi.dll16.spec similarity index 100% rename from dlls/wnaspi32/winaspi.spec rename to dlls/winaspi.dll16/winaspi.dll16.spec diff --git a/dlls/wnaspi32/Makefile.in b/dlls/wnaspi32/Makefile.in index 12707b59c6e..36cbf72229e 100644 --- a/dlls/wnaspi32/Makefile.in +++ b/dlls/wnaspi32/Makefile.in @@ -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