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
5431409b
Commit
5431409b
authored
Apr 23, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlGetUnloadEventTrace()/RtlGetUnloadEventTraceEx().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
91763843
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
40 deletions
+53
-40
loader.c
dlls/ntdll/loader.c
+53
-0
rtl.c
dlls/ntdll/rtl.c
+0
-33
exception.c
dlls/ntdll/tests/exception.c
+0
-7
No files found.
dlls/ntdll/loader.c
View file @
5431409b
...
@@ -159,6 +159,57 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
...
@@ -159,6 +159,57 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
while
(
len
--
)
*
dst
++
=
(
unsigned
char
)
*
src
++
;
while
(
len
--
)
*
dst
++
=
(
unsigned
char
)
*
src
++
;
}
}
#define RTL_UNLOAD_EVENT_TRACE_NUMBER 64
typedef
struct
_RTL_UNLOAD_EVENT_TRACE
{
void
*
BaseAddress
;
SIZE_T
SizeOfImage
;
ULONG
Sequence
;
ULONG
TimeDateStamp
;
ULONG
CheckSum
;
WCHAR
ImageName
[
32
];
}
RTL_UNLOAD_EVENT_TRACE
,
*
PRTL_UNLOAD_EVENT_TRACE
;
static
RTL_UNLOAD_EVENT_TRACE
unload_traces
[
RTL_UNLOAD_EVENT_TRACE_NUMBER
];
static
unsigned
int
unload_trace_seq
;
static
void
module_push_unload_trace
(
const
LDR_MODULE
*
ldr
)
{
RTL_UNLOAD_EVENT_TRACE
*
ptr
=
&
unload_traces
[
unload_trace_seq
];
unsigned
int
len
=
min
(
sizeof
(
ptr
->
ImageName
),
ldr
->
BaseDllName
.
Length
);
ptr
->
BaseAddress
=
ldr
->
BaseAddress
;
ptr
->
SizeOfImage
=
ldr
->
SizeOfImage
;
ptr
->
Sequence
=
unload_trace_seq
;
ptr
->
TimeDateStamp
=
ldr
->
TimeDateStamp
;
ptr
->
CheckSum
=
ldr
->
CheckSum
;
memcpy
(
ptr
->
ImageName
,
ldr
->
BaseDllName
.
Buffer
,
len
);
ptr
->
ImageName
[
len
/
sizeof
(
*
ptr
->
ImageName
)]
=
0
;
unload_trace_seq
=
(
unload_trace_seq
+
1
)
%
ARRAY_SIZE
(
unload_traces
);
}
/*********************************************************************
* RtlGetUnloadEventTrace [NTDLL.@]
*/
RTL_UNLOAD_EVENT_TRACE
*
WINAPI
RtlGetUnloadEventTrace
(
void
)
{
return
unload_traces
;
}
/*********************************************************************
* RtlGetUnloadEventTraceEx [NTDLL.@]
*/
void
WINAPI
RtlGetUnloadEventTraceEx
(
ULONG
**
size
,
ULONG
**
count
,
void
**
trace
)
{
static
unsigned
int
element_size
=
sizeof
(
*
unload_traces
);
static
unsigned
int
element_count
=
ARRAY_SIZE
(
unload_traces
);
*
size
=
&
element_size
;
*
count
=
&
element_count
;
*
trace
=
unload_traces
;
}
/*************************************************************************
/*************************************************************************
* call_dll_entry_point
* call_dll_entry_point
...
@@ -3358,6 +3409,8 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
...
@@ -3358,6 +3409,8 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
MODULE_DecRefCount
(
wm
->
deps
[
i
]
);
MODULE_DecRefCount
(
wm
->
deps
[
i
]
);
wm
->
ldr
.
Flags
&=
~
LDR_UNLOAD_IN_PROGRESS
;
wm
->
ldr
.
Flags
&=
~
LDR_UNLOAD_IN_PROGRESS
;
module_push_unload_trace
(
&
wm
->
ldr
);
}
}
}
}
...
...
dlls/ntdll/rtl.c
View file @
5431409b
...
@@ -1657,39 +1657,6 @@ void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE table, void *buffer,
...
@@ -1657,39 +1657,6 @@ void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE table, void *buffer,
FIXME
(
"%p %p %u %p: stub
\n
"
,
table
,
buffer
,
size
,
element
);
FIXME
(
"%p %p %u %p: stub
\n
"
,
table
,
buffer
,
size
,
element
);
}
}
typedef
struct
_RTL_UNLOAD_EVENT_TRACE
{
PVOID
BaseAddress
;
SIZE_T
SizeOfImage
;
ULONG
Sequence
;
ULONG
TimeDateStamp
;
ULONG
CheckSum
;
WCHAR
ImageName
[
32
];
}
RTL_UNLOAD_EVENT_TRACE
,
*
PRTL_UNLOAD_EVENT_TRACE
;
/*********************************************************************
* RtlGetUnloadEventTrace [NTDLL.@]
*/
RTL_UNLOAD_EVENT_TRACE
*
WINAPI
RtlGetUnloadEventTrace
(
void
)
{
FIXME
(
"stub!
\n
"
);
return
NULL
;
}
/*********************************************************************
* RtlGetUnloadEventTraceEx [NTDLL.@]
*/
void
WINAPI
RtlGetUnloadEventTraceEx
(
ULONG
**
size
,
ULONG
**
count
,
void
**
trace
)
{
static
ULONG
dummy_size
,
dummy_count
;
FIXME
(
"(%p, %p, %p): stub!
\n
"
,
size
,
count
,
trace
);
if
(
size
)
*
size
=
&
dummy_size
;
if
(
count
)
*
count
=
&
dummy_count
;
if
(
trace
)
*
trace
=
NULL
;
}
/*********************************************************************
/*********************************************************************
* RtlQueryPackageIdentity [NTDLL.@]
* RtlQueryPackageIdentity [NTDLL.@]
*/
*/
...
...
dlls/ntdll/tests/exception.c
View file @
5431409b
...
@@ -3349,18 +3349,15 @@ static void test_unload_trace(void)
...
@@ -3349,18 +3349,15 @@ static void test_unload_trace(void)
HMODULE
hmod
;
HMODULE
hmod
;
unload_trace
=
pRtlGetUnloadEventTrace
();
unload_trace
=
pRtlGetUnloadEventTrace
();
todo_wine
ok
(
unload_trace
!=
NULL
,
"Failed to get unload events pointer.
\n
"
);
ok
(
unload_trace
!=
NULL
,
"Failed to get unload events pointer.
\n
"
);
if
(
pRtlGetUnloadEventTraceEx
)
if
(
pRtlGetUnloadEventTraceEx
)
{
{
ptr
=
NULL
;
ptr
=
NULL
;
pRtlGetUnloadEventTraceEx
(
&
element_size
,
&
element_count
,
(
void
**
)
&
ptr
);
pRtlGetUnloadEventTraceEx
(
&
element_size
,
&
element_count
,
(
void
**
)
&
ptr
);
todo_wine
{
ok
(
*
element_size
>=
sizeof
(
*
ptr
),
"Unexpected element size.
\n
"
);
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
(
*
element_count
==
RTL_UNLOAD_EVENT_TRACE_NUMBER
,
"Unexpected trace element count %u.
\n
"
,
*
element_count
);
ok
(
ptr
!=
NULL
,
"Unexpected pointer %p.
\n
"
,
ptr
);
ok
(
ptr
!=
NULL
,
"Unexpected pointer %p.
\n
"
,
ptr
);
}
size
=
*
element_size
;
size
=
*
element_size
;
}
}
else
else
...
@@ -3370,8 +3367,6 @@ todo_wine
...
@@ -3370,8 +3367,6 @@ todo_wine
ok
(
hmod
!=
NULL
,
"Failed to load library.
\n
"
);
ok
(
hmod
!=
NULL
,
"Failed to load library.
\n
"
);
FreeLibrary
(
hmod
);
FreeLibrary
(
hmod
);
if
(
unload_trace
)
{
ptr
=
unload_trace
;
ptr
=
unload_trace
;
while
(
ptr
->
BaseAddress
!=
NULL
)
while
(
ptr
->
BaseAddress
!=
NULL
)
{
{
...
@@ -3382,8 +3377,6 @@ if (unload_trace)
...
@@ -3382,8 +3377,6 @@ if (unload_trace)
}
}
ptr
=
(
RTL_UNLOAD_EVENT_TRACE
*
)((
char
*
)
ptr
+
size
);
ptr
=
(
RTL_UNLOAD_EVENT_TRACE
*
)((
char
*
)
ptr
+
size
);
}
}
}
todo_wine
ok
(
found
,
"Unloaded module wasn't found.
\n
"
);
ok
(
found
,
"Unloaded module wasn't found.
\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