wnaspi32: Make winaspi.dll into a stand-alone 16-bit module.

This commit is contained in:
Alexandre Julliard 2009-03-23 20:33:34 +01:00
parent d540fa2a28
commit a2ae7dd06c
9 changed files with 143 additions and 11 deletions

1
.gitignore vendored
View 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

9
configure vendored
View File

@ -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" ;;

View 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])

View 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" >$@

View File

@ -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

84
dlls/winaspi.dll16/aspi.h Normal file
View File

@ -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

View 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"
@ -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;

View 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