Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
99a0376a
Commit
99a0376a
authored
Jan 15, 2010
by
Jason Edmeades
Committed by
Alexandre Julliard
Jan 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Return error on second attempt to free a module.
parent
10f6d5c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
module.c
dlls/kernel32/module.c
+1
-2
module.c
dlls/kernel32/tests/module.c
+18
-0
No files found.
dlls/kernel32/module.c
View file @
99a0376a
...
...
@@ -1003,8 +1003,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FreeLibrary(HINSTANCE hLibModule)
{
/* this is a LOAD_LIBRARY_AS_DATAFILE module */
char
*
ptr
=
(
char
*
)
hLibModule
-
1
;
UnmapViewOfFile
(
ptr
);
return
TRUE
;
return
UnmapViewOfFile
(
ptr
);
}
if
((
nts
=
LdrUnloadDll
(
hLibModule
))
==
STATUS_SUCCESS
)
retv
=
TRUE
;
...
...
dlls/kernel32/tests/module.c
View file @
99a0376a
...
...
@@ -359,6 +359,24 @@ static void testLoadLibraryEx(void)
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
||
broken
(
GetLastError
()
==
ERROR_INVALID_HANDLE
),
/* nt4 */
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* Free the loaded dll when its the first time this dll is loaded
in process - First time should pass, second fail */
SetLastError
(
0xdeadbeef
);
hmodule
=
LoadLibraryExA
(
"comctl32.dll"
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
hmodule
!=
0
,
"Expected valid module handle
\n
"
);
SetLastError
(
0xdeadbeef
);
ok
(
FreeLibrary
(
hmodule
),
"Expected to be able to free the module, failed with %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ok
(
!
FreeLibrary
(
hmodule
),
"Unexpected ability to free the module, failed with %d
\n
"
,
GetLastError
());
CloseHandle
(
hmodule
);
}
START_TEST
(
module
)
...
...
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