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
f5678a4d
Commit
f5678a4d
authored
Apr 05, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Apr 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Use GetModuleHandle and skip.
parent
dddf3487
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
info.c
dlls/ntdll/tests/info.c
+15
-18
No files found.
dlls/ntdll/tests/info.c
View file @
f5678a4d
...
...
@@ -24,34 +24,33 @@ static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, P
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtReadVirtualMemory
)(
HANDLE
,
const
void
*
,
void
*
,
SIZE_T
,
SIZE_T
*
);
static
HMODULE
hntdll
=
0
;
/* one_before_last_pid is used to be able to compare values of a still running process
with the output of the test_query_process_times and test_query_process_handlecount tests.
*/
static
DWORD
one_before_last_pid
=
0
;
#define NTDLL_GET_PROC(func) \
#define NTDLL_GET_PROC(func)
do {
\
p ## func = (void*)GetProcAddress(hntdll, #func); \
if(!p ## func) { \
trace("GetProcAddress(%s) failed\n", #func); \
FreeLibrary(hntdll); \
return FALSE; \
}
} \
} while(0)
static
BOOL
InitFunctionPtrs
(
void
)
{
hntdll
=
LoadLibraryA
(
"ntdll.dll"
);
if
(
!
hntdll
)
{
trace
(
"Could not load ntdll.dll
\n
"
);
return
FALSE
;
}
if
(
hntdll
)
/* All needed functions are NT based, so using GetModuleHandle is a good check */
HMODULE
hntdll
=
GetModuleHandle
(
"ntdll"
);
if
(
!
hntdll
)
{
NTDLL_GET_PROC
(
NtQuerySystemInformation
)
NTDLL_GET_PROC
(
NtQueryInformationProcess
)
NTDLL_GET_PROC
(
NtReadVirtualMemory
)
skip
(
"Not running on NT
\n
"
);
return
FALSE
;
}
NTDLL_GET_PROC
(
NtQuerySystemInformation
);
NTDLL_GET_PROC
(
NtQueryInformationProcess
);
NTDLL_GET_PROC
(
NtReadVirtualMemory
);
return
TRUE
;
}
...
...
@@ -277,7 +276,7 @@ static void test_query_process(void)
is_nt
=
(
spi
->
dwOffset
-
(
sbi
.
NumberOfProcessors
*
sizeof
(
SYSTEM_THREAD_INFORMATION
))
==
136
);
if
(
is_nt
)
trace
(
"Windows version is NT, we will skip thread tests
\n
"
);
if
(
is_nt
)
skip
(
"Windows version is NT, we will skip thread tests
\n
"
);
/* Check if we have some return values
*
...
...
@@ -629,7 +628,7 @@ static void test_query_process_io(void)
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
),
&
ReturnLength
);
if
(
status
==
STATUS_NOT_SUPPORTED
)
{
trace
(
"ProcessIoCounters information class not supported, skipping tests
\n
"
);
skip
(
"ProcessIoCounters information class is not supported
\n
"
);
return
;
}
...
...
@@ -892,6 +891,4 @@ START_TEST(info)
/* belongs into it's own file */
trace
(
"Starting test_readvirtualmemory()
\n
"
);
test_readvirtualmemory
();
FreeLibrary
(
hntdll
);
}
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