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
f56618a2
Commit
f56618a2
authored
Oct 18, 2004
by
Markus Amsler
Committed by
Alexandre Julliard
Oct 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push on stack in 16 bit mode with segment wrap around.
parent
3be4f5d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
34 deletions
+27
-34
dosexe.h
dlls/winedos/dosexe.h
+5
-0
interrupts.c
dlls/winedos/interrupts.c
+7
-12
relay.c
dlls/winedos/relay.c
+15
-22
No files found.
dlls/winedos/dosexe.h
View file @
f56618a2
...
...
@@ -136,6 +136,11 @@ extern struct DPMI_segments *DOSVM_dpmi_segments;
LOWORD((context)->Ecx), LOWORD((context)->Edx), LOWORD((context)->Esi), \
LOWORD((context)->Edi), (WORD)(context)->SegDs, (WORD)(context)->SegEs )
/* pushing on stack in 16 bit needs segment wrap around */
#define PUSH_WORD16(context,val) \
*((WORD*)CTX_SEG_OFF_TO_LIN((context), \
(context)->SegSs, ADD_LOWORD( context->Esp, -2 ) )) = (val)
/* Macros for easier access to i386 context registers */
#define AX_reg(context) ((WORD)(context)->Eax)
...
...
dlls/winedos/interrupts.c
View file @
f56618a2
...
...
@@ -392,8 +392,6 @@ void DOSVM_HardwareInterruptPM( CONTEXT86 *context, BYTE intnum )
}
else
{
WORD
*
stack
;
TRACE
(
"invoking hooked interrupt %02x at %04x:%04x
\n
"
,
intnum
,
SELECTOROF
(
addr
),
OFFSETOF
(
addr
)
);
...
...
@@ -401,11 +399,9 @@ void DOSVM_HardwareInterruptPM( CONTEXT86 *context, BYTE intnum )
DOSVM_PrepareIRQ
(
context
,
FALSE
);
/* Push the flags and return address on the stack */
stack
=
CTX_SEG_OFF_TO_LIN
(
context
,
context
->
SegSs
,
context
->
Esp
);
*
(
--
stack
)
=
LOWORD
(
context
->
EFlags
);
*
(
--
stack
)
=
context
->
SegCs
;
*
(
--
stack
)
=
LOWORD
(
context
->
Eip
);
ADD_LOWORD
(
context
->
Esp
,
-
6
);
PUSH_WORD16
(
context
,
LOWORD
(
context
->
EFlags
)
);
PUSH_WORD16
(
context
,
context
->
SegCs
);
PUSH_WORD16
(
context
,
LOWORD
(
context
->
Eip
)
);
/* Jump to the interrupt handler */
context
->
SegCs
=
HIWORD
(
addr
);
...
...
@@ -506,7 +502,6 @@ void DOSVM_HardwareInterruptRM( CONTEXT86 *context, BYTE intnum )
else
{
/* the interrupt is hooked, simulate interrupt in DOS space */
WORD
*
stack
=
PTR_REAL_TO_LIN
(
context
->
SegSs
,
context
->
Esp
);
WORD
flag
=
LOWORD
(
context
->
EFlags
);
TRACE
(
"invoking hooked interrupt %02x at %04x:%04x
\n
"
,
...
...
@@ -518,10 +513,10 @@ void DOSVM_HardwareInterruptRM( CONTEXT86 *context, BYTE intnum )
else
flag
&=
~
IF_MASK
;
*
(
--
stack
)
=
flag
;
*
(
--
stack
)
=
context
->
SegCs
;
*
(
--
stack
)
=
LOWORD
(
context
->
Eip
);
context
->
Esp
-=
6
;
PUSH_WORD16
(
context
,
flag
)
;
PUSH_WORD16
(
context
,
context
->
SegCs
)
;
PUSH_WORD16
(
context
,
LOWORD
(
context
->
Eip
)
);
context
->
SegCs
=
SELECTOROF
(
handler
);
context
->
Eip
=
OFFSETOF
(
handler
);
...
...
dlls/winedos/relay.c
View file @
f56618a2
...
...
@@ -168,7 +168,6 @@ void DOSVM_RelayHandler( CONTEXT86 *context )
*/
void
DOSVM_BuildCallFrame
(
CONTEXT86
*
context
,
DOSRELAY
relay
,
LPVOID
data
)
{
WORD
*
stack
;
WORD
code_sel
=
DOSVM_dpmi_segments
->
relay_code_sel
;
/*
...
...
@@ -177,32 +176,26 @@ void DOSVM_BuildCallFrame( CONTEXT86 *context, DOSRELAY relay, LPVOID data )
RELAY_MakeShortContext
(
context
);
/*
* Get stack pointer after RELAY_MakeShortContext.
*/
stack
=
CTX_SEG_OFF_TO_LIN
(
context
,
context
->
SegSs
,
context
->
Esp
);
/*
* Build call frame.
*/
*
(
--
stack
)
=
HIWORD
(
data
);
/* argument.hiword */
*
(
--
stack
)
=
LOWORD
(
data
);
/* argument.loword */
*
(
--
stack
)
=
context
->
SegCs
;
/* STACK16FRAME.cs */
*
(
--
stack
)
=
LOWORD
(
context
->
Eip
);
/* STACK16FRAME.ip */
*
(
--
stack
)
=
LOWORD
(
context
->
Ebp
);
/* STACK16FRAME.bp */
*
(
--
stack
)
=
HIWORD
(
relay
);
/* STACK16FRAME.entry_point.hiword */
*
(
--
stack
)
=
LOWORD
(
relay
);
/* STACK16FRAME.entry_point.loword */
*
(
--
stack
)
=
0
;
/* STACK16FRAME.entry_ip */
*
(
--
stack
)
=
HIWORD
(
RELAY_RelayStub
);
/* STACK16FRAME.relay.hiword */
*
(
--
stack
)
=
LOWORD
(
RELAY_RelayStub
);
/* STACK16FRAME.relay.loword */
*
(
--
stack
)
=
0
;
/* STACK16FRAME.module_cs.hiword */
*
(
--
stack
)
=
code_sel
;
/* STACK16FRAME.module_cs.loword */
*
(
--
stack
)
=
0
;
/* STACK16FRAME.callfrom_ip.hiword */
*
(
--
stack
)
=
0
;
/* STACK16FRAME.callfrom_ip.loword */
PUSH_WORD16
(
context
,
HIWORD
(
data
)
);
/* argument.hiword */
PUSH_WORD16
(
context
,
LOWORD
(
data
)
);
/* argument.loword */
PUSH_WORD16
(
context
,
context
->
SegCs
)
;
/* STACK16FRAME.cs */
PUSH_WORD16
(
context
,
LOWORD
(
context
->
Eip
)
);
/* STACK16FRAME.ip */
PUSH_WORD16
(
context
,
LOWORD
(
context
->
Ebp
)
);
/* STACK16FRAME.bp */
PUSH_WORD16
(
context
,
HIWORD
(
relay
)
);
/* STACK16FRAME.entry_point.hiword */
PUSH_WORD16
(
context
,
LOWORD
(
relay
)
);
/* STACK16FRAME.entry_point.loword */
PUSH_WORD16
(
context
,
0
)
;
/* STACK16FRAME.entry_ip */
PUSH_WORD16
(
context
,
HIWORD
(
RELAY_RelayStub
)
);
/* STACK16FRAME.relay.hiword */
PUSH_WORD16
(
context
,
LOWORD
(
RELAY_RelayStub
)
);
/* STACK16FRAME.relay.loword */
PUSH_WORD16
(
context
,
0
)
;
/* STACK16FRAME.module_cs.hiword */
PUSH_WORD16
(
context
,
code_sel
)
;
/* STACK16FRAME.module_cs.loword */
PUSH_WORD16
(
context
,
0
)
;
/* STACK16FRAME.callfrom_ip.hiword */
PUSH_WORD16
(
context
,
0
)
;
/* STACK16FRAME.callfrom_ip.loword */
/*
* Adjust
stack and code pointers
.
* Adjust
code pointer
.
*/
ADD_LOWORD
(
context
->
Esp
,
-
28
);
context
->
SegCs
=
wine_get_cs
();
context
->
Eip
=
(
DWORD
)
__wine_call_from_16_regs
;
}
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