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
5980477d
Commit
5980477d
authored
Apr 05, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch the exe module directly from the PDB instead of calling
LdrGetDllHandle.
parent
fa13d013
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
module.c
loader/module.c
+11
-23
No files found.
loader/module.c
View file @
5980477d
...
...
@@ -47,10 +47,8 @@ WINE_DECLARE_DEBUG_CHANNEL(loaddll);
inline
static
HMODULE
get_exe_module
(
void
)
{
HMODULE
mod
;
/* FIXME: should look into PEB */
LdrGetDllHandle
(
0
,
0
,
NULL
,
&
mod
);
return
mod
;
HANDLE
*
pdb
=
(
HANDLE
*
)
NtCurrentTeb
()
->
process
;
return
pdb
[
0x08
/
sizeof
(
HANDLE
)];
/* get dword at offset 0x08 in pdb */
}
/***********************************************************************
...
...
@@ -676,23 +674,18 @@ HMODULE WINAPI GetModuleHandleA(LPCSTR module)
{
NTSTATUS
nts
;
HMODULE
ret
;
UNICODE_STRING
wstr
;
if
(
module
)
{
UNICODE_STRING
wstr
;
if
(
!
module
)
return
get_exe_module
();
RtlCreateUnicodeStringFromAsciiz
(
&
wstr
,
module
);
nts
=
LdrGetDllHandle
(
0
,
0
,
&
wstr
,
&
ret
);
RtlFreeUnicodeString
(
&
wstr
);
}
else
nts
=
LdrGetDllHandle
(
0
,
0
,
NULL
,
&
ret
);
RtlCreateUnicodeStringFromAsciiz
(
&
wstr
,
module
);
nts
=
LdrGetDllHandle
(
0
,
0
,
&
wstr
,
&
ret
);
RtlFreeUnicodeString
(
&
wstr
);
if
(
nts
!=
STATUS_SUCCESS
)
{
ret
=
0
;
SetLastError
(
RtlNtStatusToDosError
(
nts
)
);
}
return
ret
;
}
...
...
@@ -703,17 +696,12 @@ HMODULE WINAPI GetModuleHandleW(LPCWSTR module)
{
NTSTATUS
nts
;
HMODULE
ret
;
UNICODE_STRING
wstr
;
if
(
module
)
{
UNICODE_STRING
wstr
;
RtlInitUnicodeString
(
&
wstr
,
module
);
nts
=
LdrGetDllHandle
(
0
,
0
,
&
wstr
,
&
ret
);
}
else
nts
=
LdrGetDllHandle
(
0
,
0
,
NULL
,
&
ret
);
if
(
!
module
)
return
get_exe_module
();
RtlInitUnicodeString
(
&
wstr
,
module
);
nts
=
LdrGetDllHandle
(
0
,
0
,
&
wstr
,
&
ret
);
if
(
nts
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
nts
)
);
...
...
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