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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
13 deletions
+30
-13
miscemu.h
include/miscemu.h
+21
-5
dpmi.c
msdos/dpmi.c
+2
-2
int21.c
msdos/int21.c
+0
-0
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
This diff is collapsed.
Click to expand it.
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