Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e9836523
Commit
e9836523
authored
Nov 15, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a number of DOS definitions out of the global headers and into
winedos private files. Removed the msdos.h header.
parent
97657b1d
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
300 additions
and
461 deletions
+300
-461
device.c
dlls/kernel/device.c
+0
-1
file16.c
dlls/kernel/file16.c
+0
-3
instr.c
dlls/kernel/instr.c
+3
-2
thunk.c
dlls/kernel/thunk.c
+8
-9
vxd.c
dlls/kernel/vxd.c
+2
-3
win87em.c
dlls/kernel/win87em.c
+24
-24
windebug.c
dlls/kernel/windebug.c
+3
-4
wowthunk.c
dlls/kernel/wowthunk.c
+1
-1
winaspi16.c
dlls/winaspi/winaspi16.c
+16
-71
devices.c
dlls/winedos/devices.c
+62
-4
dosexe.h
dlls/winedos/dosexe.h
+77
-1
dosvm.c
dlls/winedos/dosvm.c
+0
-3
fpu.c
dlls/winedos/fpu.c
+1
-2
int11.c
dlls/winedos/int11.c
+1
-3
int12.c
dlls/winedos/int12.c
+1
-1
int13.c
dlls/winedos/int13.c
+4
-3
int15.c
dlls/winedos/int15.c
+1
-1
int17.c
dlls/winedos/int17.c
+1
-2
int21.c
dlls/winedos/int21.c
+86
-14
int25.c
dlls/winedos/int25.c
+1
-2
int26.c
dlls/winedos/int26.c
+1
-2
int2a.c
dlls/winedos/int2a.c
+1
-2
int31.c
dlls/winedos/int31.c
+0
-2
int41.c
dlls/winedos/int41.c
+1
-1
int4b.c
dlls/winedos/int4b.c
+1
-1
int5c.c
dlls/winedos/int5c.c
+1
-1
vxd.c
dlls/winedos/vxd.c
+1
-3
xms.c
dlls/winedos/xms.c
+1
-1
directory.c
files/directory.c
+0
-1
dos_fs.c
files/dos_fs.c
+0
-1
drive.c
files/drive.c
+0
-1
file.c
files/file.c
+1
-3
miscemu.h
include/miscemu.h
+0
-74
msdos.h
include/msdos.h
+0
-214
No files found.
dlls/kernel/device.c
View file @
e9836523
...
...
@@ -41,7 +41,6 @@
#include "file.h"
#include "winioctl.h"
#include "winnt.h"
#include "msdos.h"
#include "kernel_private.h"
#include "wine/server.h"
#include "wine/debug.h"
...
...
dlls/kernel/file16.c
View file @
e9836523
...
...
@@ -39,10 +39,7 @@
#include "winternl.h"
#include "wine/winbase16.h"
#include "wine/server.h"
#include "msdos.h"
#include "kernel_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
dlls/kernel/instr.c
View file @
e9836523
...
...
@@ -41,6 +41,7 @@ WINE_DECLARE_DEBUG_CHANNEL(io);
#define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
#define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
#define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
#define ISV86(context) ((context)->EFlags & 0x00020000)
inline
static
void
add_stack
(
CONTEXT86
*
context
,
int
offset
)
{
...
...
@@ -52,7 +53,7 @@ inline static void add_stack( CONTEXT86 *context, int offset )
inline
static
void
*
make_ptr
(
CONTEXT86
*
context
,
DWORD
seg
,
DWORD
off
,
int
long_addr
)
{
if
(
ISV86
(
context
))
return
PTR_REAL_TO_LIN
(
seg
,
off
);
if
(
ISV86
(
context
))
return
(
void
*
)((
seg
<<
4
)
+
LOWORD
(
off
)
);
if
(
IS_SELECTOR_SYSTEM
(
seg
))
return
(
void
*
)
off
;
if
(
!
long_addr
)
off
=
LOWORD
(
off
);
return
(
char
*
)
MapSL
(
MAKESEGPTR
(
seg
,
0
)
)
+
off
;
...
...
@@ -60,7 +61,7 @@ inline static void *make_ptr( CONTEXT86 *context, DWORD seg, DWORD off, int long
inline
static
void
*
get_stack
(
CONTEXT86
*
context
)
{
if
(
ISV86
(
context
))
return
PTR_REAL_TO_LIN
(
context
->
SegSs
,
context
->
Esp
);
if
(
ISV86
(
context
))
return
(
void
*
)((
context
->
SegSs
<<
4
)
+
LOWORD
(
context
->
Esp
)
);
return
wine_ldt_get_ptr
(
context
->
SegSs
,
context
->
Esp
);
}
...
...
dlls/kernel/thunk.c
View file @
e9836523
...
...
@@ -42,7 +42,6 @@
#include "wine/library.h"
#include "flatthunk.h"
#include "module.h"
#include "miscemu.h"
#include "selectors.h"
#include "stackframe.h"
#include "task.h"
...
...
@@ -716,7 +715,7 @@ void WINAPI Common32ThkLS( CONTEXT86 *context )
context
->
Eax
=
context16
.
Eax
;
/* Clean up caller's stack frame */
context
->
Esp
+=
BL_reg
(
&
context16
);
context
->
Esp
+=
LOBYTE
(
context16
.
Ebx
);
}
/***********************************************************************
...
...
@@ -1456,7 +1455,7 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
else
{
struct
ThunkDataSL
*
td
=
(
struct
ThunkDataSL
*
)
context
->
Edx
;
DWORD
targetNr
=
CX_reg
(
context
)
/
4
;
DWORD
targetNr
=
LOWORD
(
context
->
Ecx
)
/
4
;
struct
SLTargetDB
*
tdb
;
TRACE
(
"Process %08lx calling target %ld of ThunkDataSL %08lx
\n
"
,
...
...
@@ -1485,8 +1484,8 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
else
{
WORD
*
stack
=
MapSL
(
MAKESEGPTR
(
context
->
SegSs
,
LOWORD
(
context
->
Esp
))
);
SET_DX
(
context
,
HIWORD
(
td
->
apiDB
[
targetNr
].
errorReturnValue
)
);
SET_AX
(
context
,
LOWORD
(
td
->
apiDB
[
targetNr
].
errorReturnValue
)
);
context
->
Edx
=
(
context
->
Edx
&
~
0xffff
)
|
HIWORD
(
td
->
apiDB
[
targetNr
].
errorReturnValue
);
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
LOWORD
(
td
->
apiDB
[
targetNr
].
errorReturnValue
);
context
->
Eip
=
stack
[
2
];
context
->
SegCs
=
stack
[
3
];
context
->
Esp
+=
td
->
apiDB
[
targetNr
].
nrArgBytes
+
4
;
...
...
@@ -1932,8 +1931,8 @@ void WINAPI CBClientThunkSLEx( CONTEXT86 *context )
/* Restore registers saved by CBClientGlueSL */
stackLin
=
(
LPWORD
)((
LPBYTE
)
CURRENT_STACK16
+
sizeof
(
STACK16FRAME
)
-
4
);
context
->
Ebp
=
(
context
->
Ebp
&
~
0xffff
)
|
stackLin
[
3
];
SET_SI
(
context
,
stackLin
[
2
]
)
;
SET_DI
(
context
,
stackLin
[
1
]
)
;
context
->
Esi
=
(
context
->
Esi
&
~
0xffff
)
|
stackLin
[
2
]
;
context
->
Edi
=
(
context
->
Edi
&
~
0xffff
)
|
stackLin
[
1
]
;
context
->
SegDs
=
stackLin
[
0
];
context
->
Esp
+=
16
+
nArgs
;
...
...
@@ -2090,7 +2089,7 @@ void WINAPI Catch16( LPCATCHBUF lpbuf, CONTEXT86 *context )
lpbuf
[
6
]
=
context
->
SegDs
;
lpbuf
[
7
]
=
0
;
lpbuf
[
8
]
=
context
->
SegSs
;
SET_AX
(
context
,
0
)
;
/* Return 0 */
context
->
Eax
&=
~
0xffff
;
/* Return 0 */
}
...
...
@@ -2105,7 +2104,7 @@ void WINAPI Throw16( LPCATCHBUF lpbuf, INT16 retval, CONTEXT86 *context )
STACK16FRAME
*
pFrame
;
STACK32FRAME
*
frame32
;
SET_AX
(
context
,
retval
)
;
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
(
WORD
)
retval
;
/* Find the frame32 corresponding to the frame16 we are jumping to */
pFrame
=
CURRENT_STACK16
;
...
...
dlls/kernel/vxd.c
View file @
e9836523
...
...
@@ -39,7 +39,6 @@
#include "ntstatus.h"
#include "winnt.h"
#include "winternl.h"
#include "miscemu.h"
#include "kernel_private.h"
#include "wine/debug.h"
...
...
@@ -1085,8 +1084,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
TRACE
(
"Int31/DPMI dispatch(%08lx)
\n
"
,
callnum
);
SET_AX
(
context
,
callnum
)
;
SET_CX
(
context
,
parm
)
;
context
->
Eax
=
callnum
;
context
->
Ecx
=
parm
;
INSTR_CallBuiltinHandler
(
context
,
0x31
);
return
LOWORD
(
context
->
Eax
);
...
...
dlls/kernel/win87em.c
View file @
e9836523
...
...
@@ -17,7 +17,7 @@
*/
#include <stdlib.h>
#include "
miscemu
.h"
#include "
windef
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
@@ -59,7 +59,7 @@ static WORD Inthandler02hVar = 1;
static
void
WIN87_ClearCtrlWord
(
CONTEXT86
*
context
)
{
SET_AX
(
context
,
0
);
context
->
Eax
&=
~
0xffff
;
/* set AX to 0 */
if
(
Installed
)
#ifdef __i386__
__asm__
(
"fclex"
);
...
...
@@ -71,15 +71,15 @@ static void WIN87_ClearCtrlWord( CONTEXT86 *context )
static
void
WIN87_SetCtrlWord
(
CONTEXT86
*
context
)
{
CtrlWord_1
=
AX_reg
(
context
);
CtrlWord_1
=
LOWORD
(
context
->
Eax
);
context
->
Eax
&=
~
0x00c3
;
if
(
Installed
)
{
CtrlWord_Internal
=
AX_reg
(
context
);
CtrlWord_Internal
=
LOWORD
(
context
->
Eax
);
#ifdef __i386__
__asm__
(
"wait;fldcw %0"
:
:
"m"
(
CtrlWord_Internal
));
#endif
}
CtrlWord_2
=
AX_reg
(
context
);
CtrlWord_2
=
LOWORD
(
context
->
Eax
);
}
void
WIN87_Init
(
CONTEXT86
*
context
)
...
...
@@ -91,7 +91,7 @@ void WIN87_Init( CONTEXT86 *context )
#endif
}
StackBottom
=
StackTop
;
SET_AX
(
context
,
0x1332
)
;
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
0x1332
;
WIN87_SetCtrlWord
(
context
);
WIN87_ClearCtrlWord
(
context
);
}
...
...
@@ -101,12 +101,12 @@ void WIN87_Init( CONTEXT86 *context )
*/
void
WINAPI
WIN87_fpmath
(
CONTEXT86
*
context
)
{
TRACE
(
"(cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx=
=
%04x)
\n
"
,
TRACE
(
"(cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx=%04x)
\n
"
,
(
WORD
)
context
->
SegCs
,
context
->
Eip
,
(
WORD
)
context
->
SegEs
,
BX_reg
(
context
)
,
AX_reg
(
context
),
DX_reg
(
context
)
);
(
WORD
)
context
->
SegEs
,
(
WORD
)
context
->
Ebx
,
(
WORD
)
context
->
Eax
,
(
WORD
)
context
->
Edx
);
switch
(
BX_reg
(
context
))
switch
(
LOWORD
(
context
->
Ebx
))
{
case
0
:
/* install (increase instanceref) emulator, install NMI vector */
RefCount
++
;
...
...
@@ -115,7 +115,7 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context )
InstallIntVecs02hAnd75h();
#endif
WIN87_Init
(
context
);
SET_AX
(
context
,
0
);
context
->
Eax
&=
~
0xffff
;
/* set AX to 0 */
break
;
case
1
:
/* Init Emulator */
...
...
@@ -144,7 +144,7 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context )
break
;
case
5
:
/* return internal control word in AX */
SET_AX
(
context
,
CtrlWord_1
)
;
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
CtrlWord_1
;
break
;
case
6
:
/* round top of stack to integer using method AX & 0x0C00 */
...
...
@@ -179,21 +179,21 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context )
/* FIXME: could someone who really understands asm() fix this please? --AJ */
/* __asm__("fistp %0;wait" : "=m" (dw) : : "memory"); */
TRACE
(
"On top of stack was %ld
\n
"
,
dw
);
SET_AX
(
context
,
LOWORD
(
dw
)
);
SET_DX
(
context
,
HIWORD
(
dw
)
);
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
LOWORD
(
dw
);
context
->
Edx
=
(
context
->
Edx
&
~
0xffff
)
|
HIWORD
(
dw
);
}
break
;
case
8
:
/* restore internal status words from emulator status word */
SET_AX
(
context
,
0
);
context
->
Eax
&=
~
0xffff
;
/* set AX to 0 */
if
(
Installed
)
{
#ifdef __i386__
__asm__
(
"fstsw %0;wait"
:
"=m"
(
StatusWord_1
));
#endif
SET_AL
(
context
,
(
BYTE
)
StatusWord_1
&
0x3f
)
;
context
->
Eax
|=
StatusWord_1
&
0x3f
;
}
context
->
Eax
=
(
context
->
Eax
|
StatusWord_2
)
&
~
0xe000
;
StatusWord_2
=
AX_reg
(
context
);
StatusWord_2
=
LOWORD
(
context
->
Eax
);
break
;
case
9
:
/* clear emu control word and some other things */
...
...
@@ -201,22 +201,22 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context )
break
;
case
10
:
/* dunno. but looks like returning nr. of things on stack in AX */
SET_AX
(
context
,
0
);
context
->
Eax
&=
~
0xffff
;
/* set AX to 0 */
break
;
case
11
:
/* just returns the installed flag in DX:AX */
SET_DX
(
context
,
0
);
SET_AX
(
context
,
Installed
)
;
context
->
Edx
&=
~
0xffff
;
/* set DX to 0 */
context
->
Eax
=
(
context
->
Eax
&
~
0xffff
)
|
Installed
;
break
;
case
12
:
/* save AX in some internal state var */
Inthandler02hVar
=
AX_reg
(
context
);
Inthandler02hVar
=
LOWORD
(
context
->
Eax
);
break
;
default:
/* error. Say that loud and clear */
FIXME
(
"unhandled switch %d
\n
"
,
BX_reg
(
context
));
SET_AX
(
context
,
0xFFFF
)
;
SET_DX
(
context
,
0xFFFF
)
;
FIXME
(
"unhandled switch %d
\n
"
,
LOWORD
(
context
->
Ebx
));
context
->
Eax
|=
0xffff
;
context
->
Edx
|=
0xffff
;
break
;
}
}
...
...
dlls/kernel/windebug.c
View file @
e9836523
...
...
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "miscemu.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dll
);
...
...
@@ -34,8 +33,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dll);
*/
void
WINAPI
WinNotify16
(
CONTEXT86
*
context
)
{
FIXME
(
"(AX=%04x):stub.
\n
"
,
AX_reg
(
context
));
switch
(
AX_reg
(
context
))
FIXME
(
"(AX=%04x):stub.
\n
"
,
LOWORD
(
context
->
Eax
));
switch
(
LOWORD
(
context
->
Eax
))
{
case
0x000D
:
case
0x000E
:
...
...
@@ -50,7 +49,7 @@ void WINAPI WinNotify16(CONTEXT86 *context)
case
0x0065
:
/* do something complicated */
break
;
case
0x0050
:
/* do something complicated, now just return error */
SET_CFLAG
(
context
);
context
->
EFlags
|=
0x0001
;
/* set C flag */
break
;
case
0x0052
:
/* do something complicated */
break
;
...
...
dlls/kernel/wowthunk.c
View file @
e9836523
...
...
@@ -524,7 +524,7 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
SYSLEVEL_CheckNotLevel
(
2
);
}
if
(
ISV86
(
context
))
if
(
context
->
EFlags
&
0x00020000
)
/* v86 mode */
{
EXCEPTION_REGISTRATION_RECORD
frame
;
frame
.
Handler
=
vm86_handler
;
...
...
dlls/winaspi/winaspi16.c
View file @
e9836523
...
...
@@ -40,7 +40,6 @@
#include "winescsi.h"
#include "wine/winaspi.h"
#include "wine/debug.h"
#include "miscemu.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
aspi
);
...
...
@@ -53,6 +52,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(aspi);
#ifdef linux
#define PTR_TO_LIN(ptr,mode) \
((mode) == ASPI_DOS ? ((void*)(((unsigned int)SELECTOROF(ptr) << 4) + OFFSETOF(ptr))) : MapSL(ptr))
static
ASPI_DEVICE_INFO
*
ASPI_open_devices
=
NULL
;
static
FARPROC16
ASPIChainFunc
=
NULL
;
...
...
@@ -127,19 +129,7 @@ ASPI_DebugPrintCmd(SRB_ExecSCSICmd16 *prb, UINT16 mode)
BYTE
cmd
;
int
i
;
BYTE
*
cdb
;
BYTE
*
lpBuf
=
0
;
switch
(
mode
)
{
case
ASPI_DOS
:
/* translate real mode address */
if
(
prb
->
SRB_BufPointer
)
lpBuf
=
PTR_REAL_TO_LIN
(
SELECTOROF
(
prb
->
SRB_BufPointer
),
OFFSETOF
(
prb
->
SRB_BufPointer
));
break
;
case
ASPI_WIN16
:
lpBuf
=
MapSL
(
prb
->
SRB_BufPointer
);
break
;
}
BYTE
*
lpBuf
=
PTR_TO_LIN
(
prb
->
SRB_BufPointer
,
mode
);
switch
(
prb
->
CDBByte
[
0
])
{
case
CMD_INQUIRY
:
...
...
@@ -216,19 +206,7 @@ ASPI_PrintSenseArea16(SRB_ExecSCSICmd16 *prb)
static
void
ASPI_DebugPrintResult
(
SRB_ExecSCSICmd16
*
prb
,
UINT16
mode
)
{
BYTE
*
lpBuf
=
0
;
switch
(
mode
)
{
case
ASPI_DOS
:
/* translate real mode address */
if
(
prb
->
SRB_BufPointer
)
lpBuf
=
PTR_REAL_TO_LIN
(
SELECTOROF
(
prb
->
SRB_BufPointer
),
OFFSETOF
(
prb
->
SRB_BufPointer
));
break
;
case
ASPI_WIN16
:
lpBuf
=
MapSL
(
prb
->
SRB_BufPointer
);
break
;
}
BYTE
*
lpBuf
=
PTR_TO_LIN
(
prb
->
SRB_BufPointer
,
mode
);
switch
(
prb
->
CDBByte
[
0
])
{
case
CMD_INQUIRY
:
...
...
@@ -243,7 +221,7 @@ ASPI_DebugPrintResult(SRB_ExecSCSICmd16 *prb, UINT16 mode)
static
WORD
ASPI_ExecScsiCmd
(
DWORD
ptrPRB
,
UINT16
mode
)
{
SRB_ExecSCSICmd16
*
lpPRB
=
0
;
SRB_ExecSCSICmd16
*
lpPRB
=
PTR_TO_LIN
(
ptrPRB
,
mode
)
;
struct
sg_header
*
sg_hd
,
*
sg_reply_hdr
;
int
status
;
BYTE
*
lpBuf
=
0
;
...
...
@@ -251,17 +229,6 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode)
int
error_code
=
0
;
int
fd
;
switch
(
mode
)
{
case
ASPI_DOS
:
if
(
ptrPRB
)
lpPRB
=
PTR_REAL_TO_LIN
(
SELECTOROF
(
ptrPRB
),
OFFSETOF
(
ptrPRB
));
break
;
case
ASPI_WIN16
:
lpPRB
=
MapSL
(
ptrPRB
);
break
;
}
ASPI_DebugPrintCmd
(
lpPRB
,
mode
);
fd
=
ASPI_OpenDevice16
(
lpPRB
);
...
...
@@ -275,19 +242,7 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode)
sg_reply_hdr
=
NULL
;
lpPRB
->
SRB_Status
=
SS_PENDING
;
switch
(
mode
)
{
case
ASPI_DOS
:
/* translate real mode address */
if
(
ptrPRB
)
lpBuf
=
PTR_REAL_TO_LIN
(
SELECTOROF
(
lpPRB
->
SRB_BufPointer
),
OFFSETOF
(
lpPRB
->
SRB_BufPointer
));
break
;
case
ASPI_WIN16
:
lpBuf
=
MapSL
(
lpPRB
->
SRB_BufPointer
);
break
;
}
lpBuf
=
PTR_TO_LIN
(
lpPRB
->
SRB_BufPointer
,
mode
);
if
(
!
lpPRB
->
SRB_CDBLen
)
{
WARN
(
"Failed: lpPRB->SRB_CDBLen = 0.
\n
"
);
...
...
@@ -435,27 +390,17 @@ WORD WINAPI GetASPISupportInfo16(void)
DWORD
ASPI_SendASPICommand
(
DWORD
ptrSRB
,
UINT16
mode
)
{
#ifdef linux
LPSRB16
lpSRB
=
0
;
LPSRB16
lpSRB
=
PTR_TO_LIN
(
ptrSRB
,
mode
)
;
switch
(
mode
)
if
(
mode
==
ASPI_WIN16
&&
ASPIChainFunc
)
{
case
ASPI_DOS
:
if
(
ptrSRB
)
lpSRB
=
PTR_REAL_TO_LIN
(
SELECTOROF
(
ptrSRB
),
OFFSETOF
(
ptrSRB
));
break
;
case
ASPI_WIN16
:
lpSRB
=
MapSL
(
ptrSRB
);
if
(
ASPIChainFunc
)
{
/* This is not the post proc, it's the chain proc this time */
DWORD
ret
=
WOWCallback16
((
DWORD
)
ASPIChainFunc
,
ptrSRB
);
if
(
ret
)
{
lpSRB
->
inquiry
.
SRB_Status
=
SS_INVALID_SRB
;
return
ret
;
}
}
break
;
/* This is not the post proc, it's the chain proc this time */
DWORD
ret
=
WOWCallback16
((
DWORD
)
ASPIChainFunc
,
ptrSRB
);
if
(
ret
)
{
lpSRB
->
inquiry
.
SRB_Status
=
SS_INVALID_SRB
;
return
ret
;
}
}
switch
(
lpSRB
->
common
.
SRB_Cmd
)
{
...
...
dlls/winedos/devices.c
View file @
e9836523
...
...
@@ -21,8 +21,6 @@
#include <stdlib.h>
#include <string.h>
#include "wine/winbase16.h"
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "wine/debug.h"
...
...
@@ -57,6 +55,54 @@ typedef struct {
BYTE
data
;
}
REQ_SAFEINPUT
;
typedef
struct
{
DWORD
next_dev
;
WORD
attr
;
WORD
strategy
;
WORD
interrupt
;
char
name
[
8
];
}
DOS_DEVICE_HEADER
;
/* Warning: need to return LOL ptr w/ offset 0 (&ptr_first_DPB) to programs ! */
typedef
struct
_DOS_LISTOFLISTS
{
WORD
CX_Int21_5e01
;
/* -24d contents of CX from INT 21/AX=5E01h */
WORD
LRU_count_FCB_cache
;
/* -22d */
WORD
LRU_count_FCB_open
;
/* -20d */
DWORD
OEM_func_handler
;
/* -18d OEM function of INT 21/AH=F8h */
WORD
INT21_offset
;
/* -14d offset in DOS CS of code to return from INT 21 call */
WORD
sharing_retry_count
;
/* -12d */
WORD
sharing_retry_delay
;
/* -10d */
DWORD
ptr_disk_buf
;
/* -8d ptr to current disk buf */
WORD
offs_unread_CON
;
/* -4d pointer in DOS data segment of unread CON input */
WORD
seg_first_MCB
;
/* -2d */
DWORD
ptr_first_DPB
;
/* 00 */
DWORD
ptr_first_SysFileTable
;
/* 04 */
DWORD
ptr_clock_dev_hdr
;
/* 08 */
DWORD
ptr_CON_dev_hdr
;
/* 0C */
WORD
max_byte_per_sec
;
/* 10 maximum bytes per sector of any block device */
DWORD
ptr_disk_buf_info
;
/* 12 */
DWORD
ptr_array_CDS
;
/* 16 current directory structure */
DWORD
ptr_sys_FCB
;
/* 1A */
WORD
nr_protect_FCB
;
/* 1E */
BYTE
nr_block_dev
;
/* 20 */
BYTE
nr_avail_drive_letters
;
/* 21 */
DOS_DEVICE_HEADER
NUL_dev
;
/* 22 */
BYTE
nr_drives_JOINed
;
/* 34 */
WORD
ptr_spec_prg_names
;
/* 35 */
DWORD
ptr_SETVER_prg_list
;
/* 37 */
WORD
DOS_HIGH_A20_func_offs
;
/* 3B */
WORD
PSP_last_exec
;
/* 3D if DOS in HMA: PSP of program executed last; if DOS low: 0000h */
WORD
BUFFERS_val
;
/* 3F */
WORD
BUFFERS_nr_lookahead
;
/* 41 */
BYTE
boot_drive
;
/* 43 */
BYTE
flag_DWORD_moves
;
/* 44 01h for 386+, 00h otherwise */
WORD
size_extended_mem
;
/* 45 size of extended mem in KB */
SEGPTR
wine_rm_lol
;
/* -- wine: Real mode pointer to LOL */
SEGPTR
wine_pm_lol
;
/* -- wine: Protected mode pointer to LOL */
}
DOS_LISTOFLISTS
;
#include "poppack.h"
#define CON_BUFFER 128
...
...
@@ -150,7 +196,7 @@ typedef struct
DWORD
DOS_LOLSeg
;
struct
_DOS_LISTOFLISTS
*
DOSMEM_LOL
()
st
atic
st
ruct
_DOS_LISTOFLISTS
*
DOSMEM_LOL
()
{
return
PTR_REAL_TO_LIN
(
HIWORD
(
DOS_LOLSeg
),
0
);
}
...
...
@@ -570,7 +616,7 @@ static void DOSDEV_DoReq(void*req, DWORD dev)
switch
(
hdr
->
status
&
STAT_MASK
)
{
case
0x0F
:
/* invalid disk change */
/* this error seems to fit the bill */
SetLastError
(
ER
_NotSameDevice
);
SetLastError
(
ER
ROR_NOT_SAME_DEVICE
);
break
;
default:
SetLastError
((
hdr
->
status
&
STAT_MASK
)
+
0x13
);
...
...
@@ -635,3 +681,15 @@ int DOSDEV_IoctlWrite(DWORD dev, DWORD buf, int buflen)
{
return
DOSDEV_IO
(
CMD_OUTIOCTL
,
dev
,
buf
,
buflen
);
}
void
DOSDEV_SetSharingRetry
(
WORD
delay
,
WORD
count
)
{
DOSMEM_LOL
()
->
sharing_retry_delay
=
delay
;
if
(
count
)
DOSMEM_LOL
()
->
sharing_retry_count
=
count
;
}
SEGPTR
DOSDEV_GetLOL
(
BOOL
v86
)
{
if
(
v86
)
return
DOSMEM_LOL
()
->
wine_rm_lol
;
else
return
DOSMEM_LOL
()
->
wine_pm_lol
;
}
dlls/winedos/dosexe.h
View file @
e9836523
...
...
@@ -30,6 +30,8 @@
#include "wincon.h"
/* for MOUSE_EVENT_RECORD */
#include "miscemu.h"
#define MAX_DOS_DRIVES 26
struct
_DOSEVENT
;
/* amount of space reserved for relay stack */
...
...
@@ -102,6 +104,79 @@ extern struct DPMI_segments *DOSVM_dpmi_segments;
#define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
#define PTR_REAL_TO_LIN(seg,off) ((void*)(((unsigned int)(seg) << 4) + LOWORD(off)))
/* NOTE: Interrupts might get called from four modes: real mode, 16-bit,
* 32-bit segmented (DPMI32) and 32-bit linear (via DeviceIoControl).
* For automatic conversion of pointer
* parameters, interrupt handlers should use CTX_SEG_OFF_TO_LIN with
* the contents of a segment register as second and the contents of
* a *32-bit* general register as third parameter, e.g.
* CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EDX_reg(context) )
* This will generate a linear pointer in all three cases:
* Real-Mode: Seg*16 + LOWORD(Offset)
* 16-bit: convert (Seg, LOWORD(Offset)) to linear
* 32-bit segmented: convert (Seg, Offset) to linear
* 32-bit linear: use Offset as linear address (DeviceIoControl!)
*
* Real-mode is recognized by checking the V86 bit in the flags register,
* 32-bit linear mode is recognized by checking whether 'seg' is
* a system selector (0 counts also as 32-bit segment) and 32-bit
* segmented mode is recognized by checking whether 'seg' is 32-bit
* selector which is neither system selector nor zero.
*/
#define CTX_SEG_OFF_TO_LIN(context,seg,off) \
(ISV86(context) ? PTR_REAL_TO_LIN((seg),(off)) : wine_ldt_get_ptr((seg),(off)))
#define INT_BARF(context,num) \
ERR( "int%x: unknown/not implemented parameters:\n" \
"int%x: AX %04x, BX %04x, CX %04x, DX %04x, " \
"SI %04x, DI %04x, DS %04x, ES %04x\n", \
(num), (num), LOWORD((context)->Eax), LOWORD((context)->Ebx), \
LOWORD((context)->Ecx), LOWORD((context)->Edx), LOWORD((context)->Esi), \
LOWORD((context)->Edi), (WORD)(context)->SegDs, (WORD)(context)->SegEs )
/* Macros for easier access to i386 context registers */
#define AX_reg(context) ((WORD)(context)->Eax)
#define BX_reg(context) ((WORD)(context)->Ebx)
#define CX_reg(context) ((WORD)(context)->Ecx)
#define DX_reg(context) ((WORD)(context)->Edx)
#define SI_reg(context) ((WORD)(context)->Esi)
#define DI_reg(context) ((WORD)(context)->Edi)
#define AL_reg(context) ((BYTE)(context)->Eax)
#define AH_reg(context) ((BYTE)((context)->Eax >> 8))
#define BL_reg(context) ((BYTE)(context)->Ebx)
#define BH_reg(context) ((BYTE)((context)->Ebx >> 8))
#define CL_reg(context) ((BYTE)(context)->Ecx)
#define CH_reg(context) ((BYTE)((context)->Ecx >> 8))
#define DL_reg(context) ((BYTE)(context)->Edx)
#define DH_reg(context) ((BYTE)((context)->Edx >> 8))
#define SET_CFLAG(context) ((context)->EFlags |= 0x0001)
#define RESET_CFLAG(context) ((context)->EFlags &= ~0x0001)
#define SET_ZFLAG(context) ((context)->EFlags |= 0x0040)
#define RESET_ZFLAG(context) ((context)->EFlags &= ~0x0040)
#define ISV86(context) ((context)->EFlags & 0x00020000)
#define SET_AX(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xffff) | (WORD)(val)))
#define SET_BX(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xffff) | (WORD)(val)))
#define SET_CX(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xffff) | (WORD)(val)))
#define SET_DX(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xffff) | (WORD)(val)))
#define SET_SI(context,val) ((void)((context)->Esi = ((context)->Esi & ~0xffff) | (WORD)(val)))
#define SET_DI(context,val) ((void)((context)->Edi = ((context)->Edi & ~0xffff) | (WORD)(val)))
#define SET_AL(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff) | (BYTE)(val)))
#define SET_BL(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff) | (BYTE)(val)))
#define SET_CL(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff) | (BYTE)(val)))
#define SET_DL(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff) | (BYTE)(val)))
#define SET_AH(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_BH(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_CH(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_DH(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff00) | (((BYTE)(val)) << 8)))
/* module.c */
extern
void
WINAPI
MZ_LoadImage
(
LPCSTR
filename
,
HANDLE
hFile
);
extern
BOOL
WINAPI
MZ_Exec
(
CONTEXT86
*
context
,
LPCSTR
filename
,
BYTE
func
,
LPVOID
paramblk
);
...
...
@@ -132,7 +207,8 @@ extern int DOSDEV_Read(DWORD dev, DWORD buf, int buflen);
extern
int
DOSDEV_Write
(
DWORD
dev
,
DWORD
buf
,
int
buflen
,
int
verify
);
extern
int
DOSDEV_IoctlRead
(
DWORD
dev
,
DWORD
buf
,
int
buflen
);
extern
int
DOSDEV_IoctlWrite
(
DWORD
dev
,
DWORD
buf
,
int
buflen
);
extern
struct
_DOS_LISTOFLISTS
*
DOSMEM_LOL
();
extern
void
DOSDEV_SetSharingRetry
(
WORD
delay
,
WORD
count
);
extern
SEGPTR
DOSDEV_GetLOL
(
BOOL
v86
);
/* dma.c */
extern
int
DMA_Transfer
(
int
channel
,
int
reqlength
,
void
*
buffer
);
...
...
dlls/winedos/dosvm.c
View file @
e9836523
...
...
@@ -48,9 +48,6 @@
#include "wincon.h"
#include "thread.h"
#include "msdos.h"
#include "file.h"
#include "miscemu.h"
#include "dosexe.h"
#include "dosvm.h"
#include "wine/debug.h"
...
...
dlls/winedos/fpu.c
View file @
e9836523
...
...
@@ -20,8 +20,7 @@
*/
#include <stdlib.h>
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int11.c
View file @
e9836523
...
...
@@ -29,9 +29,7 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "miscemu.h"
#include "msdos.h"
#include "file.h"
#include "dosexe.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
dlls/winedos/int12.c
View file @
e9836523
...
...
@@ -2,7 +2,7 @@
* BIOS interrupt 12h handler
*/
#include "
miscemu
.h"
#include "
dosexe
.h"
/**********************************************************************
* DOSVM_Int12Handler (WINEDOS16.118)
...
...
dlls/winedos/int13.c
View file @
e9836523
...
...
@@ -19,9 +19,6 @@
*/
#include "config.h"
#include "miscemu.h"
#include "wine/debug.h"
#include "drive.h"
#include <stdlib.h>
#include <sys/types.h>
...
...
@@ -37,6 +34,10 @@
# include <linux/fd.h>
#endif
#include "dosexe.h"
#include "wine/debug.h"
#include "drive.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int15.c
View file @
e9836523
...
...
@@ -19,7 +19,7 @@
*/
#include <stdlib.h>
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
#include "wine/winbase16.h"
...
...
dlls/winedos/int17.c
View file @
e9836523
...
...
@@ -23,9 +23,8 @@
#include "windef.h"
#include "winbase.h"
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
#include "msdos.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int21.c
View file @
e9836523
...
...
@@ -37,8 +37,6 @@
#include "winternl.h"
#include "wine/winbase16.h"
#include "dosexe.h"
#include "miscemu.h"
#include "msdos.h"
#include "file.h"
#include "task.h"
#include "winerror.h"
...
...
@@ -168,8 +166,85 @@ struct XFCB {
BYTE
fcb
[
37
];
};
/* DTA layout for FindFirst/FindNext */
typedef
struct
{
BYTE
drive
;
/* 00 drive letter */
char
mask
[
11
];
/* 01 search template */
BYTE
search_attr
;
/* 0c search attributes */
WORD
count
;
/* 0d entry count within directory */
WORD
cluster
;
/* 0f cluster of parent directory */
WCHAR
*
fullPath
;
/* 11 full path (was: reserved) */
BYTE
fileattr
;
/* 15 file attributes */
WORD
filetime
;
/* 16 file time */
WORD
filedate
;
/* 18 file date */
DWORD
filesize
;
/* 1a file size */
char
filename
[
13
];
/* 1e file name + extension */
}
FINDFILE_DTA
;
/* FCB layout for FindFirstFCB/FindNextFCB */
typedef
struct
{
BYTE
drive
;
/* 00 drive letter */
char
filename
[
11
];
/* 01 filename 8+3 format */
int
count
;
/* 0c entry count (was: reserved) */
WCHAR
*
fullPath
;
/* 10 full path (was: reserved) */
}
FINDFILE_FCB
;
/* DOS directory entry for FindFirstFCB/FindNextFCB */
typedef
struct
{
char
filename
[
11
];
/* 00 filename 8+3 format */
BYTE
fileattr
;
/* 0b file attributes */
BYTE
reserved
[
10
];
/* 0c reserved */
WORD
filetime
;
/* 16 file time */
WORD
filedate
;
/* 18 file date */
WORD
cluster
;
/* 1a file first cluster */
DWORD
filesize
;
/* 1c file size */
}
DOS_DIRENTRY_LAYOUT
;
#include "poppack.h"
/* dos file attributes */
#define FA_NORMAL 0x00
/* Normal file, no attributes */
#define FA_RDONLY 0x01
/* Read only attribute */
#define FA_HIDDEN 0x02
/* Hidden file */
#define FA_SYSTEM 0x04
/* System file */
#define FA_LABEL 0x08
/* Volume label */
#define FA_DIRECTORY 0x10
/* Directory */
#define FA_ARCHIVE 0x20
/* Archive */
#define FA_UNUSED 0x40
/* Unused */
/* Error codes */
#define ER_NoNetwork 0x49
/* Error classes */
#define EC_OutOfResource 0x01
#define EC_Temporary 0x02
#define EC_AccessDenied 0x03
#define EC_InternalError 0x04
#define EC_HardwareFailure 0x05
#define EC_SystemFailure 0x06
#define EC_ProgramError 0x07
#define EC_NotFound 0x08
#define EC_MediaError 0x0b
#define EC_Exists 0x0c
#define EC_Unknown 0x0d
/* Suggested actions */
#define SA_Retry 0x01
#define SA_DelayedRetry 0x02
#define SA_Abort 0x04
#define SA_Ignore 0x06
#define SA_Ask4Retry 0x07
/* Error locus */
#define EL_Unknown 0x01
#define EL_Disk 0x02
#define EL_Network 0x03
#define EL_Serial 0x04
#define EL_Memory 0x05
/* Many calls translate a drive argument like this:
drive number (00h = default, 01h = A:, etc)
...
...
@@ -2121,6 +2196,12 @@ static void INT21_GetPSP( CONTEXT86 *context )
SET_BX
(
context
,
DOSVM_psp
);
}
static
inline
void
setword
(
BYTE
*
ptr
,
WORD
w
)
{
ptr
[
0
]
=
(
BYTE
)
w
;
ptr
[
1
]
=
(
BYTE
)(
w
>>
8
);
}
static
void
CreateBPB
(
int
drive
,
BYTE
*
data
,
BOOL16
limited
)
/* limited == TRUE is used with INT 0x21/0x440d */
{
...
...
@@ -2497,9 +2578,7 @@ static void INT21_Ioctl( CONTEXT86 *context )
}
else
{
DOSMEM_LOL
()
->
sharing_retry_delay
=
CX_reg
(
context
);
if
(
DX_reg
(
context
))
DOSMEM_LOL
()
->
sharing_retry_count
=
DX_reg
(
context
);
DOSDEV_SetSharingRetry
(
CX_reg
(
context
),
DX_reg
(
context
)
);
RESET_CFLAG
(
context
);
}
break
;
...
...
@@ -3163,7 +3242,7 @@ static void INT21_GetExtendedError( CONTEXT86 *context )
action
=
SA_Abort
;
locus
=
EL_Disk
;
break
;
case
ER
_GeneralFailure
:
case
ER
ROR_GEN_FAILURE
:
class
=
EC_SystemFailure
;
action
=
SA_Abort
;
locus
=
EL_Unknown
;
...
...
@@ -4611,15 +4690,8 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context )
break
;
case
0x52
:
/* "SYSVARS" - GET LIST OF LISTS */
if
(
!
ISV86
(
context
)
&&
DOSVM_IsWin16
())
{
SEGPTR
ptr
=
DOSMEM_LOL
()
->
wine_pm_lol
;
context
->
SegEs
=
SELECTOROF
(
ptr
);
SET_BX
(
context
,
OFFSETOF
(
ptr
)
);
}
else
{
SEGPTR
ptr
=
DOS
MEM_LOL
()
->
wine_rm_lol
;
SEGPTR
ptr
=
DOS
DEV_GetLOL
(
ISV86
(
context
)
||
!
DOSVM_IsWin16
()
)
;
context
->
SegEs
=
SELECTOROF
(
ptr
);
SET_BX
(
context
,
OFFSETOF
(
ptr
)
);
}
...
...
dlls/winedos/int25.c
View file @
e9836523
...
...
@@ -26,8 +26,7 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "drive.h"
#include "wine/debug.h"
...
...
dlls/winedos/int26.c
View file @
e9836523
...
...
@@ -25,8 +25,7 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "drive.h"
#include "wine/debug.h"
...
...
dlls/winedos/int2a.c
View file @
e9836523
...
...
@@ -3,8 +3,7 @@
*/
#include <stdlib.h>
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int31.c
View file @
e9836523
...
...
@@ -27,9 +27,7 @@
#include "winbase.h"
#include "wine/winbase16.h"
#include "wownt32.h"
#include "miscemu.h"
#include "task.h"
#include "msdos.h"
#include "dosexe.h"
#include "excpt.h"
...
...
dlls/winedos/int41.c
View file @
e9836523
...
...
@@ -21,7 +21,7 @@
*/
#include <stdio.h>
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int4b.c
View file @
e9836523
...
...
@@ -3,7 +3,7 @@
*/
#include <stdio.h>
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/int5c.c
View file @
e9836523
...
...
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
...
...
dlls/winedos/vxd.c
View file @
e9836523
...
...
@@ -41,11 +41,9 @@
#include "ntstatus.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "msdos.h"
#include "miscemu.h"
#include "dosexe.h"
#include "selectors.h"
#include "task.h"
#include "file.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vxd
);
...
...
dlls/winedos/xms.c
View file @
e9836523
...
...
@@ -30,7 +30,7 @@
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "
miscemu
.h"
#include "
dosexe
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int31
);
...
...
files/directory.c
View file @
e9836523
...
...
@@ -47,7 +47,6 @@
#include "wine/unicode.h"
#include "drive.h"
#include "file.h"
#include "msdos.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dosfs
);
...
...
files/dos_fs.c
View file @
e9836523
...
...
@@ -53,7 +53,6 @@
#include "wine/winbase16.h"
#include "drive.h"
#include "file.h"
#include "msdos.h"
#include "winternl.h"
#include "wine/server.h"
#include "excpt.h"
...
...
files/drive.c
View file @
e9836523
...
...
@@ -69,7 +69,6 @@
#include "ntddcdrm.h"
#include "drive.h"
#include "file.h"
#include "msdos.h"
#include "task.h"
#include "wine/unicode.h"
#include "wine/library.h"
...
...
files/file.c
View file @
e9836523
...
...
@@ -69,10 +69,8 @@
#include "drive.h"
#include "file.h"
#include "heap.h"
#include "msdos.h"
#include "wincon.h"
#include "
../kernel/
kernel_private.h"
#include "kernel_private.h"
#include "smb.h"
#include "wine/unicode.h"
...
...
include/miscemu.h
View file @
e9836523
...
...
@@ -104,78 +104,4 @@ extern LPVOID DOSMEM_MapRealToLinear(DWORD); /* real-mode to linear */
extern
LPVOID
DOSMEM_MapDosToLinear
(
UINT
);
/* linear DOS to Wine */
extern
UINT
DOSMEM_MapLinearToDos
(
LPVOID
);
/* linear Wine to DOS */
#define PTR_REAL_TO_LIN(seg,off) \
((void*)(((unsigned int)(seg) << 4) + LOWORD(off)))
/* NOTE: Interrupts might get called from four modes: real mode, 16-bit,
* 32-bit segmented (DPMI32) and 32-bit linear (via DeviceIoControl).
* For automatic conversion of pointer
* parameters, interrupt handlers should use CTX_SEG_OFF_TO_LIN with
* the contents of a segment register as second and the contents of
* a *32-bit* general register as third parameter, e.g.
* CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EDX_reg(context) )
* This will generate a linear pointer in all three cases:
* Real-Mode: Seg*16 + LOWORD(Offset)
* 16-bit: convert (Seg, LOWORD(Offset)) to linear
* 32-bit segmented: convert (Seg, Offset) to linear
* 32-bit linear: use Offset as linear address (DeviceIoControl!)
*
* Real-mode is recognized by checking the V86 bit in the flags register,
* 32-bit linear mode is recognized by checking whether 'seg' is
* a system selector (0 counts also as 32-bit segment) and 32-bit
* segmented mode is recognized by checking whether 'seg' is 32-bit
* selector which is neither system selector nor zero.
*/
#define CTX_SEG_OFF_TO_LIN(context,seg,off) \
(ISV86(context) ? PTR_REAL_TO_LIN((seg),(off)) : wine_ldt_get_ptr((seg),(off)))
#define INT_BARF(context,num) \
ERR( "int%x: unknown/not implemented parameters:\n" \
"int%x: AX %04x, BX %04x, CX %04x, DX %04x, " \
"SI %04x, DI %04x, DS %04x, ES %04x\n", \
(num), (num), LOWORD((context)->Eax), LOWORD((context)->Ebx), \
LOWORD((context)->Ecx), LOWORD((context)->Edx), LOWORD((context)->Esi), \
LOWORD((context)->Edi), (WORD)(context)->SegDs, (WORD)(context)->SegEs )
/* Macros for easier access to i386 context registers */
#define AX_reg(context) ((WORD)(context)->Eax)
#define BX_reg(context) ((WORD)(context)->Ebx)
#define CX_reg(context) ((WORD)(context)->Ecx)
#define DX_reg(context) ((WORD)(context)->Edx)
#define SI_reg(context) ((WORD)(context)->Esi)
#define DI_reg(context) ((WORD)(context)->Edi)
#define AL_reg(context) ((BYTE)(context)->Eax)
#define AH_reg(context) ((BYTE)((context)->Eax >> 8))
#define BL_reg(context) ((BYTE)(context)->Ebx)
#define BH_reg(context) ((BYTE)((context)->Ebx >> 8))
#define CL_reg(context) ((BYTE)(context)->Ecx)
#define CH_reg(context) ((BYTE)((context)->Ecx >> 8))
#define DL_reg(context) ((BYTE)(context)->Edx)
#define DH_reg(context) ((BYTE)((context)->Edx >> 8))
#define SET_CFLAG(context) ((context)->EFlags |= 0x0001)
#define RESET_CFLAG(context) ((context)->EFlags &= ~0x0001)
#define SET_ZFLAG(context) ((context)->EFlags |= 0x0040)
#define RESET_ZFLAG(context) ((context)->EFlags &= ~0x0040)
#define ISV86(context) ((context)->EFlags & 0x00020000)
#define SET_AX(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xffff) | (WORD)(val)))
#define SET_BX(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xffff) | (WORD)(val)))
#define SET_CX(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xffff) | (WORD)(val)))
#define SET_DX(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xffff) | (WORD)(val)))
#define SET_SI(context,val) ((void)((context)->Esi = ((context)->Esi & ~0xffff) | (WORD)(val)))
#define SET_DI(context,val) ((void)((context)->Edi = ((context)->Edi & ~0xffff) | (WORD)(val)))
#define SET_AL(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff) | (BYTE)(val)))
#define SET_BL(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff) | (BYTE)(val)))
#define SET_CL(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff) | (BYTE)(val)))
#define SET_DL(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff) | (BYTE)(val)))
#define SET_AH(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_BH(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_CH(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff00) | (((BYTE)(val)) << 8)))
#define SET_DH(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff00) | (((BYTE)(val)) << 8)))
#endif
/* __WINE_MISCEMU_H */
include/msdos.h
deleted
100644 → 0
View file @
97657b1d
/*
* Copyright 1994 Erik Bos
* Copyright 1999 Ove Kaaven
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_MSDOS_H
#define __WINE_MSDOS_H
#include <wine/windef16.h>
#include <pshpack1.h>
struct
fcb
{
BYTE
drive
;
char
name
[
8
];
char
extension
[
3
];
BYTE
dummy1
[
4
];
int
filesize
;
WORD
date_write
;
WORD
time_write
;
struct
dosdirent
*
directory
;
BYTE
dummy2
[
9
];
};
/* DTA layout for FindFirst/FindNext */
typedef
struct
{
BYTE
drive
;
/* 00 drive letter */
char
mask
[
11
];
/* 01 search template */
BYTE
search_attr
;
/* 0c search attributes */
WORD
count
;
/* 0d entry count within directory */
WORD
cluster
;
/* 0f cluster of parent directory */
WCHAR
*
fullPath
;
/* 11 full path (was: reserved) */
BYTE
fileattr
;
/* 15 file attributes */
WORD
filetime
;
/* 16 file time */
WORD
filedate
;
/* 18 file date */
DWORD
filesize
;
/* 1a file size */
char
filename
[
13
];
/* 1e file name + extension */
}
FINDFILE_DTA
;
/* FCB layout for FindFirstFCB/FindNextFCB */
typedef
struct
{
BYTE
drive
;
/* 00 drive letter */
char
filename
[
11
];
/* 01 filename 8+3 format */
int
count
;
/* 0c entry count (was: reserved) */
WCHAR
*
fullPath
;
/* 10 full path (was: reserved) */
}
FINDFILE_FCB
;
/* DOS directory entry for FindFirstFCB/FindNextFCB */
typedef
struct
{
char
filename
[
11
];
/* 00 filename 8+3 format */
BYTE
fileattr
;
/* 0b file attributes */
BYTE
reserved
[
10
];
/* 0c reserved */
WORD
filetime
;
/* 16 file time */
WORD
filedate
;
/* 18 file date */
WORD
cluster
;
/* 1a file first cluster */
DWORD
filesize
;
/* 1c file size */
}
DOS_DIRENTRY_LAYOUT
;
typedef
struct
{
DWORD
next_dev
;
WORD
attr
;
WORD
strategy
;
WORD
interrupt
;
char
name
[
8
];
}
DOS_DEVICE_HEADER
;
/* Warning: need to return LOL ptr w/ offset 0 (&ptr_first_DPB) to programs ! */
typedef
struct
_DOS_LISTOFLISTS
{
WORD
CX_Int21_5e01
;
/* -24d contents of CX from INT 21/AX=5E01h */
WORD
LRU_count_FCB_cache
;
/* -22d */
WORD
LRU_count_FCB_open
;
/* -20d */
DWORD
OEM_func_handler
;
/* -18d OEM function of INT 21/AH=F8h */
WORD
INT21_offset
;
/* -14d offset in DOS CS of code to return from INT 21 call */
WORD
sharing_retry_count
;
/* -12d */
WORD
sharing_retry_delay
;
/* -10d */
DWORD
ptr_disk_buf
;
/* -8d ptr to current disk buf */
WORD
offs_unread_CON
;
/* -4d pointer in DOS data segment of unread CON input */
WORD
seg_first_MCB
;
/* -2d */
DWORD
ptr_first_DPB
;
/* 00 */
DWORD
ptr_first_SysFileTable
;
/* 04 */
DWORD
ptr_clock_dev_hdr
;
/* 08 */
DWORD
ptr_CON_dev_hdr
;
/* 0C */
WORD
max_byte_per_sec
;
/* 10 maximum bytes per sector of any block device */
DWORD
ptr_disk_buf_info
;
/* 12 */
DWORD
ptr_array_CDS
;
/* 16 current directory structure */
DWORD
ptr_sys_FCB
;
/* 1A */
WORD
nr_protect_FCB
;
/* 1E */
BYTE
nr_block_dev
;
/* 20 */
BYTE
nr_avail_drive_letters
;
/* 21 */
DOS_DEVICE_HEADER
NUL_dev
;
/* 22 */
BYTE
nr_drives_JOINed
;
/* 34 */
WORD
ptr_spec_prg_names
;
/* 35 */
DWORD
ptr_SETVER_prg_list
;
/* 37 */
WORD
DOS_HIGH_A20_func_offs
;
/* 3B */
WORD
PSP_last_exec
;
/* 3D if DOS in HMA: PSP of program executed last; if DOS low: 0000h */
WORD
BUFFERS_val
;
/* 3F */
WORD
BUFFERS_nr_lookahead
;
/* 41 */
BYTE
boot_drive
;
/* 43 */
BYTE
flag_DWORD_moves
;
/* 44 01h for 386+, 00h otherwise */
WORD
size_extended_mem
;
/* 45 size of extended mem in KB */
SEGPTR
wine_rm_lol
;
/* -- wine: Real mode pointer to LOL */
SEGPTR
wine_pm_lol
;
/* -- wine: Protected mode pointer to LOL */
}
DOS_LISTOFLISTS
;
#include <poppack.h>
#define MAX_DOS_DRIVES 26
#define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
*((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
} while(0)
/* dos file attributes */
#define FA_NORMAL 0x00
/* Normal file, no attributes */
#define FA_RDONLY 0x01
/* Read only attribute */
#define FA_HIDDEN 0x02
/* Hidden file */
#define FA_SYSTEM 0x04
/* System file */
#define FA_LABEL 0x08
/* Volume label */
#define FA_DIRECTORY 0x10
/* Directory */
#define FA_ARCHIVE 0x20
/* Archive */
#define FA_UNUSED 0x40
/* Unused */
/* Error codes */
#define ER_NoError 0x00
#define ER_InvalidFunction 0x01
#define ER_FileNotFound 0x02
#define ER_PathNotFound 0x03
#define ER_TooManyOpenFiles 0x04
#define ER_AccessDenied 0x05
#define ER_InvalidHandle 0x06
#define ER_MCBDestroyed 0x07
#define ER_OutOfMemory 0x08
#define ER_MCBInvalid 0x09
#define ER_EnvironInvalid 0x0a
#define ER_FormatInvalid 0x0b
#define ER_AccessCodeInvalid 0x0c
#define ER_DataInvalid 0x0d
#define ER_InvalidDrive 0x0f
#define ER_CanNotRemoveCwd 0x10
#define ER_NotSameDevice 0x11
#define ER_NoMoreFiles 0x12
#define ER_WriteProtected 0x13
#define ER_UnknownUnit 0x14
#define ER_DriveNotReady 0x15
#define ER_UnknownCommand 0x16
#define ER_CRCError 0x17
#define ER_BadRqLength 0x18
#define ER_SeekError 0x19
#define ER_UnknownMedia 0x1a
#define ER_SectorNotFound 0x1b
#define ER_OutOfPaper 0x1c
#define ER_WriteFault 0x1d
#define ER_ReadFault 0x1e
#define ER_GeneralFailure 0x1f
#define ER_ShareViolation 0x20
#define ER_LockViolation 0x21
#define ER_DiskFull 0x27
#define ER_NoNetwork 0x49
#define ER_FileExists 0x50
#define ER_CanNotMakeDir 0x52
/* Error classes */
#define EC_OutOfResource 0x01
#define EC_Temporary 0x02
#define EC_AccessDenied 0x03
#define EC_InternalError 0x04
#define EC_HardwareFailure 0x05
#define EC_SystemFailure 0x06
#define EC_ProgramError 0x07
#define EC_NotFound 0x08
#define EC_MediaError 0x0b
#define EC_Exists 0x0c
#define EC_Unknown 0x0d
/* Suggested actions */
#define SA_Retry 0x01
#define SA_DelayedRetry 0x02
#define SA_Abort 0x04
#define SA_Ignore 0x06
#define SA_Ask4Retry 0x07
/* Error locus */
#define EL_Unknown 0x01
#define EL_Disk 0x02
#define EL_Network 0x03
#define EL_Serial 0x04
#define EL_Memory 0x05
#endif
/* __WINE_MSDOS_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment