Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
23f4b09c
Commit
23f4b09c
authored
25 years ago
by
Ulrich Weigand
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removed broken hack to support shared DLLs (e.g. USER32.DLL) and
replaced it by a somewhat less broken hack :-/
parent
352c9397
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loader/pe_image.c
+36
-0
36 additions, 0 deletions
loader/pe_image.c
scheduler/process.c
+0
-4
0 additions, 4 deletions
scheduler/process.c
with
36 additions
and
4 deletions
loader/pe_image.c
+
36
−
0
View file @
23f4b09c
...
...
@@ -553,6 +553,35 @@ HMODULE PE_LoadImage( HFILE hFile, OFSTRUCT *ofs, LPCSTR *modName )
ofs
->
szPathName
,
aoep
,
lowest_va
);
/* FIXME: Hack! While we don't really support shared sections yet,
* this checks for those special cases where the whole DLL
* consists only of shared sections and is mapped into the
* shared address space > 2GB. In this case, we assume that
* the module got mapped at its base address. Thus we simply
* check whether the module has actually been mapped there
* and use it, if so. This is needed to get Win95 USER32.DLL
* to work (until we support shared sections properly).
*/
if
(
nt
->
OptionalHeader
.
ImageBase
&
0x80000000
)
{
HMODULE
sharedMod
=
(
HMODULE
)
nt
->
OptionalHeader
.
ImageBase
;
IMAGE_NT_HEADERS
*
sharedNt
=
(
LPBYTE
)
sharedMod
+
((
LPBYTE
)
nt
-
(
LPBYTE
)
hModule
);
/* Well, this check is not really comprehensive,
but should be good enough for now ... */
if
(
!
IsBadReadPtr
(
(
LPBYTE
)
sharedMod
,
sizeof
(
IMAGE_DOS_HEADER
)
)
&&
memcmp
(
(
LPBYTE
)
sharedMod
,
(
LPBYTE
)
hModule
,
sizeof
(
IMAGE_DOS_HEADER
)
)
==
0
&&
!
IsBadReadPtr
(
sharedNt
,
sizeof
(
IMAGE_NT_HEADERS
)
)
&&
memcmp
(
sharedNt
,
nt
,
sizeof
(
IMAGE_NT_HEADERS
)
)
==
0
)
{
UnmapViewOfFile
(
(
LPVOID
)
hModule
);
return
sharedMod
;
}
}
/* Allocate memory for module */
load_addr
=
nt
->
OptionalHeader
.
ImageBase
;
vma_size
=
calc_vma_size
(
hModule
);
...
...
@@ -576,6 +605,13 @@ HMODULE PE_LoadImage( HFILE hFile, OFSTRUCT *ofs, LPCSTR *modName )
goto
error
;
}
/* FIXME: If we need to relocate a system DLL (base > 2GB) we should
* really make sure that the *new* base address is also > 2GB.
* Some DLLs really check the MSB of the module handle :-/
*/
if
(
nt
->
OptionalHeader
.
ImageBase
&
0x80000000
)
ERR_
(
win32
)(
"Forced to relocate system DLL (base > 2GB). This is not good.
\n
"
);
load_addr
=
(
DWORD
)
VirtualAlloc
(
NULL
,
vma_size
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
...
...
This diff is collapsed.
Click to expand it.
scheduler/process.c
+
0
−
4
View file @
23f4b09c
...
...
@@ -421,10 +421,6 @@ void PROCESS_Start(void)
else
type
=
PROC_WIN32
;
/* Map system DLLs into this process (from initial process) */
/* FIXME: this is a hack */
pdb
->
modref_list
=
PROCESS_Initial
()
->
modref_list
;
/* Initialize the critical section */
InitializeCriticalSection
(
&
pdb
->
crit_section
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment