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
8796d34a
Commit
8796d34a
authored
Feb 17, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add a few more tests for apisets.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
98f2922d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
module.c
dlls/kernel32/tests/module.c
+74
-0
No files found.
dlls/kernel32/tests/module.c
View file @
8796d34a
...
...
@@ -692,20 +692,94 @@ static void test_LoadLibraryEx_search_flags(void)
}
else
{
LoadLibraryA
(
"ole32.dll"
);
/* FIXME: make sure the dependencies are loaded */
mod
=
LoadLibraryA
(
apiset_dll
);
if
(
mod
)
{
HMODULE
shcore
;
char
buffer
[
MAX_PATH
];
FreeLibrary
(
mod
);
mod
=
LoadLibraryExA
(
apiset_dll
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
!!
mod
,
"Got NULL module, error %u.
\n
"
,
GetLastError
()
);
ok
(
!!
GetModuleHandleA
(
apiset_dll
),
"Got NULL handle.
\n
"
);
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
todo_wine
ok
(
mod
==
shcore
,
"wrong module %p/%p
\n
"
,
mod
,
shcore
);
ret
=
FreeLibrary
(
mod
);
ok
(
ret
,
"FreeLibrary failed, error %u.
\n
"
,
GetLastError
()
);
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
ok
(
!
shcore
,
"shcore not unloaded
\n
"
);
/* api set without .dll */
strcpy
(
buffer
,
apiset_dll
);
buffer
[
strlen
(
buffer
)
-
4
]
=
0
;
mod
=
LoadLibraryExA
(
buffer
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
!!
mod
,
"Got NULL module, error %u.
\n
"
,
GetLastError
()
);
ok
(
!!
GetModuleHandleA
(
apiset_dll
),
"Got NULL handle.
\n
"
);
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
todo_wine
ok
(
mod
==
shcore
,
"wrong module %p/%p
\n
"
,
mod
,
shcore
);
ret
=
FreeLibrary
(
mod
);
ok
(
ret
,
"FreeLibrary failed, error %u.
\n
"
,
GetLastError
()
);
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
ok
(
!
shcore
,
"shcore not unloaded
\n
"
);
/* api set with different version */
strcpy
(
buffer
,
apiset_dll
);
buffer
[
strlen
(
buffer
)
-
5
]
=
'9'
;
mod
=
LoadLibraryExA
(
buffer
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
todo_wine
ok
(
!!
mod
||
broken
(
!
mod
)
/* win8 */
,
"Got NULL module, error %u.
\n
"
,
GetLastError
()
);
if
(
mod
)
{
ok
(
!!
GetModuleHandleA
(
apiset_dll
),
"Got NULL handle.
\n
"
);
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
ok
(
mod
==
shcore
,
"wrong module %p/%p
\n
"
,
mod
,
shcore
);
ret
=
FreeLibrary
(
mod
);
ok
(
ret
,
"FreeLibrary failed, error %u.
\n
"
,
GetLastError
()
);
}
shcore
=
GetModuleHandleA
(
"shcore.dll"
);
ok
(
!
shcore
,
"shcore not unloaded
\n
"
);
/* api set with full path */
GetWindowsDirectoryA
(
buffer
,
MAX_PATH
);
strcat
(
buffer
,
"
\\
"
);
strcat
(
buffer
,
apiset_dll
);
SetLastError
(
0xdeadbeef
);
mod
=
LoadLibraryExA
(
buffer
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
!
mod
,
"Loaded %s
\n
"
,
debugstr_a
(
buffer
)
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
mod
=
LoadLibraryA
(
buffer
);
ok
(
!
mod
,
"Loaded %s
\n
"
,
debugstr_a
(
buffer
)
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
}
else
{
win_skip
(
"%s not found, skipping test.
\n
"
,
apiset_dll
);
}
/* try a library with dependencies */
mod
=
GetModuleHandleA
(
"rasapi32.dll"
);
ok
(
!
mod
,
"rasapi32 already loaded
\n
"
);
mod
=
LoadLibraryA
(
"rasapi32.dll"
);
ok
(
!!
mod
,
"rasapi32 not found %u
\n
"
,
GetLastError
()
);
FreeLibrary
(
mod
);
SetLastError
(
0xdeadbeef
);
mod
=
LoadLibraryExA
(
"rasapi32.dll"
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
!
mod
,
"rasapi32 loaded
\n
"
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
mod
=
LoadLibraryExA
(
"ext-ms-win-ras-rasapi32-l1-1-0.dll"
,
NULL
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
!
mod
,
"rasapi32 loaded
\n
"
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
if
(
mod
)
FreeLibrary
(
mod
);
mod
=
LoadLibraryA
(
"ext-ms-win-ras-rasapi32-l1-1-0.dll"
);
ok
(
!!
mod
||
broken
(
!
mod
)
/* win7 */
,
"rasapi32 not found %u
\n
"
,
GetLastError
()
);
if
(
mod
)
FreeLibrary
(
mod
);
mod
=
GetModuleHandleA
(
"rasapi32.dll"
);
ok
(
!
mod
,
"rasapi32 still loaded
\n
"
);
}
done:
for
(
i
=
1
;
i
<=
6
;
i
++
)
...
...
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