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
47f62a40
Commit
47f62a40
authored
Nov 05, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set %fs and %gs in the register context to their current value when
calling 16-bit code.
parent
83d6e26b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
10 deletions
+25
-10
ne_module.c
dlls/kernel/ne_module.c
+2
-0
ne_segment.c
dlls/kernel/ne_segment.c
+7
-6
system.c
dlls/kernel/system.c
+3
-1
thunk.c
dlls/kernel/thunk.c
+8
-0
int31.c
dlls/winedos/int31.c
+2
-2
winproc.c
windows/winproc.c
+3
-1
No files found.
dlls/kernel/ne_module.c
View file @
47f62a40
...
...
@@ -1463,6 +1463,8 @@ DWORD NE_StartTask(void)
context
.
SegCs
=
GlobalHandleToSel16
(
pSegTable
[
pModule
->
cs
-
1
].
hSeg
);
context
.
SegDs
=
GlobalHandleToSel16
(
pTask
->
hInstance
);
context
.
SegEs
=
pTask
->
hPDB
;
context
.
SegFs
=
wine_get_fs
();
context
.
SegGs
=
wine_get_gs
();
context
.
Eip
=
pModule
->
ip
;
context
.
Ebx
=
pModule
->
stack_size
;
context
.
Ecx
=
pModule
->
heap_size
;
...
...
dlls/kernel/ne_segment.c
View file @
47f62a40
...
...
@@ -670,14 +670,14 @@ static BOOL NE_InitDLL( NE_MODULE *pModule )
context
.
Ecx
=
heap
;
context
.
Edi
=
hInst
;
context
.
SegDs
=
ds
;
context
.
SegEs
=
ds
;
/* who knows ... */
context
.
SegCs
=
SEL
(
pSegTable
[
pModule
->
cs
-
1
].
hSeg
);
context
.
SegDs
=
ds
;
context
.
SegEs
=
ds
;
/* who knows ... */
context
.
SegFs
=
wine_get_fs
();
context
.
SegGs
=
wine_get_gs
();
context
.
SegCs
=
SEL
(
pSegTable
[
pModule
->
cs
-
1
].
hSeg
);
context
.
Eip
=
pModule
->
ip
;
context
.
Ebp
=
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
+
(
WORD
)
&
((
STACK16FRAME
*
)
0
)
->
bp
;
pModule
->
cs
=
0
;
/* Don't initialize it twice */
TRACE_
(
dll
)(
"Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x
\n
"
,
context
.
SegCs
,
context
.
Eip
,
context
.
SegDs
,
...
...
@@ -775,7 +775,8 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
memset
(
&
context
,
0
,
sizeof
(
context
)
);
context
.
SegDs
=
ds
;
context
.
SegEs
=
ds
;
/* who knows ... */
context
.
SegFs
=
wine_get_fs
();
context
.
SegGs
=
wine_get_gs
();
context
.
SegCs
=
HIWORD
(
entryPoint
);
context
.
Eip
=
LOWORD
(
entryPoint
);
context
.
Ebp
=
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
...
...
dlls/kernel/system.c
View file @
47f62a40
...
...
@@ -169,8 +169,10 @@ static void call_timer_proc16( WORD timer )
CONTEXT86
context
;
FARPROC16
proc
=
SYS_Timers
[
timer
-
1
].
callback16
;
memset
(
&
context
,
'\0'
,
sizeof
(
context
)
);
memset
(
&
context
,
0
,
sizeof
(
context
)
);
context
.
SegFs
=
wine_get_fs
();
context
.
SegGs
=
wine_get_gs
();
context
.
SegCs
=
SELECTOROF
(
proc
);
context
.
Eip
=
OFFSETOF
(
proc
);
context
.
Ebp
=
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
...
...
dlls/kernel/thunk.c
View file @
47f62a40
...
...
@@ -349,6 +349,8 @@ void WINAPI QT_Thunk( CONTEXT86 *context )
memcpy
(
&
context16
,
context
,
sizeof
(
context16
));
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
context16
.
SegCs
=
HIWORD
(
context
->
Edx
);
context16
.
Eip
=
LOWORD
(
context
->
Edx
);
/* point EBP to the STACK16FRAME on the stack
...
...
@@ -478,6 +480,8 @@ void WINAPI FT_Thunk( CONTEXT86 *context )
memcpy
(
&
context16
,
context
,
sizeof
(
context16
));
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
context16
.
SegCs
=
HIWORD
(
callTarget
);
context16
.
Eip
=
LOWORD
(
callTarget
);
context16
.
Ebp
=
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
...
...
@@ -690,6 +694,8 @@ void WINAPI Common32ThkLS( CONTEXT86 *context )
memcpy
(
&
context16
,
context
,
sizeof
(
context16
));
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
context16
.
Edi
=
LOWORD
(
context
->
Ecx
);
context16
.
SegCs
=
HIWORD
(
context
->
Eax
);
context16
.
Eip
=
LOWORD
(
context
->
Eax
);
...
...
@@ -747,6 +753,8 @@ void WINAPI OT_32ThkLSF( CONTEXT86 *context )
memcpy
(
&
context16
,
context
,
sizeof
(
context16
));
context16
.
SegFs
=
wine_get_fs
();
context16
.
SegGs
=
wine_get_gs
();
context16
.
SegCs
=
HIWORD
(
context
->
Edx
);
context16
.
Eip
=
LOWORD
(
context
->
Edx
);
context16
.
Ebp
=
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
...
...
dlls/winedos/int31.c
View file @
47f62a40
...
...
@@ -590,8 +590,8 @@ static void StartPM( CONTEXT86 *context )
pm_ctx
.
Edx
=
cs
;
pm_ctx
.
SegDs
=
ds
;
pm_ctx
.
SegEs
=
es
;
pm_ctx
.
SegFs
=
0
;
pm_ctx
.
SegGs
=
0
;
pm_ctx
.
SegFs
=
wine_get_fs
()
;
pm_ctx
.
SegGs
=
wine_get_gs
()
;
pm_ctx
.
EFlags
&=
~
V86_FLAG
;
TRACE
(
"DOS program is now entering %d-bit protected mode
\n
"
,
...
...
windows/winproc.c
View file @
47f62a40
...
...
@@ -252,8 +252,10 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
/* Window procedures want ax = hInstance, ds = es = ss */
memset
(
&
context
,
'\0'
,
sizeof
(
context
));
memset
(
&
context
,
0
,
sizeof
(
context
));
context
.
SegDs
=
context
.
SegEs
=
SELECTOROF
(
teb
->
cur_stack
);
context
.
SegFs
=
wine_get_fs
();
context
.
SegGs
=
wine_get_gs
();
if
(
!
(
context
.
Eax
=
GetWindowWord
(
HWND_32
(
hwnd
),
GWL_HINSTANCE
)))
context
.
Eax
=
context
.
SegDs
;
context
.
SegCs
=
SELECTOROF
(
proc
);
context
.
Eip
=
OFFSETOF
(
proc
);
...
...
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