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
4bed3d23
Commit
4bed3d23
authored
Feb 26, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Feb 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedevice: Use LdrFindEntryForAddress to find LDR_MODULE address.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
17ce029f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
device.c
programs/winedevice/device.c
+9
-6
No files found.
programs/winedevice/device.c
View file @
4bed3d23
...
...
@@ -50,15 +50,18 @@ static DRIVER_EXTENSION driver_extension;
/* find the LDR_MODULE corresponding to the driver module */
static
LDR_MODULE
*
find_ldr_module
(
HMODULE
module
)
{
LIST_ENTRY
*
entry
,
*
list
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InMemoryOrderModuleList
;
LDR_MODULE
*
ldr
;
ULONG_PTR
magic
;
for
(
entry
=
list
->
Flink
;
entry
!=
list
;
entry
=
entry
->
Flink
)
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
LdrFindEntryForAddress
(
module
,
&
ldr
))
{
LDR_MODULE
*
ldr
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InMemoryOrderModuleList
);
if
(
ldr
->
BaseAddress
==
module
)
return
ldr
;
if
(
ldr
->
BaseAddress
>
(
void
*
)
module
)
break
;
WARN
(
"module not found for %p
\n
"
,
module
);
ldr
=
NULL
;
}
return
NULL
;
LdrUnlockLoaderLock
(
0
,
magic
);
return
ldr
;
}
/* load the driver module file */
...
...
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