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
7129d9f6
Commit
7129d9f6
authored
Nov 25, 1998
by
Ulrich Weigand
Committed by
Alexandre Julliard
Nov 25, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed CTX_SEG_OFF_TO_LIN to allow linear addresses in 32-bit
registers (used by DeviceIoControl). Adapted all users.
parent
12980625
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
85 deletions
+102
-85
miscemu.h
include/miscemu.h
+21
-5
dpmi.c
msdos/dpmi.c
+2
-2
int21.c
msdos/int21.c
+72
-72
int25.c
msdos/int25.c
+2
-2
int26.c
msdos/int26.c
+3
-2
int2f.c
msdos/int2f.c
+1
-1
xms.c
msdos/xms.c
+1
-1
No files found.
include/miscemu.h
View file @
7129d9f6
...
...
@@ -9,6 +9,7 @@
#include <stdio.h>
#include "winnt.h"
#include "ldt.h"
/* msdos/dosmem.c */
extern
HANDLE16
DOSMEM_BiosSeg
;
...
...
@@ -71,12 +72,12 @@ extern void WINAPI INT_Int20Handler(CONTEXT*);
/* msdos/int25.c */
extern
void
WINAPI
INT_Int25Handler
(
CONTEXT
*
);
/* msdos/int26.c */
extern
void
WINAPI
INT_Int26Handler
(
CONTEXT
*
);
/* msdos/int29.c */
extern
void
WINAPI
INT_Int29Handler
(
CONTEXT
*
);
/* msdos/int25.c */
extern
void
WINAPI
INT_Int25Handler
(
CONTEXT
*
);
/* msdos/int2f.c */
extern
void
WINAPI
INT_Int2fHandler
(
CONTEXT
*
);
...
...
@@ -97,9 +98,24 @@ extern BOOL32 SIGNAL_InitEmulator(void);
/* misc/aspi.c */
extern
void
ASPI_DOS_HandleInt
(
CONTEXT
*
context
);
/* NOTE: Interrupts might get called from three modes: real mode, 16-bit, and
* (via DeviceIoControl) 32-bit. For automatic conversion of pointer
* parameters, interrupt handlers should use CTX_SEG_OFF_TO_LIN with
* the contents of a segement 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) + V86BASE
* 16-bit: convert (Seg, LOWORD(Offset)) to linear
* 32-bit: use Offset as linear address (DeviceIoControl!)
*
* Real-mode is recognized by checking the V86 bit in the flags register,
* 32-bit mode is recognized by checking whether 'seg' is a system selector
* (0 counts also as 32-bit segment).
*/
#define CTX_SEG_OFF_TO_LIN(context,seg,off) \
(ISV86(context) ? (void*)(V86BASE(context)+((seg)<<4)+
off)
\
: PTR_SEG_OFF_TO_LIN(seg,o
ff))
(ISV86(context) ? (void*)(V86BASE(context)+((seg)<<4)+
(off&0xffff)) :
\
(!seg || IS_SELECTOR_SYSTEM(seg))? (void *)off : PTR_SEG_OFF_TO_LIN(seg,off&0xff
ff))
#define INT_BARF(context,num) \
fprintf( stderr, "int%x: unknown/not implemented parameters:\n" \
...
...
msdos/dpmi.c
View file @
7129d9f6
...
...
@@ -222,7 +222,7 @@ int DPMI_CallRMProc( CONTEXT *context, LPWORD stack, int args, int iret )
return
1
;
}
}
else
{
stack16
=
CTX_SEG_OFF_TO_LIN
(
context
,
SS_reg
(
context
),
SP_reg
(
context
));
stack16
=
CTX_SEG_OFF_TO_LIN
(
context
,
SS_reg
(
context
),
E
SP_reg
(
context
));
addr
=
NULL
;
/* avoid gcc warning */
}
SP_reg
(
context
)
-=
args
*
sizeof
(
WORD
)
+
(
iret
?
1
:
0
);
...
...
@@ -253,7 +253,7 @@ int DPMI_CallRMProc( CONTEXT *context, LPWORD stack, int args, int iret )
TRACE
(
int31
,
"returned from real-mode call
\n
"
);
if
(
alloc
)
DOSMEM_FreeBlock
(
pModule
->
self
,
addr
);
#else
addr
=
CTX_SEG_OFF_TO_LIN
(
context
,
CS_reg
(
context
),
IP_reg
(
context
));
addr
=
CTX_SEG_OFF_TO_LIN
(
context
,
CS_reg
(
context
),
E
IP_reg
(
context
));
sel
=
SELECTOR_AllocBlock
(
addr
,
0x10000
,
SEGMENT_CODE
,
FALSE
,
FALSE
);
seg_addr
=
PTR_SEG_OFF_TO_SEGPTR
(
sel
,
0
);
...
...
msdos/int21.c
View file @
7129d9f6
...
...
@@ -248,7 +248,7 @@ static void ioctlGetDeviceInfo( CONTEXT *context )
static
BOOL32
ioctlGenericBlkDevReq
(
CONTEXT
*
context
)
{
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
int
drive
=
DOS_GET_DRIVE
(
BL_reg
(
context
)
);
if
(
!
DRIVE_IsValid
(
drive
))
...
...
@@ -397,14 +397,14 @@ char *INT21_DriveName(int drive)
static
BOOL32
INT21_CreateFile
(
CONTEXT
*
context
)
{
AX_reg
(
context
)
=
_lcreat16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
CX_reg
(
context
)
);
E
DX_reg
(
context
)
),
CX_reg
(
context
)
);
return
(
AX_reg
(
context
)
==
(
WORD
)
HFILE_ERROR16
);
}
static
void
OpenExistingFile
(
CONTEXT
*
context
)
{
AX_reg
(
context
)
=
_lopen16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
AX_reg
(
context
)
=
_lopen16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
AL_reg
(
context
)
);
if
(
AX_reg
(
context
)
==
(
WORD
)
HFILE_ERROR16
)
{
...
...
@@ -426,7 +426,7 @@ static void OpenExistingFile( CONTEXT *context )
case 0x30: /* DENYREAD */
TRACE(int21, "(%s): DENYREAD changed to DENYALL\n",
(char *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context),DX_reg(context)));
(char *)CTX_SEG_OFF_TO_LIN(context, DS_reg(context),
E
DX_reg(context)));
case 0x10: /* DENYALL */
lock = LOCK_EX;
break;
...
...
@@ -593,7 +593,7 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context )
static
BOOL32
INT21_ChangeDir
(
CONTEXT
*
context
)
{
int
drive
;
char
*
dirname
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
char
*
dirname
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
TRACE
(
int21
,
"changedir %s
\n
"
,
dirname
);
if
(
dirname
[
0
]
&&
(
dirname
[
1
]
==
':'
))
...
...
@@ -613,7 +613,7 @@ static int INT21_FindFirst( CONTEXT *context )
DOS_FULL_NAME
full_name
;
FINDFILE_DTA
*
dta
=
(
FINDFILE_DTA
*
)
GetCurrentDTA
(
context
);
path
=
(
const
char
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
path
=
(
const
char
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
dta
->
unixPath
=
NULL
;
if
(
!
DOSFS_GetFullName
(
path
,
FALSE
,
&
full_name
))
{
...
...
@@ -686,7 +686,7 @@ static int INT21_FindNext( CONTEXT *context )
static
BOOL32
INT21_CreateTempFile
(
CONTEXT
*
context
)
{
static
int
counter
=
0
;
char
*
name
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
);
char
*
name
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)
);
char
*
p
=
name
+
strlen
(
name
);
/* despite what Ralf Brown says, some programs seem to call without
...
...
@@ -711,7 +711,7 @@ static BOOL32 INT21_CreateTempFile( CONTEXT *context )
static
BOOL32
INT21_GetCurrentDirectory
(
CONTEXT
*
context
)
{
int
drive
=
DOS_GET_DRIVE
(
DL_reg
(
context
)
);
char
*
ptr
=
(
char
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)
);
char
*
ptr
=
(
char
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
SI_reg
(
context
)
);
if
(
!
DRIVE_IsValid
(
drive
))
{
...
...
@@ -741,7 +741,7 @@ static void INT21_GetDBCSLeadTable( CONTEXT *context )
static
int
INT21_GetDiskSerialNumber
(
CONTEXT
*
context
)
{
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
int
drive
=
DOS_GET_DRIVE
(
BL_reg
(
context
)
);
if
(
!
DRIVE_IsValid
(
drive
))
...
...
@@ -760,7 +760,7 @@ static int INT21_GetDiskSerialNumber( CONTEXT *context )
static
int
INT21_SetDiskSerialNumber
(
CONTEXT
*
context
)
{
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
int
drive
=
DOS_GET_DRIVE
(
BL_reg
(
context
)
);
if
(
!
DRIVE_IsValid
(
drive
))
...
...
@@ -779,7 +779,7 @@ static int INT21_SetDiskSerialNumber( CONTEXT *context )
static
int
INT21_FindFirstFCB
(
CONTEXT
*
context
)
{
BYTE
*
fcb
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
BYTE
*
fcb
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
FINDFILE_FCB
*
pFCB
;
LPCSTR
root
,
cwd
;
int
drive
;
...
...
@@ -803,7 +803,7 @@ static int INT21_FindFirstFCB( CONTEXT *context )
static
int
INT21_FindNextFCB
(
CONTEXT
*
context
)
{
BYTE
*
fcb
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
BYTE
*
fcb
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
FINDFILE_FCB
*
pFCB
;
DOS_DIRENTRY_LAYOUT
*
pResult
=
(
DOS_DIRENTRY_LAYOUT
*
)
GetCurrentDTA
(
context
);
WIN32_FIND_DATA32A
entry
;
...
...
@@ -925,7 +925,7 @@ INT21_networkfunc (CONTEXT *context)
switch
(
AL_reg
(
context
))
{
case
0x00
:
/* Get machine name. */
{
char
*
dst
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
char
*
dst
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
TRACE
(
int21
,
"getting machine name to %p
\n
"
,
dst
);
if
(
gethostname
(
dst
,
15
))
{
...
...
@@ -1120,7 +1120,7 @@ void WINAPI DOS3Call( CONTEXT *context )
TRACE
(
int21
,
"WRITE '$'-terminated string from %04lX:%04X to stdout
\n
"
,
DS_reg
(
context
),
DX_reg
(
context
)
);
{
LPSTR
data
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
));
LPSTR
data
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
));
LONG
length
=
strchr
(
data
,
'$'
)
-
data
;
_hwrite16
(
1
,
data
,
length
);
AL_reg
(
context
)
=
'$'
;
/* yes, '$' (0x24) gets returned in AL */
...
...
@@ -1130,7 +1130,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x0a
:
/* BUFFERED INPUT */
{
char
*
buffer
=
((
char
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
));
E
DX_reg
(
context
)
));
int
res
;
TRACE
(
int21
,
"BUFFERED INPUT (size=%d)
\n
"
,
buffer
[
0
]);
...
...
@@ -1173,7 +1173,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x11
:
/* FIND FIRST MATCHING FILE USING FCB */
TRACE
(
int21
,
"FIND FIRST MATCHING FILE USING FCB %p
\n
"
,
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
if
(
!
INT21_FindFirstFCB
(
context
))
{
AL_reg
(
context
)
=
0xff
;
...
...
@@ -1371,35 +1371,35 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x39
:
/* "MKDIR" - CREATE SUBDIRECTORY */
TRACE
(
int21
,
"MKDIR %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
CreateDirectory16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
NULL
));
E
DX_reg
(
context
)
),
NULL
));
break
;
case
0x3a
:
/* "RMDIR" - REMOVE SUBDIRECTORY */
TRACE
(
int21
,
"RMDIR %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
RemoveDirectory16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
)));
E
DX_reg
(
context
)
)));
break
;
case
0x3b
:
/* "CHDIR" - SET CURRENT DIRECTORY */
TRACE
(
int21
,
"CHDIR %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
!
INT21_ChangeDir
(
context
);
break
;
case
0x3c
:
/* "CREAT" - CREATE OR TRUNCATE FILE */
TRACE
(
int21
,
"CREAT flag 0x%02x %s
\n
"
,
CX_reg
(
context
),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
AX_reg
(
context
)
=
_lcreat16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
CX_reg
(
context
)
);
E
DX_reg
(
context
)
),
CX_reg
(
context
)
);
bSetDOSExtendedError
=
(
AX_reg
(
context
)
==
(
WORD
)
HFILE_ERROR16
);
break
;
case
0x3d
:
/* "OPEN" - OPEN EXISTING FILE */
TRACE
(
int21
,
"OPEN mode 0x%02x %s
\n
"
,
AL_reg
(
context
),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
OpenExistingFile
(
context
);
break
;
...
...
@@ -1426,12 +1426,12 @@ void WINAPI DOS3Call( CONTEXT *context )
if
(
ISV86
(
context
))
result
=
_hread16
(
BX_reg
(
context
),
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
E
DX_reg
(
context
)
),
CX_reg
(
context
)
);
else
result
=
WIN16_hread
(
BX_reg
(
context
),
PTR_SEG_OFF_TO_SEGPTR
(
DS_reg
(
context
),
DX_reg
(
context
)
),
E
DX_reg
(
context
)
),
CX_reg
(
context
)
);
if
(
result
==
-
1
)
bSetDOSExtendedError
=
TRUE
;
else
AX_reg
(
context
)
=
(
WORD
)
result
;
...
...
@@ -1444,7 +1444,7 @@ void WINAPI DOS3Call( CONTEXT *context )
{
LONG
result
=
_hwrite16
(
BX_reg
(
context
),
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
E
DX_reg
(
context
)
),
CX_reg
(
context
)
);
if
(
result
==
-
1
)
bSetDOSExtendedError
=
TRUE
;
else
AX_reg
(
context
)
=
(
WORD
)
result
;
...
...
@@ -1453,9 +1453,9 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x41
:
/* "UNLINK" - DELETE FILE */
TRACE
(
int21
,
"UNLINK%s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
DeleteFile32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
)));
E
DX_reg
(
context
)
)));
break
;
case
0x42
:
/* "LSEEK" - SET CURRENT FILE POSITION */
...
...
@@ -1481,25 +1481,25 @@ void WINAPI DOS3Call( CONTEXT *context )
{
case
0x00
:
TRACE
(
int21
,
"GET FILE ATTRIBUTES for %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
AX_reg
(
context
)
=
(
WORD
)
GetFileAttributes32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
E
DX_reg
(
context
)));
if
(
AX_reg
(
context
)
==
0xffff
)
bSetDOSExtendedError
=
TRUE
;
else
CX_reg
(
context
)
=
AX_reg
(
context
);
break
;
case
0x01
:
TRACE
(
int21
,
"SET FILE ATTRIBUTES 0x%02x for %s
\n
"
,
CX_reg
(
context
),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
SetFileAttributes32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
E
DX_reg
(
context
)),
CX_reg
(
context
)
));
break
;
case
0x02
:
TRACE
(
int21
,
"GET COMPRESSED FILE SIZE for %s stub
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
}
break
;
...
...
@@ -1521,7 +1521,7 @@ void WINAPI DOS3Call( CONTEXT *context )
break
;
}
case
0x05
:{
/* IOCTL - WRITE TO BLOCK DEVICE CONTROL CHANNEL */
/*BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, DS_reg(context),DX_reg(context));*/
/*BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, DS_reg(context),
E
DX_reg(context));*/
int
drive
=
DOS_GET_DRIVE
(
BL_reg
(
context
));
FIXME
(
int21
,
"program tried to write to block device control channel of drive %d:
\n
"
,
drive
);
...
...
@@ -1710,9 +1710,9 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x4b
:
/* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */
TRACE
(
int21
,
"EXEC %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)
));
AX_reg
(
context
)
=
WinExec16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
E
DX_reg
(
context
)
),
SW_NORMAL
);
if
(
AX_reg
(
context
)
<
32
)
SET_CFLAG
(
context
);
break
;
...
...
@@ -1729,7 +1729,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x4e
:
/* "FINDFIRST" - FIND FIRST MATCHING FILE */
TRACE
(
int21
,
"FINDFIRST mask 0x%04x spec %s
\n
"
,
CX_reg
(
context
),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
if
(
!
INT21_FindFirst
(
context
))
break
;
/* fall through */
...
...
@@ -1772,11 +1772,11 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x56
:
/* "RENAME" - RENAME FILE */
TRACE
(
int21
,
"RENAME %s to %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
E
DI_reg
(
context
)));
bSetDOSExtendedError
=
(
!
MoveFile32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
))));
(
!
MoveFile32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
E
DI_reg
(
context
))));
break
;
case
0x57
:
/* FILE DATE AND TIME */
...
...
@@ -1833,9 +1833,9 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x5b
:
/* CREATE NEW FILE */
TRACE
(
int21
,
"CREATE NEW FILE 0x%02x for %s
\n
"
,
CX_reg
(
context
),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
((
AX_reg
(
context
)
=
HFILE32_TO_HFILE16
(
_lcreat_uniq
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
0
)))
HFILE32_TO_HFILE16
(
_lcreat_uniq
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
0
)))
==
(
WORD
)
HFILE_ERROR16
);
break
;
...
...
@@ -1882,12 +1882,12 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x60
:
/* "TRUENAME" - CANONICALIZE FILENAME OR PATH */
TRACE
(
int21
,
"TRUENAME %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
SI_reg
(
context
)));
{
if
(
!
GetFullPathName32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)),
128
,
E
SI_reg
(
context
)),
128
,
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
)),
NULL
))
E
DI_reg
(
context
)),
NULL
))
bSetDOSExtendedError
=
TRUE
;
else
AX_reg
(
context
)
=
0
;
}
...
...
@@ -1908,7 +1908,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x65
:{
/* GET EXTENDED COUNTRY INFORMATION */
extern
WORD
WINE_LanguageId
;
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
));
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
E
DI_reg
(
context
));
TRACE
(
int21
,
"GET EXTENDED COUNTRY INFORMATION code page %d country %d
\n
"
,
BX_reg
(
context
),
DX_reg
(
context
));
switch
(
AL_reg
(
context
))
{
...
...
@@ -1984,7 +1984,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x6C
:
/* Extended Open/Create*/
TRACE
(
int21
,
"EXTENDED OPEN/CREATE %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DI_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DI_reg
(
context
)));
bSetDOSExtendedError
=
INT21_ExtendedOpenCreateFile
(
context
);
break
;
...
...
@@ -1999,35 +1999,35 @@ void WINAPI DOS3Call( CONTEXT *context )
{
case
0x39
:
/* Create directory */
TRACE
(
int21
,
"LONG FILENAME - MAKE DIRECTORY %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
CreateDirectory32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
),
NULL
));
E
DX_reg
(
context
)
),
NULL
));
break
;
case
0x3a
:
/* Remove directory */
TRACE
(
int21
,
"LONG FILENAME - REMOVE DIRECTORY %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
bSetDOSExtendedError
=
(
!
RemoveDirectory32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
)));
E
DX_reg
(
context
)
)));
break
;
case
0x43
:
/* Get/Set file attributes */
TRACE
(
int21
,
"LONG FILENAME -EXTENDED GET/SET FILE ATTRIBUTES %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
switch
(
BL_reg
(
context
))
{
case
0x00
:
/* Get file attributes */
TRACE
(
int21
,
"
\t
retrieve attributes
\n
"
);
CX_reg
(
context
)
=
(
WORD
)
GetFileAttributes32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
E
DX_reg
(
context
)));
if
(
CX_reg
(
context
)
==
0xffff
)
bSetDOSExtendedError
=
TRUE
;
break
;
case
0x01
:
TRACE
(
int21
,
"
\t
set attributes 0x%04x
\n
"
,
CX_reg
(
context
));
bSetDOSExtendedError
=
(
!
SetFileAttributes32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
E
DX_reg
(
context
)),
CX_reg
(
context
)
)
);
break
;
default
:
...
...
@@ -2046,12 +2046,12 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x4e
:
/* Find first file */
TRACE
(
int21
,
" LONG FILENAME - FIND FIRST MATCHING FILE for %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
/* FIXME: use attributes in CX */
if
((
AX_reg
(
context
)
=
FindFirstFile16
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
(
WIN32_FIND_DATA32A
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
))))
E
DI_reg
(
context
))))
==
INVALID_HANDLE_VALUE16
)
bSetDOSExtendedError
=
TRUE
;
break
;
...
...
@@ -2060,7 +2060,7 @@ void WINAPI DOS3Call( CONTEXT *context )
BX_reg
(
context
));
if
(
!
FindNextFile16
(
BX_reg
(
context
),
(
WIN32_FIND_DATA32A
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
))))
E
DI_reg
(
context
))))
bSetDOSExtendedError
=
TRUE
;
break
;
case
0xa1
:
/* Find close */
...
...
@@ -2070,7 +2070,7 @@ void WINAPI DOS3Call( CONTEXT *context )
break
;
case
0xa0
:
TRACE
(
int21
,
"LONG FILENAME - GET VOLUME INFORMATION for drive %s stub
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
break
;
case
0x60
:
switch
(
CL_reg
(
context
))
...
...
@@ -2078,18 +2078,18 @@ void WINAPI DOS3Call( CONTEXT *context )
case
0x01
:
/*Get short filename or path */
if
(
!
GetShortPathName32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)),
E
SI_reg
(
context
)),
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
)),
67
))
E
DI_reg
(
context
)),
67
))
bSetDOSExtendedError
=
TRUE
;
else
AX_reg
(
context
)
=
0
;
break
;
case
0x02
:
/*Get canonical long filename or path */
if
(
!
GetFullPathName32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)),
128
,
E
SI_reg
(
context
)),
128
,
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
)),
NULL
))
E
DI_reg
(
context
)),
NULL
))
bSetDOSExtendedError
=
TRUE
;
else
AX_reg
(
context
)
=
0
;
break
;
...
...
@@ -2103,17 +2103,17 @@ void WINAPI DOS3Call( CONTEXT *context )
break
;
case
0x6c
:
/* Create or open file */
TRACE
(
int21
,
"LONG FILENAME - CREATE OR OPEN FILE %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
SI_reg
(
context
)));
/* translate Dos 7 action to Dos 6 action */
bSetDOSExtendedError
=
INT21_ExtendedOpenCreateFile
(
context
);
break
;
case
0x3b
:
/* Change directory */
TRACE
(
int21
,
"LONG FILENAME - CHANGE DIRECTORY %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
if
(
!
SetCurrentDirectory32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)
E
DX_reg
(
context
)
))
)
{
SET_CFLAG
(
context
);
...
...
@@ -2122,10 +2122,10 @@ void WINAPI DOS3Call( CONTEXT *context )
break
;
case
0x41
:
/* Delete file */
TRACE
(
int21
,
"LONG FILENAME - DELETE FILE %s
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)));
if
(
!
DeleteFile32A
(
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
))
E
DX_reg
(
context
))
))
{
SET_CFLAG
(
context
);
AL_reg
(
context
)
=
DOS_ExtendedError
;
...
...
@@ -2133,8 +2133,8 @@ void WINAPI DOS3Call( CONTEXT *context )
break
;
case
0x56
:
/* Move (rename) file */
TRACE
(
int21
,
"LONG FILENAME - RENAME FILE %s to %s stub
\n
"
,
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
DX_reg
(
context
)),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
DI_reg
(
context
)));
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
DX_reg
(
context
)),
(
LPCSTR
)
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
E
DI_reg
(
context
)));
default
:
FIXME
(
int21
,
"Unimplemented long file name function:
\n
"
);
INT_BARF
(
context
,
0x21
);
...
...
msdos/int25.c
View file @
7129d9f6
...
...
@@ -19,7 +19,7 @@
*/
void
WINAPI
INT_Int25Handler
(
CONTEXT
*
context
)
{
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
BX_reg
(
context
)
);
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
BX_reg
(
context
)
);
DWORD
begin
,
length
;
int
fd
;
...
...
@@ -35,7 +35,7 @@ void WINAPI INT_Int25Handler( CONTEXT *context )
begin
=
*
(
DWORD
*
)
dataptr
;
length
=
*
(
WORD
*
)(
dataptr
+
4
);
dataptr
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
*
(
WORD
*
)(
dataptr
+
8
),
*
(
WORD
*
)(
dataptr
+
6
)
);
*
(
WORD
*
)(
dataptr
+
8
),
*
(
D
WORD
*
)(
dataptr
+
6
)
);
}
else
{
...
...
msdos/int26.c
View file @
7129d9f6
...
...
@@ -18,7 +18,7 @@
*/
void
WINAPI
INT_Int26Handler
(
CONTEXT
*
context
)
{
BYTE
*
dataptr
=
PTR_SEG_OFF_TO_LIN
(
DS_reg
(
context
),
BX_reg
(
context
)
);
BYTE
*
dataptr
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
E
BX_reg
(
context
)
);
DWORD
begin
,
length
;
int
fd
;
...
...
@@ -33,7 +33,8 @@ void WINAPI INT_Int26Handler( CONTEXT *context )
{
begin
=
*
(
DWORD
*
)
dataptr
;
length
=
*
(
WORD
*
)(
dataptr
+
4
);
dataptr
=
(
BYTE
*
)
PTR_SEG_TO_LIN
(
*
(
SEGPTR
*
)(
dataptr
+
6
)
);
dataptr
=
(
BYTE
*
)
CTX_SEG_OFF_TO_LIN
(
context
,
*
(
WORD
*
)(
dataptr
+
8
),
*
(
DWORD
*
)(
dataptr
+
6
)
);
}
else
{
...
...
msdos/int2f.c
View file @
7129d9f6
...
...
@@ -370,7 +370,7 @@ void do_mscdex( CONTEXT *context )
break
;
case
0x0D
:
/* get drive letters */
p
=
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
BX_reg
(
context
));
p
=
CTX_SEG_OFF_TO_LIN
(
context
,
ES_reg
(
context
),
E
BX_reg
(
context
));
memset
(
p
,
0
,
MAX_DOS_DRIVES
);
for
(
drive
=
0
;
drive
<
MAX_DOS_DRIVES
;
drive
++
)
{
...
...
msdos/xms.c
View file @
7129d9f6
...
...
@@ -72,7 +72,7 @@ void WINAPI XMS_Handler( CONTEXT *context )
case
0x0b
:
/* Move Extended Memory Block */
{
MOVESTRUCT
*
move
=
CTX_SEG_OFF_TO_LIN
(
context
,
DS_reg
(
context
),
SI_reg
(
context
));
DS_reg
(
context
),
E
SI_reg
(
context
));
BYTE
*
src
,
*
dst
;
TRACE
(
int31
,
"move extended memory block
\n
"
);
src
=
XMS_Offset
(
&
move
->
Source
);
...
...
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