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
4f2ed66a
Commit
4f2ed66a
authored
Feb 11, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use TEB->ArbitraryUserPointer to store the loaded dll names.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd0a3c1a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
loader.c
dlls/ntdll/loader.c
+5
-0
debugger.c
server/debugger.c
+8
-1
No files found.
dlls/ntdll/loader.c
View file @
4f2ed66a
...
...
@@ -2641,6 +2641,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
HANDLE
mapping
=
0
;
SECTION_IMAGE_INFORMATION
image_info
;
NTSTATUS
nts
;
void
*
prev
;
TRACE
(
"looking for %s in %s
\n
"
,
debugstr_w
(
libname
),
debugstr_w
(
load_path
)
);
...
...
@@ -2662,6 +2663,9 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
main_exe
=
get_modref
(
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
);
loadorder
=
get_load_order
(
main_exe
?
main_exe
->
ldr
.
BaseDllName
.
Buffer
:
NULL
,
&
nt_name
);
prev
=
NtCurrentTeb
()
->
Tib
.
ArbitraryUserPointer
;
NtCurrentTeb
()
->
Tib
.
ArbitraryUserPointer
=
nt_name
.
Buffer
+
4
;
switch
(
nts
)
{
case
STATUS_INVALID_IMAGE_NOT_MZ
:
/* not in PE format, maybe it's a .so file */
...
...
@@ -2748,6 +2752,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
}
break
;
}
NtCurrentTeb
()
->
Tib
.
ArbitraryUserPointer
=
prev
;
done:
if
(
nts
==
STATUS_SUCCESS
)
...
...
server/debugger.c
View file @
4f2ed66a
...
...
@@ -131,6 +131,13 @@ static const struct object_ops debug_obj_ops =
debug_obj_destroy
/* destroy */
};
/* get a pointer to TEB->ArbitraryUserPointer in the client address space */
static
client_ptr_t
get_teb_user_ptr
(
struct
thread
*
thread
)
{
unsigned
int
ptr_size
=
(
CPU_FLAG
(
thread
->
process
->
cpu
)
&
CPU_64BIT_MASK
)
?
8
:
4
;
return
thread
->
teb
+
5
*
ptr_size
;
}
/* routines to build an event according to its type */
...
...
@@ -181,7 +188,7 @@ static void fill_load_dll_event( struct debug_event *event, const void *arg )
event
->
data
.
load_dll
.
dbg_offset
=
image_info
->
dbg_offset
;
event
->
data
.
load_dll
.
dbg_size
=
image_info
->
dbg_size
;
event
->
data
.
load_dll
.
name
=
dll
->
name
;
event
->
data
.
load_dll
.
name
=
get_teb_user_ptr
(
event
->
sender
)
;
event
->
file
=
get_view_file
(
view
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
);
}
...
...
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