Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
064c7bdb
Commit
064c7bdb
authored
Apr 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix trace pointer returned from RtlGetUnloadEventTraceEx().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4820290a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
loader.c
dlls/ntdll/loader.c
+3
-1
exception.c
dlls/ntdll/tests/exception.c
+21
-5
No files found.
dlls/ntdll/loader.c
View file @
064c7bdb
...
...
@@ -197,6 +197,7 @@ typedef struct _RTL_UNLOAD_EVENT_TRACE
}
RTL_UNLOAD_EVENT_TRACE
,
*
PRTL_UNLOAD_EVENT_TRACE
;
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_MODULE
*
ldr
)
...
...
@@ -213,6 +214,7 @@ static void module_push_unload_trace( const LDR_MODULE *ldr )
ptr
->
ImageName
[
len
/
sizeof
(
*
ptr
->
ImageName
)]
=
0
;
unload_trace_seq
=
(
unload_trace_seq
+
1
)
%
ARRAY_SIZE
(
unload_traces
);
unload_trace_ptr
=
unload_traces
;
}
/*********************************************************************
...
...
@@ -233,7 +235,7 @@ void WINAPI RtlGetUnloadEventTraceEx(ULONG **size, ULONG **count, void **trace)
*
size
=
&
element_size
;
*
count
=
&
element_count
;
*
trace
=
unload_traces
;
*
trace
=
&
unload_trace_ptr
;
}
/*************************************************************************
...
...
dlls/ntdll/tests/exception.c
View file @
064c7bdb
...
...
@@ -3410,21 +3410,20 @@ static void test_suspend_process(void)
static
void
test_unload_trace
(
void
)
{
static
const
WCHAR
imageW
[]
=
{
'm'
,
's'
,
'x'
,
'm'
,
'l'
,
'3'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
RTL_UNLOAD_EVENT_TRACE
*
unload_trace
,
*
ptr
;
RTL_UNLOAD_EVENT_TRACE
*
unload_trace
,
*
*
unload_trace_ex
=
NULL
,
*
ptr
;
ULONG
*
element_size
,
*
element_count
,
size
;
BOOL
found
=
FALSE
;
HMODULE
hmod
;
BOOL
found
;
unload_trace
=
pRtlGetUnloadEventTrace
();
ok
(
unload_trace
!=
NULL
,
"Failed to get unload events pointer.
\n
"
);
if
(
pRtlGetUnloadEventTraceEx
)
{
ptr
=
NULL
;
pRtlGetUnloadEventTraceEx
(
&
element_size
,
&
element_count
,
(
void
**
)
&
ptr
);
pRtlGetUnloadEventTraceEx
(
&
element_size
,
&
element_count
,
(
void
**
)
&
unload_trace_ex
);
ok
(
*
element_size
>=
sizeof
(
*
ptr
),
"Unexpected element size.
\n
"
);
ok
(
*
element_count
==
RTL_UNLOAD_EVENT_TRACE_NUMBER
,
"Unexpected trace element count %u.
\n
"
,
*
element_count
);
ok
(
ptr
!=
NULL
,
"Unexpected pointer %p.
\n
"
,
ptr
);
ok
(
unload_trace_ex
!=
NULL
,
"Unexpected pointer %p.
\n
"
,
unload_trace_ex
);
size
=
*
element_size
;
}
else
...
...
@@ -3434,6 +3433,7 @@ static void test_unload_trace(void)
ok
(
hmod
!=
NULL
,
"Failed to load library.
\n
"
);
FreeLibrary
(
hmod
);
found
=
FALSE
;
ptr
=
unload_trace
;
while
(
ptr
->
BaseAddress
!=
NULL
)
{
...
...
@@ -3445,6 +3445,22 @@ static void test_unload_trace(void)
ptr
=
(
RTL_UNLOAD_EVENT_TRACE
*
)((
char
*
)
ptr
+
size
);
}
ok
(
found
,
"Unloaded module wasn't found.
\n
"
);
if
(
unload_trace_ex
)
{
found
=
FALSE
;
ptr
=
*
unload_trace_ex
;
while
(
ptr
->
BaseAddress
!=
NULL
)
{
if
(
!
lstrcmpW
(
imageW
,
ptr
->
ImageName
))
{
found
=
TRUE
;
break
;
}
ptr
=
(
RTL_UNLOAD_EVENT_TRACE
*
)((
char
*
)
ptr
+
size
);
}
ok
(
found
,
"Unloaded module wasn't found.
\n
"
);
}
}
START_TEST
(
exception
)
...
...
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