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
0f394ae6
Commit
0f394ae6
authored
Jul 11, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jul 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic tests for LoadLibraryA and GetProcAddress.
parent
f315d8b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
module.c
dlls/kernel/tests/module.c
+48
-0
No files found.
dlls/kernel/tests/module.c
View file @
0f394ae6
...
...
@@ -78,9 +78,57 @@ static void testGetModuleFileName_Wrong(void)
ok
(
bufA
[
0
]
==
'*'
,
"When failing, buffer shouldn't be written to
\n
"
);
}
static
void
testLoadLibraryA
(
void
)
{
HMODULE
hModule
;
FARPROC
fp
;
SetLastError
(
0xdeadbeef
);
hModule
=
LoadLibraryA
(
"ntdll.dll"
);
ok
(
hModule
!=
NULL
,
"ntdll.dll should be loadable
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError should be 0xdeadbeef but is %08lx
\n
"
,
GetLastError
());
fp
=
GetProcAddress
(
hModule
,
"LdrLoadDll"
);
ok
(
fp
!=
NULL
,
"Call should be there
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError should be 0xdeadbeef but is %08lx
\n
"
,
GetLastError
());
FreeLibrary
(
hModule
);
}
static
void
testLoadLibraryA_Wrong
(
void
)
{
HMODULE
hModule
;
/* Try to load a non-existing dll */
SetLastError
(
0xdeadbeef
);
hModule
=
LoadLibraryA
(
"non_ex_pv.dll"
);
ok
(
!
hModule
,
"non_ex_pv.dll should be not loadable
\n
"
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"Expected ERROR_MOD_NOT_FOUND, got %08lx
\n
"
,
GetLastError
());
/* Just in case */
FreeLibrary
(
hModule
);
}
static
void
testGetProcAddress_Wrong
(
void
)
{
FARPROC
fp
;
SetLastError
(
0xdeadbeef
);
fp
=
GetProcAddress
(
NULL
,
"non_ex_call"
);
ok
(
!
fp
,
"non_ex_call should not be found
\n
"
);
ok
(
GetLastError
()
==
ERROR_PROC_NOT_FOUND
,
"Expected ERROR_PROC_NOT_FOUND, got %08lx
\n
"
,
GetLastError
());
fp
=
GetProcAddress
((
HMODULE
)
0xdeadbeef
,
"non_ex_call"
);
ok
(
!
fp
,
"non_ex_call should not be found
\n
"
);
ok
(
GetLastError
()
==
ERROR_MOD_NOT_FOUND
,
"Expected ERROR_MOD_NOT_FOUND, got %08lx
\n
"
,
GetLastError
());
}
START_TEST
(
module
)
{
testGetModuleFileName
(
NULL
);
testGetModuleFileName
(
"kernel32.dll"
);
testGetModuleFileName_Wrong
();
testLoadLibraryA
();
testLoadLibraryA_Wrong
();
testGetProcAddress_Wrong
();
}
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