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
306d71c3
Commit
306d71c3
authored
May 16, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Support incrementing the module refcount in GetModuleHandleEx.
parent
447fda52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
module.c
dlls/kernel32/module.c
+15
-6
No files found.
dlls/kernel32/module.c
View file @
306d71c3
...
...
@@ -501,6 +501,12 @@ BOOL WINAPI GetModuleHandleExW( DWORD flags, LPCWSTR name, HMODULE *module )
{
NTSTATUS
status
=
STATUS_SUCCESS
;
HMODULE
ret
;
ULONG
magic
;
/* if we are messing with the refcount, grab the loader lock */
if
((
flags
&
GET_MODULE_HANDLE_EX_FLAG_PIN
)
||
!
(
flags
&
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
))
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
!
name
)
{
...
...
@@ -515,21 +521,24 @@ BOOL WINAPI GetModuleHandleExW( DWORD flags, LPCWSTR name, HMODULE *module )
{
UNICODE_STRING
wstr
;
RtlInitUnicodeString
(
&
wstr
,
name
);
status
=
LdrGetDllHandle
(
0
,
0
,
&
wstr
,
&
ret
);
status
=
LdrGetDllHandle
(
NULL
,
0
,
&
wstr
,
&
ret
);
}
if
(
status
!
=
STATUS_SUCCESS
)
if
(
status
=
=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
if
(
flags
&
GET_MODULE_HANDLE_EX_FLAG_PIN
)
FIXME
(
"should pin refcount for %p
\n
"
,
ret
);
else
if
(
!
(
flags
&
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
))
LdrAddRefDll
(
0
,
ret
);
}
else
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
if
((
flags
&
GET_MODULE_HANDLE_EX_FLAG_PIN
)
||
!
(
flags
&
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
))
FIXME
(
"should update refcount, flags %x
\n
"
,
flags
);
LdrUnlockLoaderLock
(
0
,
magic
);
if
(
module
)
*
module
=
ret
;
return
TRUE
;
return
(
status
==
STATUS_SUCCESS
)
;
}
/***********************************************************************
...
...
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