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
8530cb0a
Commit
8530cb0a
authored
May 16, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Check for already loaded module also for LOAD_LIBRARY_AS_DATAFILE.
parent
306d71c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
module.c
dlls/kernel32/module.c
+16
-3
loader.c
dlls/kernel32/tests/loader.c
+2
-2
No files found.
dlls/kernel32/module.c
View file @
8530cb0a
...
...
@@ -844,24 +844,37 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags )
HMODULE
hModule
;
WCHAR
*
load_path
;
load_path
=
MODULE_get_dll_load_path
(
flags
&
LOAD_WITH_ALTERED_SEARCH_PATH
?
libname
->
Buffer
:
NULL
);
if
(
flags
&
LOAD_LIBRARY_AS_DATAFILE
)
{
ULONG
magic
;
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
!
(
nts
=
LdrGetDllHandle
(
load_path
,
flags
,
libname
,
&
hModule
)))
{
LdrAddRefDll
(
0
,
hModule
);
LdrUnlockLoaderLock
(
0
,
magic
);
goto
done
;
}
LdrUnlockLoaderLock
(
0
,
magic
);
/* The method in load_library_as_datafile allows searching for the
* 'native' libraries only
*/
if
(
load_library_as_datafile
(
libname
->
Buffer
,
&
hModule
))
return
hModul
e
;
if
(
load_library_as_datafile
(
libname
->
Buffer
,
&
hModule
))
goto
don
e
;
flags
|=
DONT_RESOLVE_DLL_REFERENCES
;
/* Just in case */
/* Fallback to normal behaviour */
}
load_path
=
MODULE_get_dll_load_path
(
flags
&
LOAD_WITH_ALTERED_SEARCH_PATH
?
libname
->
Buffer
:
NULL
);
nts
=
LdrLoadDll
(
load_path
,
flags
,
libname
,
&
hModule
);
HeapFree
(
GetProcessHeap
(),
0
,
load_path
);
if
(
nts
!=
STATUS_SUCCESS
)
{
hModule
=
0
;
SetLastError
(
RtlNtStatusToDosError
(
nts
)
);
}
done:
HeapFree
(
GetProcessHeap
(),
0
,
load_path
);
return
hModule
;
}
...
...
dlls/kernel32/tests/loader.c
View file @
8530cb0a
...
...
@@ -424,14 +424,14 @@ START_TEST(loader)
SetLastError
(
0xdeadbeef
);
hlib_as_data_file
=
LoadLibraryEx
(
dll_name
,
0
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
hlib_as_data_file
!=
0
,
"LoadLibraryEx error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
hlib_as_data_file
==
hlib
,
"hlib_as_file and hlib are different
\n
"
);
ok
(
hlib_as_data_file
==
hlib
,
"hlib_as_file and hlib are different
\n
"
);
SetLastError
(
0xdeadbeef
);
ok
(
FreeLibrary
(
hlib
),
"FreeLibrary error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hlib
=
GetModuleHandle
(
dll_name
);
todo_wine
ok
(
hlib
!=
0
,
"GetModuleHandle error %u
\n
"
,
GetLastError
());
ok
(
hlib
!=
0
,
"GetModuleHandle error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ok
(
FreeLibrary
(
hlib_as_data_file
),
"FreeLibrary error %d
\n
"
,
GetLastError
());
...
...
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