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
60a52559
Commit
60a52559
authored
Sep 27, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't apply relocations a second time to self loaded segments.
Fixed messed up indentation in NE_FixupSegmentPrologs.
parent
79b387de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
37 deletions
+38
-37
ne_segment.c
dlls/kernel/ne_segment.c
+38
-37
No files found.
dlls/kernel/ne_segment.c
View file @
60a52559
...
...
@@ -385,16 +385,19 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
0xff00
-
sizeof
(
STACK16FRAME
));
hFile16
=
NE_OpenFile
(
pModule
);
TRACE_
(
dll
)(
"Call
LoadAppSegProc(hmodule=0x%04x,hf=%x,segnum=%d
\n
"
,
TRACE_
(
dll
)(
"Call
LoadAppSegProc(hmodule=0x%04x,hf=%x,segnum=%d)
\n
"
,
pModule
->
self
,
hFile16
,
segnum
);
args
[
2
]
=
pModule
->
self
;
args
[
1
]
=
hFile16
;
args
[
0
]
=
segnum
;
WOWCallback16Ex
(
(
DWORD
)
selfloadheader
->
LoadAppSeg
,
WCB16_PASCAL
,
sizeof
(
args
),
args
,
&
ret
);
pSeg
->
hSeg
=
LOWORD
(
ret
);
TRACE_
(
dll
)(
"Ret CallLoadAppSegProc: hSeg =
0x%04x
\n
"
,
pSeg
->
hSeg
);
TRACE_
(
dll
)(
"Ret LoadAppSegProc: hSeg=
0x%04x
\n
"
,
pSeg
->
hSeg
);
_lclose16
(
hFile16
);
NtCurrentTeb
()
->
WOW32Reserved
=
oldstack
;
pSeg
->
flags
|=
NE_SEGFLAGS_LOADED
;
return
TRUE
;
}
else
if
(
!
(
pSeg
->
flags
&
NE_SEGFLAGS_ITERATED
))
{
...
...
@@ -539,47 +542,45 @@ static void NE_FixupSegmentPrologs(NE_MODULE *pModule, WORD segnum)
bundle
=
(
ET_BUNDLE
*
)((
BYTE
*
)
pModule
+
pModule
->
ne_enttab
);
do
{
TRACE
(
"num_entries: %d, bundle: %p, next: %04x, pSeg: %p
\n
"
,
bundle
->
last
-
bundle
->
first
,
bundle
,
bundle
->
next
,
pSeg
);
if
(
!
(
num_entries
=
bundle
->
last
-
bundle
->
first
))
return
;
entry
=
(
ET_ENTRY
*
)((
BYTE
*
)
bundle
+
6
);
while
(
num_entries
--
)
{
/*TRACE("entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/
if
(
entry
->
segnum
==
segnum
)
{
pFunc
=
((
BYTE
*
)
pSeg
+
entry
->
offs
);
TRACE
(
"pFunc: %p, *(DWORD *)pFunc: %08lx, num_entries: %d
\n
"
,
pFunc
,
*
(
DWORD
*
)
pFunc
,
num_entries
);
if
(
*
(
pFunc
+
2
)
==
0x90
)
TRACE
(
"num_entries: %d, bundle: %p, next: %04x, pSeg: %p
\n
"
,
bundle
->
last
-
bundle
->
first
,
bundle
,
bundle
->
next
,
pSeg
);
if
(
!
(
num_entries
=
bundle
->
last
-
bundle
->
first
))
return
;
entry
=
(
ET_ENTRY
*
)((
BYTE
*
)
bundle
+
6
);
while
(
num_entries
--
)
{
if
(
*
(
WORD
*
)
pFunc
==
0x581e
)
/* push ds, pop ax */
{
TRACE
(
"patch %04x:%04x -> mov ax, ds
\n
"
,
sel
,
entry
->
offs
);
*
(
WORD
*
)
pFunc
=
0xd88c
;
/* mov ax, ds */
}
/*TRACE("entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/
if
(
entry
->
segnum
==
segnum
)
{
pFunc
=
((
BYTE
*
)
pSeg
+
entry
->
offs
);
TRACE
(
"pFunc: %p, *(DWORD *)pFunc: %08lx, num_entries: %d
\n
"
,
pFunc
,
*
(
DWORD
*
)
pFunc
,
num_entries
);
if
(
*
(
pFunc
+
2
)
==
0x90
)
{
if
(
*
(
WORD
*
)
pFunc
==
0x581e
)
/* push ds, pop ax */
{
TRACE
(
"patch %04x:%04x -> mov ax, ds
\n
"
,
sel
,
entry
->
offs
);
*
(
WORD
*
)
pFunc
=
0xd88c
;
/* mov ax, ds */
}
if
(
*
(
WORD
*
)
pFunc
==
0xd88c
)
if
(
*
(
WORD
*
)
pFunc
==
0xd88c
)
{
if
((
entry
->
flags
&
2
))
/* public data ? */
{
if
((
entry
->
flags
&
2
))
/* public data ? */
TRACE
(
"patch %04x:%04x -> mov ax, dgroup [%04x]
\n
"
,
sel
,
entry
->
offs
,
dgroup
);
*
pFunc
=
0xb8
;
/* mov ax, */
*
(
WORD
*
)(
pFunc
+
1
)
=
dgroup
;
}
else
if
((
pModule
->
ne_flags
&
NE_FFLAGS_MULTIPLEDATA
)
&&
(
entry
->
flags
&
1
))
/* exported ? */
{
TRACE
(
"patch %04x:%04x -> mov ax, dgroup [%04x]
\n
"
,
sel
,
entry
->
offs
,
dgroup
);
*
pFunc
=
0xb8
;
/* mov ax, */
*
(
WORD
*
)(
pFunc
+
1
)
=
dgroup
;
}
else
if
((
pModule
->
ne_flags
&
NE_FFLAGS_MULTIPLEDATA
)
&&
(
entry
->
flags
&
1
))
/* exported ? */
{
TRACE
(
"patch %04x:%04x -> nop, nop
\n
"
,
sel
,
entry
->
offs
);
*
(
WORD
*
)
pFunc
=
0x9090
;
/* nop, nop */
}
TRACE
(
"patch %04x:%04x -> nop, nop
\n
"
,
sel
,
entry
->
offs
);
*
(
WORD
*
)
pFunc
=
0x9090
;
/* nop, nop */
}
}
}
}
}
entry
++
;
}
}
while
(
(
bundle
->
next
)
&&
(
bundle
=
((
ET_BUNDLE
*
)((
BYTE
*
)
pModule
+
bundle
->
next
)))
);
entry
++
;
}
}
while
(
(
bundle
->
next
)
&&
(
bundle
=
((
ET_BUNDLE
*
)((
BYTE
*
)
pModule
+
bundle
->
next
)))
);
}
...
...
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