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
32bc5695
Commit
32bc5695
authored
Feb 16, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Unload overlapping modules in SymLoadModule*().
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
5654af81
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
module.c
dlls/dbghelp/module.c
+7
-13
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+0
-4
No files found.
dlls/dbghelp/module.c
View file @
32bc5695
...
@@ -992,17 +992,10 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
...
@@ -992,17 +992,10 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
}
}
if
(
altmodule
)
if
(
altmodule
)
{
{
/* we have a conflict as the new module cannot be found by its base address
/* We have a conflict as the new module cannot be found by its base address
* we need to get rid of one on the two modules
* (it's hidden by altmodule).
* We need to decide which one the two modules we need to get rid of.
*/
*/
if
(
lstrcmpW
(
module
->
modulename
,
altmodule
->
modulename
)
!=
0
)
{
/* module overlaps an existing but different module... unload new module and return error */
WARN
(
"%ls overlaps %ls
\n
"
,
module
->
modulename
,
altmodule
->
modulename
);
module_remove
(
pcs
,
module
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
/* loading same module at same address... don't change anything */
/* loading same module at same address... don't change anything */
if
(
module
->
module
.
BaseOfImage
==
altmodule
->
module
.
BaseOfImage
)
if
(
module
->
module
.
BaseOfImage
==
altmodule
->
module
.
BaseOfImage
)
{
{
...
@@ -1010,9 +1003,10 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
...
@@ -1010,9 +1003,10 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
SetLastError
(
ERROR_SUCCESS
);
SetLastError
(
ERROR_SUCCESS
);
return
0
;
return
0
;
}
}
/* replace old module with new one, which will look like a shift of base address */
/* replace old module with new one */
WARN
(
"Shift module %ls from %I64x to %I64x
\n
"
,
WARN
(
"Replace module %ls at %I64x by module %ls at %I64x
\n
"
,
module
->
modulename
,
altmodule
->
module
.
BaseOfImage
,
module
->
module
.
BaseOfImage
);
altmodule
->
module
.
ImageName
,
altmodule
->
module
.
BaseOfImage
,
module
->
module
.
ImageName
,
module
->
module
.
BaseOfImage
);
module_remove
(
pcs
,
altmodule
);
module_remove
(
pcs
,
altmodule
);
}
}
...
...
dlls/dbghelp/tests/dbghelp.c
View file @
32bc5695
...
@@ -456,7 +456,6 @@ static void test_modules_overlap(void)
...
@@ -456,7 +456,6 @@ static void test_modules_overlap(void)
}
}
else
else
{
{
todo_wine_if
(
i
==
6
||
i
==
7
)
ok
(
base
==
tests
[
i
].
input
.
base
,
"SymLoadModuleEx failed: %lu
\n
"
,
GetLastError
());
ok
(
base
==
tests
[
i
].
input
.
base
,
"SymLoadModuleEx failed: %lu
\n
"
,
GetLastError
());
}
}
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
tests
[
i
].
outputs
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
tests
[
i
].
outputs
);
j
++
)
...
@@ -471,13 +470,10 @@ static void test_modules_overlap(void)
...
@@ -471,13 +470,10 @@ static void test_modules_overlap(void)
break
;
break
;
}
}
ok
(
nth
.
index
==
-
1
,
"Expecting more modules
\n
"
);
ok
(
nth
.
index
==
-
1
,
"Expecting more modules
\n
"
);
todo_wine_if
(
i
==
6
||
i
==
7
)
ok
(
nth
.
module
.
BaseOfImage
==
tests
[
i
].
outputs
[
j
].
base
,
"Wrong base
\n
"
);
ok
(
nth
.
module
.
BaseOfImage
==
tests
[
i
].
outputs
[
j
].
base
,
"Wrong base
\n
"
);
if
(
!
nth
.
will_fail
)
if
(
!
nth
.
will_fail
)
{
{
todo_wine_if
(
i
==
7
)
ok
(
nth
.
module
.
ImageSize
==
tests
[
i
].
outputs
[
j
].
size
,
"Wrong size
\n
"
);
ok
(
nth
.
module
.
ImageSize
==
tests
[
i
].
outputs
[
j
].
size
,
"Wrong size
\n
"
);
todo_wine_if
(
i
==
6
||
i
==
7
)
ok
(
!
strcasecmp
(
nth
.
module
.
ModuleName
,
tests
[
i
].
outputs
[
j
].
name
),
"Wrong name
\n
"
);
ok
(
!
strcasecmp
(
nth
.
module
.
ModuleName
,
tests
[
i
].
outputs
[
j
].
name
),
"Wrong name
\n
"
);
}
}
}
}
...
...
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