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
f96c7278
Commit
f96c7278
authored
Apr 05, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Clear the module handle on failure in GetModuleHandleEx.
parent
e8a95bf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
module.c
dlls/kernel32/module.c
+3
-1
module.c
dlls/kernel32/tests/module.c
+4
-4
No files found.
dlls/kernel32/module.c
View file @
f96c7278
...
...
@@ -548,7 +548,9 @@ BOOL WINAPI GetModuleHandleExW( DWORD flags, LPCWSTR name, HMODULE *module )
!
(
flags
&
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
))
LdrUnlockLoaderLock
(
0
,
magic
);
*
module
=
ret
;
if
(
status
==
STATUS_SUCCESS
)
*
module
=
ret
;
else
*
module
=
NULL
;
return
(
status
==
STATUS_SUCCESS
);
}
...
...
dlls/kernel32/tests/module.c
View file @
f96c7278
...
...
@@ -540,7 +540,7 @@ static void testGetModuleHandleEx(void)
error
=
GetLastError
();
ok
(
!
ret
,
"unexpected success
\n
"
);
ok
(
error
==
ERROR_MOD_NOT_FOUND
,
"got %u
\n
"
,
error
);
todo_wine
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetModuleHandleExW
(
0
,
NULL
,
NULL
);
...
...
@@ -567,7 +567,7 @@ static void testGetModuleHandleEx(void)
error
=
GetLastError
();
ok
(
!
ret
,
"unexpected success
\n
"
);
ok
(
error
==
ERROR_MOD_NOT_FOUND
,
"got %u
\n
"
,
error
);
todo_wine
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetModuleHandleExA
(
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
,
NULL
,
NULL
);
...
...
@@ -593,7 +593,7 @@ static void testGetModuleHandleEx(void)
error
=
GetLastError
();
ok
(
!
ret
,
"unexpected success
\n
"
);
ok
(
error
==
ERROR_MOD_NOT_FOUND
,
"got %u
\n
"
,
error
);
todo_wine
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
,
NULL
,
NULL
);
...
...
@@ -619,7 +619,7 @@ static void testGetModuleHandleEx(void)
error
=
GetLastError
();
ok
(
!
ret
,
"unexpected success
\n
"
);
ok
(
error
==
ERROR_MOD_NOT_FOUND
,
"got %u
\n
"
,
error
);
todo_wine
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
ok
(
mod
==
NULL
,
"got %p
\n
"
,
mod
);
mod_kernel32
=
LoadLibraryA
(
"kernel32"
);
...
...
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