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
1ab32c6b
Commit
1ab32c6b
authored
Oct 18, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store module check sum in WINE_MODREF.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9913f278
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
loader.c
dlls/ntdll/loader.c
+8
-5
No files found.
dlls/ntdll/loader.c
View file @
1ab32c6b
...
...
@@ -136,6 +136,7 @@ typedef struct _wine_modref
int
alloc_deps
;
int
nDeps
;
struct
_wine_modref
**
deps
;
ULONG
CheckSum
;
}
WINE_MODREF
;
static
UINT
tls_module_count
;
/* number of modules with TLS directory */
...
...
@@ -220,16 +221,17 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER];
static
RTL_UNLOAD_EVENT_TRACE
*
unload_trace_ptr
;
static
unsigned
int
unload_trace_seq
;
static
void
module_push_unload_trace
(
const
LDR_DATA_TABLE_ENTRY
*
ldr
)
static
void
module_push_unload_trace
(
const
WINE_MODREF
*
wm
)
{
RTL_UNLOAD_EVENT_TRACE
*
ptr
=
&
unload_traces
[
unload_trace_seq
];
const
LDR_DATA_TABLE_ENTRY
*
ldr
=
&
wm
->
ldr
;
unsigned
int
len
=
min
(
sizeof
(
ptr
->
ImageName
)
-
sizeof
(
WCHAR
),
ldr
->
BaseDllName
.
Length
);
ptr
->
BaseAddress
=
ldr
->
DllBase
;
ptr
->
SizeOfImage
=
ldr
->
SizeOfImage
;
ptr
->
Sequence
=
unload_trace_seq
;
ptr
->
TimeDateStamp
=
ldr
->
TimeDateStamp
;
ptr
->
CheckSum
=
ldr
->
CheckSum
;
ptr
->
CheckSum
=
wm
->
CheckSum
;
memcpy
(
ptr
->
ImageName
,
ldr
->
BaseDllName
.
Buffer
,
len
);
ptr
->
ImageName
[
len
/
sizeof
(
*
ptr
->
ImageName
)]
=
0
;
...
...
@@ -1222,7 +1224,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
wm
->
ldr
.
Flags
=
LDR_DONT_RESOLVE_REFS
|
(
builtin
?
LDR_WINE_INTERNAL
:
0
);
wm
->
ldr
.
TlsIndex
=
-
1
;
wm
->
ldr
.
LoadCount
=
1
;
wm
->
ldr
.
CheckSum
=
nt
->
OptionalHeader
.
CheckSum
;
wm
->
CheckSum
=
nt
->
OptionalHeader
.
CheckSum
;
wm
->
ldr
.
TimeDateStamp
=
nt
->
FileHeader
.
TimeDateStamp
;
if
(
!
(
buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
nt_name
->
Length
-
3
*
sizeof
(
WCHAR
)
)))
...
...
@@ -2350,7 +2352,8 @@ static WINE_MODREF *find_existing_module( HMODULE module )
{
mod
=
CONTAINING_RECORD
(
entry
,
LDR_DATA_TABLE_ENTRY
,
InMemoryOrderLinks
);
if
(
mod
->
TimeDateStamp
!=
nt
->
FileHeader
.
TimeDateStamp
)
continue
;
if
(
mod
->
CheckSum
!=
nt
->
OptionalHeader
.
CheckSum
)
continue
;
wm
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
if
(
wm
->
CheckSum
!=
nt
->
OptionalHeader
.
CheckSum
)
continue
;
if
(
NtAreMappedFilesTheSame
(
mod
->
DllBase
,
module
)
!=
STATUS_SUCCESS
)
continue
;
return
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
}
...
...
@@ -3592,7 +3595,7 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
wm
->
ldr
.
Flags
&=
~
LDR_UNLOAD_IN_PROGRESS
;
module_push_unload_trace
(
&
wm
->
ldr
);
module_push_unload_trace
(
wm
);
}
}
...
...
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