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
74641349
Commit
74641349
authored
May 10, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
May 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SystemHandleInformation tests.
Removed HeapAlloc in test_basic. Renamed test_basic to test_query_basic.
parent
d5f92eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
12 deletions
+47
-12
info.c
dlls/ntdll/tests/info.c
+47
-12
No files found.
dlls/ntdll/tests/info.c
View file @
74641349
...
...
@@ -46,12 +46,11 @@ static BOOL InitFunctionPtrs(void)
return
TRUE
;
}
static
void
test_basic
()
static
void
test_
query_
basic
()
{
DWORD
status
;
ULONG
ReturnLength
;
SYSTEM_BASIC_INFORMATION
*
sbi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
sbi
));
SYSTEM_BASIC_INFORMATION
sbi
;
/* This test also covers some basic parameter testing that should be the same for
* every information class
...
...
@@ -69,35 +68,71 @@ static void test_basic()
/* Use an existing class, correct length but no SystemInformation buffer */
trace
(
"Check no SystemInformation buffer
\n
"
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
NULL
,
sizeof
(
*
sbi
),
NULL
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
NULL
,
sizeof
(
sbi
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
status
);
/* Use a existing class, correct length, a pointer to a buffer but no ReturnLength pointer */
trace
(
"Check no ReturnLength pointer
\n
"
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
sbi
,
sizeof
(
*
sbi
),
NULL
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
/* Finally some correct calls */
trace
(
"Check with correct parameters
\n
"
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
sbi
,
sizeof
(
*
sbi
),
&
ReturnLength
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
sbi
)
==
ReturnLength
,
"Inconsistent length (%08x) <-> (%ld)
\n
"
,
sizeof
(
sbi
),
ReturnLength
);
/* Check if we have some return values */
trace
(
"Number of Processors : %d
\n
"
,
sbi
.
NumberOfProcessors
);
ok
(
sbi
.
NumberOfProcessors
>
0
,
"Expected more than 0 processors, got %d
\n
"
,
sbi
.
NumberOfProcessors
);
}
static
void
test_query_handle
()
{
DWORD
status
;
ULONG
ReturnLength
;
ULONG
SystemInformationLength
=
sizeof
(
SYSTEM_HANDLE_INFORMATION
);
SYSTEM_HANDLE_INFORMATION
*
shi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SystemInformationLength
);
/* Request the needed length : a SystemInformationLength greater than one struct sets ReturnLength */
status
=
pNtQuerySystemInformation
(
SystemHandleInformation
,
shi
,
SystemInformationLength
,
&
ReturnLength
);
/* The following check assumes more than one handle on any given system */
todo_wine
{
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
}
ok
(
ReturnLength
>
0
,
"Expected ReturnLength to be > 0, it was %ld
\n
"
,
ReturnLength
);
SystemInformationLength
=
ReturnLength
;
shi
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
shi
,
SystemInformationLength
);
status
=
pNtQuerySystemInformation
(
SystemHandleInformation
,
shi
,
SystemInformationLength
,
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
*
sbi
)
==
ReturnLength
,
"Inconsistent length (%08x) <-> (%ld)
\n
"
,
sizeof
(
*
sbi
),
ReturnLength
);
/* Check if we have some return values */
trace
(
"Number of Processors : %d
\n
"
,
sbi
->
NumberOfProcessors
);
ok
(
sbi
->
NumberOfProcessors
>
0
,
"Expected more than 0 processors, got %d
\n
"
,
sbi
->
NumberOfProcessors
);
trace
(
"Number of Handles : %ld
\n
"
,
shi
->
Count
);
todo_wine
{
/* our implementation is a stub for now */
ok
(
shi
->
Count
>
1
,
"Expected more than 1 handles, got (%ld)
\n
"
,
shi
->
Count
);
}
HeapFree
(
GetProcessHeap
(),
0
,
sb
i
);
HeapFree
(
GetProcessHeap
(),
0
,
sh
i
);
}
START_TEST
(
info
)
{
if
(
!
InitFunctionPtrs
())
return
;
/* 0 SystemBasicInformation */
trace
(
"Starting test_basic()
\n
"
);
test_basic
();
trace
(
"Starting test_query_basic()
\n
"
);
test_query_basic
();
/* 0x10 SystemHandleInformation */
trace
(
"Starting test_query_handle()
\n
"
);
test_query_handle
();
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