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
f97f5e13
Commit
f97f5e13
authored
May 24, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Use NtQueryInformationProcess() directly.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c7f4ad9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
108 deletions
+102
-108
exception.c
dlls/ntdll/tests/exception.c
+3
-5
info.c
dlls/ntdll/tests/info.c
+98
-100
reg.c
dlls/ntdll/tests/reg.c
+1
-3
No files found.
dlls/ntdll/tests/exception.c
View file @
f97f5e13
...
...
@@ -63,7 +63,6 @@ static ULONG64 (WINAPI *pRtlGetExtendedFeaturesMask)(CONTEXT_EX *context_ex);
static
NTSTATUS
(
WINAPI
*
pNtRaiseException
)(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
);
static
NTSTATUS
(
WINAPI
*
pNtReadVirtualMemory
)(
HANDLE
,
const
void
*
,
void
*
,
SIZE_T
,
SIZE_T
*
);
static
NTSTATUS
(
WINAPI
*
pNtTerminateProcess
)(
HANDLE
handle
,
LONG
exit_code
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationThread
)(
HANDLE
,
THREADINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtSetInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
...
...
@@ -1534,7 +1533,7 @@ static void test_dpe_exceptions(void)
ULONG
len
;
/* Query DEP with len too small */
stat
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
-
1
,
&
len
);
stat
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
-
1
,
&
len
);
if
(
stat
==
STATUS_INVALID_INFO_CLASS
)
{
skip
(
"This software platform does not support DEP
\n
"
);
...
...
@@ -1543,7 +1542,7 @@ static void test_dpe_exceptions(void)
ok
(
stat
==
STATUS_INFO_LENGTH_MISMATCH
,
"buffer too small: %08lx
\n
"
,
stat
);
/* Query DEP */
stat
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
,
&
len
);
stat
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
,
&
len
);
ok
(
stat
==
STATUS_SUCCESS
,
"querying DEP: status %08lx
\n
"
,
stat
);
if
(
stat
==
STATUS_SUCCESS
)
{
...
...
@@ -3562,7 +3561,7 @@ static void test_dpe_exceptions(void)
NTSTATUS
status
;
void
*
handler
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
,
&
len
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_INVALID_PARAMETER
,
"got status %08lx
\n
"
,
status
);
if
(
!
status
)
{
...
...
@@ -10625,7 +10624,6 @@ START_TEST(exception)
X
(
RtlAddVectoredContinueHandler
);
X
(
RtlRemoveVectoredContinueHandler
);
X
(
RtlSetUnhandledExceptionFilter
);
X
(
NtQueryInformationProcess
);
X
(
NtQueryInformationThread
);
X
(
NtSetInformationProcess
);
X
(
NtSuspendProcess
);
...
...
dlls/ntdll/tests/info.c
View file @
f97f5e13
...
...
@@ -27,7 +27,6 @@ static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVO
static
NTSTATUS
(
WINAPI
*
pRtlGetNativeSystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtPowerInformation
)(
POWER_INFORMATION_LEVEL
,
PVOID
,
ULONG
,
PVOID
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationThread
)(
HANDLE
,
THREADINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtSetInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtSetInformationThread
)(
HANDLE
,
THREADINFOCLASS
,
PVOID
,
ULONG
);
...
...
@@ -85,7 +84,6 @@ static void InitFunctionPtrs(void)
NTDLL_GET_PROC
(
NtSetSystemInformation
);
NTDLL_GET_PROC
(
RtlGetNativeSystemInformation
);
NTDLL_GET_PROC
(
NtPowerInformation
);
NTDLL_GET_PROC
(
NtQueryInformationProcess
);
NTDLL_GET_PROC
(
NtQueryInformationThread
);
NTDLL_GET_PROC
(
NtSetInformationProcess
);
NTDLL_GET_PROC
(
NtSetInformationThread
);
...
...
@@ -626,7 +624,7 @@ static void test_query_process( BOOL extended )
"NtOpenProcess returned:%lx
\n
"
,
status
);
if
(
status
!=
STATUS_SUCCESS
)
continue
;
status
=
p
NtQueryInformationProcess
(
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryInformationProcess returned:%lx
\n
"
,
status
);
ok
(
pbi
.
UniqueProcessId
==
GetCurrentProcessId
(),
"Expected pid %p, got %p
\n
"
,
ULongToHandle
(
GetCurrentProcessId
()),
ULongToHandle
(
pbi
.
UniqueProcessId
)
);
...
...
@@ -1631,35 +1629,35 @@ static void test_query_process_wow64(void)
memset
(
&
dummy
,
0xcc
,
sizeof
(
dummy
));
/* Do not give a handle and buffer */
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
NULL
,
0
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
/* Use a correct info class and buffer size, but still no handle and buffer */
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
NULL
,
sizeof
(
ULONG_PTR
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
NULL
,
sizeof
(
ULONG_PTR
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
/* Use a correct info class, buffer size and handle, but no buffer */
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
NULL
,
sizeof
(
ULONG_PTR
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
NULL
,
sizeof
(
ULONG_PTR
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
status
);
/* Use a correct info class, buffer and buffer size, but no handle */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
ok
(
pbi
[
0
]
==
dummy
,
"pbi[0] changed to %Ix
\n
"
,
pbi
[
0
]);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
/* Use a greater buffer size */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
+
1
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
+
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
pbi
[
0
]
==
dummy
,
"pbi[0] changed to %Ix
\n
"
,
pbi
[
0
]);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
/* Use no ReturnLength */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
is_wow64
==
(
pbi
[
0
]
!=
0
),
"is_wow64 %x, pbi[0] %Ix
\n
"
,
is_wow64
,
pbi
[
0
]);
ok
(
pbi
[
0
]
!=
dummy
,
"pbi[0] %Ix
\n
"
,
pbi
[
0
]);
...
...
@@ -1674,7 +1672,7 @@ static void test_query_process_wow64(void)
/* Finally some correct calls */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
ReturnLength
=
0xdeadbeef
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
is_wow64
==
(
pbi
[
0
]
!=
0
),
"is_wow64 %x, pbi[0] %Ix
\n
"
,
is_wow64
,
pbi
[
0
]);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
...
...
@@ -1683,7 +1681,7 @@ static void test_query_process_wow64(void)
/* Everything is correct except a too small buffer size */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
ReturnLength
=
0xdeadbeef
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
-
1
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
-
1
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
pbi
[
0
]
==
dummy
,
"pbi[0] changed to %Ix
\n
"
,
pbi
[
0
]);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
...
...
@@ -1692,7 +1690,7 @@ static void test_query_process_wow64(void)
/* Everything is correct except a too large buffer size */
pbi
[
0
]
=
pbi
[
1
]
=
dummy
;
ReturnLength
=
0xdeadbeef
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
+
1
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
)
+
1
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
pbi
[
0
]
==
dummy
,
"pbi[0] changed to %Ix
\n
"
,
pbi
[
0
]);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
...
...
@@ -1719,31 +1717,31 @@ static void test_query_process_basic(void)
* every information class
*/
status
=
p
NtQueryInformationProcess
(
NULL
,
-
1
,
NULL
,
0
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
-
1
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INVALID_INFO_CLASS
||
status
==
STATUS_NOT_IMPLEMENTED
/* vista */
,
"Expected STATUS_INVALID_INFO_CLASS or STATUS_NOT_IMPLEMENTED, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
NULL
,
0
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
NULL
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
NULL
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
)
*
2
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
)
*
2
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
pbi
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
)
*
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
)
*
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
pbi
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
...
...
@@ -1777,21 +1775,21 @@ static void test_query_process_vm(void)
const
SIZE_T
alloc_size
=
16
*
1024
*
1024
;
void
*
ptr
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessVmCounters
,
NULL
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessVmCounters
,
NULL
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
VM_COUNTERS
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
VM_COUNTERS
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
24
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
24
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
VM_COUNTERS
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
VM_COUNTERS
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
ReturnLength
==
sizeof
(
VM_COUNTERS
),
"Inconsistent length %ld
\n
"
,
ReturnLength
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
46
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
46
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
todo_wine
ok
(
ReturnLength
==
sizeof
(
VM_COUNTERS
),
"wrong size %ld
\n
"
,
ReturnLength
);
...
...
@@ -1802,18 +1800,18 @@ static void test_query_process_vm(void)
ok
(
pvi
.
PagefileUsage
>
0
,
"Expected a PagefileUsage > 0
\n
"
);
process
=
OpenProcess
(
PROCESS_VM_READ
,
FALSE
,
GetCurrentProcessId
());
status
=
p
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_ACCESS_DENIED
,
"Expected STATUS_ACCESS_DENIED, got %08lx
\n
"
,
status
);
CloseHandle
(
process
);
process
=
OpenProcess
(
PROCESS_QUERY_LIMITED_INFORMATION
,
FALSE
,
GetCurrentProcessId
());
status
=
p
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
||
broken
(
!
process
)
/* XP */
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
CloseHandle
(
process
);
memset
(
&
pvi
,
0
,
sizeof
(
pvi
));
process
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
GetCurrentProcessId
());
status
=
p
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
...
...
@@ -1826,7 +1824,7 @@ static void test_query_process_vm(void)
CloseHandle
(
process
);
/* Check if we have real counters */
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
prev_size
=
pvi
.
VirtualSize
;
...
...
@@ -1834,7 +1832,7 @@ static void test_query_process_vm(void)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
ptr
=
VirtualAlloc
(
NULL
,
alloc_size
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %lu
\n
"
,
GetLastError
());
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
...
...
@@ -1843,7 +1841,7 @@ static void test_query_process_vm(void)
"Expected to be greater than %Iu, got %Iu
\n
"
,
prev_size
+
alloc_size
,
pvi
.
VirtualSize
);
VirtualFree
(
ptr
,
0
,
MEM_RELEASE
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
prev_size
=
pvi
.
VirtualSize
;
...
...
@@ -1851,7 +1849,7 @@ static void test_query_process_vm(void)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
ptr
=
VirtualAlloc
(
NULL
,
alloc_size
,
MEM_RESERVE
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %lu
\n
"
,
GetLastError
());
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
...
...
@@ -1862,7 +1860,7 @@ static void test_query_process_vm(void)
ptr
=
VirtualAlloc
(
ptr
,
alloc_size
,
MEM_COMMIT
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %lu
\n
"
,
GetLastError
());
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %Iu/%Iu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
...
...
@@ -1878,21 +1876,21 @@ static void test_query_process_io(void)
ULONG
ReturnLength
;
IO_COUNTERS
pii
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessIoCounters
,
NULL
,
sizeof
(
pii
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessIoCounters
,
NULL
,
sizeof
(
pii
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
24
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
24
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
pii
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
)
*
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessIoCounters
,
&
pii
,
sizeof
(
pii
)
*
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
pii
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
...
...
@@ -1912,14 +1910,14 @@ static void test_query_process_times(void)
SYSTEMTIME
UTC
,
Local
;
KERNEL_USER_TIMES
spti
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessTimes
,
NULL
,
sizeof
(
spti
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessTimes
,
NULL
,
sizeof
(
spti
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessTimes
,
&
spti
,
sizeof
(
spti
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessTimes
,
&
spti
,
sizeof
(
spti
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessTimes
,
&
spti
,
24
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessTimes
,
&
spti
,
24
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
process
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
one_before_last_pid
);
...
...
@@ -1931,7 +1929,7 @@ static void test_query_process_times(void)
else
trace
(
"ProcessTimes for process with ID : %ld
\n
"
,
one_before_last_pid
);
status
=
p
NtQueryInformationProcess
(
process
,
ProcessTimes
,
&
spti
,
sizeof
(
spti
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
process
,
ProcessTimes
,
&
spti
,
sizeof
(
spti
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
spti
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
CloseHandle
(
process
);
...
...
@@ -1952,7 +1950,7 @@ static void test_query_process_times(void)
FileTimeToSystemTime
((
const
FILETIME
*
)
&
spti
.
UserTime
,
&
Local
);
if
(
winetest_debug
>
1
)
trace
(
"UserTime : %02d:%02d:%02d.%03d
\n
"
,
Local
.
wHour
,
Local
.
wMinute
,
Local
.
wSecond
,
Local
.
wMilliseconds
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessTimes
,
&
spti
,
sizeof
(
spti
)
*
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessTimes
,
&
spti
,
sizeof
(
spti
)
*
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
spti
)
==
ReturnLength
||
ReturnLength
==
0
/* vista */
||
...
...
@@ -1976,36 +1974,36 @@ static void test_query_process_debug_port(int argc, char **argv)
ok
(
ret
,
"CreateProcess failed, last error %#lx.
\n
"
,
GetLastError
());
if
(
!
ret
)
return
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
NULL
,
sizeof
(
debug_port
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
||
status
==
STATUS_ACCESS_VIOLATION
/* XP */
,
"got %#lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
NULL
,
sizeof
(
debug_port
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
)
-
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
)
+
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_port
==
0
,
"Expected port 0, got %#Ix.
\n
"
,
debug_port
);
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_port
==
~
(
DWORD_PTR
)
0
,
"Expected port %#Ix, got %#Ix.
\n
"
,
~
(
DWORD_PTR
)
0
,
debug_port
);
...
...
@@ -2160,24 +2158,24 @@ static void test_query_process_priority(void)
NTSTATUS
status
;
BOOL
ret
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessPriorityClass
,
NULL
,
sizeof
(
priority
[
0
]),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessPriorityClass
,
NULL
,
sizeof
(
priority
[
0
]),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
broken
(
status
==
STATUS_INVALID_HANDLE
)
/* w2k3 */
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
[
0
]),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
[
0
]),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
1
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
1
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
),
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
orig_priority
=
GetPriorityClass
(
GetCurrentProcess
());
ret
=
SetPriorityClass
(
GetCurrentProcess
(),
BELOW_NORMAL_PRIORITY_CLASS
);
ok
(
ret
,
"Failed to set priority class: %lu
\n
"
,
GetLastError
());
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
[
0
]),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessPriorityClass
,
&
priority
,
sizeof
(
priority
[
0
]),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
priority
[
0
].
PriorityClass
==
PROCESS_PRIOCLASS_BELOW_NORMAL
,
"Expected PROCESS_PRIOCLASS_BELOW_NORMAL, got %u
\n
"
,
priority
[
0
].
PriorityClass
);
...
...
@@ -2194,14 +2192,14 @@ static void test_query_process_handlecount(void)
BYTE
buffer
[
2
*
sizeof
(
DWORD
)];
HANDLE
process
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessHandleCount
,
NULL
,
sizeof
(
handlecount
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessHandleCount
,
NULL
,
sizeof
(
handlecount
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessHandleCount
,
&
handlecount
,
sizeof
(
handlecount
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessHandleCount
,
&
handlecount
,
sizeof
(
handlecount
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessHandleCount
,
&
handlecount
,
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessHandleCount
,
&
handlecount
,
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
process
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
one_before_last_pid
);
...
...
@@ -2213,12 +2211,12 @@ static void test_query_process_handlecount(void)
else
if
(
winetest_debug
>
1
)
trace
(
"ProcessHandleCount for process with ID : %ld
\n
"
,
one_before_last_pid
);
status
=
p
NtQueryInformationProcess
(
process
,
ProcessHandleCount
,
&
handlecount
,
sizeof
(
handlecount
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
process
,
ProcessHandleCount
,
&
handlecount
,
sizeof
(
handlecount
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
handlecount
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
CloseHandle
(
process
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessHandleCount
,
buffer
,
sizeof
(
buffer
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessHandleCount
,
buffer
,
sizeof
(
buffer
),
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
||
status
==
STATUS_SUCCESS
,
"Expected STATUS_INFO_LENGTH_MISMATCH or STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
sizeof
(
handlecount
)
==
ReturnLength
,
"Inconsistent length %ld
\n
"
,
ReturnLength
);
...
...
@@ -2239,17 +2237,17 @@ static void test_query_process_image_file_name(void)
UNICODE_STRING
image_file_name
;
UNICODE_STRING
*
buffer
=
NULL
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessImageFileName
,
&
image_file_name
,
sizeof
(
image_file_name
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessImageFileName
,
&
image_file_name
,
sizeof
(
image_file_name
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
&
image_file_name
,
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
&
image_file_name
,
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
&
image_file_name
,
sizeof
(
image_file_name
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
&
image_file_name
,
sizeof
(
image_file_name
),
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
buffer
=
heap_alloc
(
ReturnLength
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
buffer
,
ReturnLength
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileName
,
buffer
,
ReturnLength
,
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
todo_wine
ok
(
!
memcmp
(
buffer
->
Buffer
,
deviceW
,
sizeof
(
deviceW
)),
...
...
@@ -2257,7 +2255,7 @@ static void test_query_process_image_file_name(void)
wine_dbgstr_wn
(
buffer
->
Buffer
,
buffer
->
Length
/
sizeof
(
WCHAR
)));
heap_free
(
buffer
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessImageFileNameWin32
,
&
image_file_name
,
sizeof
(
image_file_name
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessImageFileNameWin32
,
&
image_file_name
,
sizeof
(
image_file_name
),
NULL
);
if
(
status
==
STATUS_INVALID_INFO_CLASS
)
{
win_skip
(
"ProcessImageFileNameWin32 is not supported
\n
"
);
...
...
@@ -2265,14 +2263,14 @@ static void test_query_process_image_file_name(void)
}
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
&
image_file_name
,
2
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
&
image_file_name
,
2
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
&
image_file_name
,
sizeof
(
image_file_name
),
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
&
image_file_name
,
sizeof
(
image_file_name
),
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
buffer
=
heap_alloc
(
ReturnLength
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
buffer
,
ReturnLength
,
&
ReturnLength
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageFileNameWin32
,
buffer
,
ReturnLength
,
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
memcmp
(
buffer
->
Buffer
,
deviceW
,
sizeof
(
deviceW
)),
"Expected image name not to begin with
\\
Device
\\
, got %s
\n
"
,
...
...
@@ -2287,18 +2285,18 @@ static void test_query_process_image_info(void)
SECTION_IMAGE_INFORMATION
info
;
ULONG
len
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessImageInformation
,
&
info
,
sizeof
(
info
),
&
len
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessImageInformation
,
&
info
,
sizeof
(
info
),
&
len
);
ok
(
status
==
STATUS_INVALID_HANDLE
||
broken
(
status
==
STATUS_INVALID_PARAMETER
),
/* winxp */
"got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
)
-
1
,
&
len
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
)
-
1
,
&
len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
)
+
1
,
&
len
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
)
+
1
,
&
len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got %08lx
\n
"
,
status
);
memset
(
&
info
,
0xcc
,
sizeof
(
info
)
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
),
&
len
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessImageInformation
,
&
info
,
sizeof
(
info
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"got %08lx
\n
"
,
status
);
ok
(
len
==
sizeof
(
info
),
"wrong len %lu
\n
"
,
len
);
...
...
@@ -2334,42 +2332,42 @@ static void test_query_process_debug_object_handle(int argc, char **argv)
ok
(
ret
,
"CreateProcess failed with last error %lu
\n
"
,
GetLastError
());
if
(
!
ret
)
return
;
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
NULL
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected NtQueryInformationProcess to return STATUS_INFO_LENGTH_MISMATCH, got 0x%08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
NULL
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
NULL
,
sizeof
(
debug_object
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
||
status
==
STATUS_ACCESS_VIOLATION
,
/* XP */
"Expected NtQueryInformationProcess to return STATUS_INVALID_HANDLE, got 0x%08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
NULL
,
sizeof
(
debug_object
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected NtQueryInformationProcess to return STATUS_ACCESS_VIOLATION, got 0x%08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugObjectHandle
,
&
debug_object
,
sizeof
(
debug_object
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected NtQueryInformationProcess to return STATUS_ACCESS_VIOLATION, got 0x%08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
&
debug_object
,
sizeof
(
debug_object
)
-
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected NtQueryInformationProcess to return STATUS_INFO_LENGTH_MISMATCH, got 0x%08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
&
debug_object
,
sizeof
(
debug_object
)
+
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected NtQueryInformationProcess to return STATUS_INFO_LENGTH_MISMATCH, got 0x%08lx
\n
"
,
status
);
debug_object
=
(
HANDLE
)
0xdeadbeef
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
&
debug_object
,
sizeof
(
debug_object
),
NULL
);
ok
(
status
==
STATUS_PORT_NOT_SET
,
...
...
@@ -2379,7 +2377,7 @@ static void test_query_process_debug_object_handle(int argc, char **argv)
"Expected debug object handle to be NULL, got %p
\n
"
,
debug_object
);
debug_object
=
(
HANDLE
)
0xdeadbeef
;
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugObjectHandle
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugObjectHandle
,
&
debug_object
,
sizeof
(
debug_object
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected NtQueryInformationProcess to return STATUS_SUCCESS, got 0x%08lx
\n
"
,
status
);
...
...
@@ -2426,33 +2424,33 @@ static void test_query_process_debug_flags(int argc, char **argv)
int
i
,
j
;
/* test invalid arguments */
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
NULL
,
0
,
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
||
broken
(
status
==
STATUS_INVALID_INFO_CLASS
)
/* WOW64 */
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
NULL
,
sizeof
(
debug_flags
),
NULL
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
NULL
,
sizeof
(
debug_flags
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
||
status
==
STATUS_ACCESS_VIOLATION
||
broken
(
status
==
STATUS_INVALID_INFO_CLASS
)
/* WOW64 */
,
"Expected STATUS_INVALID_HANDLE, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
NULL
,
sizeof
(
debug_flags
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
NULL
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
||
broken
(
status
==
STATUS_INVALID_INFO_CLASS
)
/* WOW64 */
,
"Expected STATUS_INVALID_HANDLE, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
)
-
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
)
+
1
,
NULL
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %#lx.
\n
"
,
status
);
/* test ProcessDebugFlags of current process */
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
TRUE
,
"Expected flag TRUE, got %lx.
\n
"
,
debug_flags
);
...
...
@@ -2469,7 +2467,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
if
(
!
(
test_flags
[
i
]
&
(
DEBUG_PROCESS
|
DEBUG_ONLY_THIS_PROCESS
)))
{
/* test ProcessDebugFlags before attaching with debugger */
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
TRUE
,
"Expected flag TRUE, got %lx.
\n
"
,
debug_flags
);
...
...
@@ -2480,7 +2478,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
}
/* test ProcessDebugFlags after attaching with debugger */
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
expected_flags
,
"Expected flag %lx, got %lx.
\n
"
,
expected_flags
,
debug_flags
);
...
...
@@ -2510,7 +2508,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
ok
(
ret
,
"DebugActiveProcessStop failed, last error %#lx.
\n
"
,
GetLastError
());
/* test ProcessDebugFlags after detaching debugger */
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
expected_flags
,
"Expected flag %lx, got %lx.
\n
"
,
expected_flags
,
debug_flags
);
...
...
@@ -2519,7 +2517,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
ok
(
ret
,
"DebugActiveProcess failed, last error %#lx.
\n
"
,
GetLastError
());
/* test ProcessDebugFlags after re-attaching debugger */
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
FALSE
,
"Expected flag FALSE, got %lx.
\n
"
,
debug_flags
);
...
...
@@ -2547,7 +2545,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
ok
(
j
<
100
||
broken
(
j
>=
100
)
/* Win XP */
,
"Expected less than 100 debug events.
\n
"
);
/* test ProcessDebugFlags after process has terminated */
status
=
p
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
debug_flags
==
FALSE
,
"Expected flag FALSE, got %lx.
\n
"
,
debug_flags
);
...
...
@@ -2625,7 +2623,7 @@ static void test_mapprotection(void)
BOOL
reset_flags
=
FALSE
;
/* Switch to being a noexec unaware process */
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
oldflags
,
sizeof
(
oldflags
),
&
flagsize
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
oldflags
,
sizeof
(
oldflags
),
&
flagsize
);
if
(
status
==
STATUS_INVALID_PARAMETER
)
{
skip
(
"Unable to query process execute flags on this platform
\n
"
);
...
...
@@ -2943,7 +2941,7 @@ static void test_affinity(void)
SYSTEM_INFO
si
;
GetSystemInfo
(
&
si
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
proc_affinity
=
pbi
.
AffinityMask
;
ok
(
proc_affinity
==
get_affinity_mask
(
si
.
dwNumberOfProcessors
),
"Unexpected process affinity
\n
"
);
...
...
@@ -3022,7 +3020,7 @@ static void test_affinity(void)
proc_affinity
=
2
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
proc_affinity
=
pbi
.
AffinityMask
;
ok
(
proc_affinity
==
2
,
"Unexpected process affinity
\n
"
);
...
...
@@ -3131,7 +3129,7 @@ static void test_NtGetCurrentProcessorNumber(void)
current_cpu
=
pNtGetCurrentProcessorNumber
();
if
(
winetest_debug
>
1
)
trace
(
"dwNumberOfProcessors: %ld, current processor: %ld
\n
"
,
si
.
dwNumberOfProcessors
,
current_cpu
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
old_process_mask
=
pbi
.
AffinityMask
;
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%lx (expected STATUS_SUCCESS)
\n
"
,
status
);
...
...
@@ -3516,17 +3514,17 @@ static void test_debuggee_dbgport(int argc, char **argv)
access
=
strtoul
(
argv
[
1
],
NULL
,
0
);
winetest_push_context
(
"debug object access %08lx"
,
access
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugPort
,
&
debug_port
,
sizeof
(
debug_port
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess ProcessDebugPort failed, status %#lx.
\n
"
,
status
);
ok
(
debug_port
==
~
(
DWORD_PTR
)
0
,
"Expected port %#Ix, got %#Ix.
\n
"
,
~
(
DWORD_PTR
)
0
,
debug_port
);
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugFlags
,
&
debug_flags
,
sizeof
(
debug_flags
),
NULL
);
ok
(
!
status
,
"NtQueryInformationProcess ProcessDebugFlags failed, status %#lx.
\n
"
,
status
);
expect_status
=
access
?
STATUS_SUCCESS
:
STATUS_ACCESS_DENIED
;
status
=
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessDebugObjectHandle
,
&
handle
,
sizeof
(
handle
),
NULL
);
ok
(
status
==
expect_status
,
"NtQueryInformationProcess ProcessDebugObjectHandle expected status %#lx, actual %#lx.
\n
"
,
expect_status
,
status
);
if
(
SUCCEEDED
(
status
))
NtClose
(
handle
);
...
...
dlls/ntdll/tests/reg.c
View file @
f97f5e13
...
...
@@ -138,7 +138,6 @@ static NTSTATUS (WINAPI * pNtQueryObject)(HANDLE, OBJECT_INFORMATION_CLASS, void
static
NTSTATUS
(
WINAPI
*
pNtQueryValueKey
)(
HANDLE
,
const
UNICODE_STRING
*
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
static
NTSTATUS
(
WINAPI
*
pNtSetValueKey
)(
HANDLE
,
const
PUNICODE_STRING
,
ULONG
,
ULONG
,
const
void
*
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pRtlFormatCurrentUserKeyPath
)(
PUNICODE_STRING
);
static
LONG
(
WINAPI
*
pRtlCompareUnicodeString
)(
const
PUNICODE_STRING
,
const
PUNICODE_STRING
,
BOOLEAN
);
static
BOOLEAN
(
WINAPI
*
pRtlCreateUnicodeString
)(
PUNICODE_STRING
,
LPCWSTR
);
...
...
@@ -191,7 +190,6 @@ static BOOL InitFunctionPtrs(void)
NTDLL_GET_PROC
(
NtQueryKey
)
NTDLL_GET_PROC
(
NtQueryObject
)
NTDLL_GET_PROC
(
NtQueryValueKey
)
NTDLL_GET_PROC
(
NtQueryInformationProcess
)
NTDLL_GET_PROC
(
NtSetValueKey
)
NTDLL_GET_PROC
(
NtOpenKey
)
NTDLL_GET_PROC
(
NtNotifyChangeKey
)
...
...
@@ -1488,7 +1486,7 @@ static void test_redirection(void)
if
(
ptr_size
!=
64
)
{
ULONG
is_wow64
,
len
;
if
(
p
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
if
(
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
&
is_wow64
,
sizeof
(
is_wow64
),
&
len
)
||
!
is_wow64
)
{
...
...
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