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
b01199d6
Commit
b01199d6
authored
Mar 03, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psapi/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c1c39359
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
130 deletions
+129
-130
Makefile.in
dlls/psapi/tests/Makefile.in
+0
-1
psapi_main.c
dlls/psapi/tests/psapi_main.c
+129
-129
No files found.
dlls/psapi/tests/Makefile.in
View file @
b01199d6
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
psapi.dll
TESTDLL
=
psapi.dll
IMPORTS
=
psapi user32
IMPORTS
=
psapi user32
...
...
dlls/psapi/tests/psapi_main.c
View file @
b01199d6
...
@@ -64,13 +64,13 @@ static void test_EnumProcesses(void)
...
@@ -64,13 +64,13 @@ static void test_EnumProcesses(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EnumProcesses
(
NULL
,
0
,
&
cbUsed
);
ret
=
EnumProcesses
(
NULL
,
0
,
&
cbUsed
);
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
ok
(
cbUsed
==
0
,
"cbUsed=%d
\n
"
,
cbUsed
);
ok
(
cbUsed
==
0
,
"cbUsed=%
l
d
\n
"
,
cbUsed
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EnumProcesses
(
&
pid
,
4
,
&
cbUsed
);
ret
=
EnumProcesses
(
&
pid
,
4
,
&
cbUsed
);
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
ok
(
cbUsed
==
4
,
"cbUsed=%d
\n
"
,
cbUsed
);
ok
(
cbUsed
==
4
,
"cbUsed=%
l
d
\n
"
,
cbUsed
);
}
}
static
void
test_EnumProcessModules
(
void
)
static
void
test_EnumProcessModules
(
void
)
...
@@ -84,45 +84,45 @@ static void test_EnumProcessModules(void)
...
@@ -84,45 +84,45 @@ static void test_EnumProcessModules(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
EnumProcessModules
(
NULL
,
NULL
,
0
,
&
cbNeeded
);
EnumProcessModules
(
NULL
,
NULL
,
0
,
&
cbNeeded
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
EnumProcessModules
(
hpQI
,
NULL
,
0
,
&
cbNeeded
);
EnumProcessModules
(
hpQI
,
NULL
,
0
,
&
cbNeeded
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hMod
=
(
void
*
)
0xdeadbeef
;
hMod
=
(
void
*
)
0xdeadbeef
;
ret
=
EnumProcessModules
(
hpQI
,
&
hMod
,
sizeof
(
HMODULE
),
NULL
);
ret
=
EnumProcessModules
(
hpQI
,
&
hMod
,
sizeof
(
HMODULE
),
NULL
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hMod
=
(
void
*
)
0xdeadbeef
;
hMod
=
(
void
*
)
0xdeadbeef
;
ret
=
EnumProcessModules
(
hpQV
,
&
hMod
,
sizeof
(
HMODULE
),
NULL
);
ret
=
EnumProcessModules
(
hpQV
,
&
hMod
,
sizeof
(
HMODULE
),
NULL
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"expected error=ERROR_NOACCESS but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"expected error=ERROR_NOACCESS but got %
l
d
\n
"
,
GetLastError
());
ok
(
hMod
==
GetModuleHandleA
(
NULL
),
ok
(
hMod
==
GetModuleHandleA
(
NULL
),
"hMod=%p GetModuleHandleA(NULL)=%p
\n
"
,
hMod
,
GetModuleHandleA
(
NULL
));
"hMod=%p GetModuleHandleA(NULL)=%p
\n
"
,
hMod
,
GetModuleHandleA
(
NULL
));
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EnumProcessModules
(
hpQV
,
NULL
,
0
,
&
cbNeeded
);
ret
=
EnumProcessModules
(
hpQV
,
NULL
,
0
,
&
cbNeeded
);
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EnumProcessModules
(
hpQV
,
NULL
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ret
=
EnumProcessModules
(
hpQV
,
NULL
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
!
ret
,
"succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"expected error=ERROR_NOACCESS but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"expected error=ERROR_NOACCESS but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hMod
=
(
void
*
)
0xdeadbeef
;
hMod
=
(
void
*
)
0xdeadbeef
;
ret
=
EnumProcessModules
(
hpQV
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ret
=
EnumProcessModules
(
hpQV
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ok
(
ret
==
1
,
"got %
d, failed with %
d
\n
"
,
ret
,
GetLastError
());
ok
(
ret
==
1
,
"got %
ld, failed with %l
d
\n
"
,
ret
,
GetLastError
());
ok
(
hMod
==
GetModuleHandleA
(
NULL
),
ok
(
hMod
==
GetModuleHandleA
(
NULL
),
"hMod=%p GetModuleHandleA(NULL)=%p
\n
"
,
hMod
,
GetModuleHandleA
(
NULL
));
"hMod=%p GetModuleHandleA(NULL)=%p
\n
"
,
hMod
,
GetModuleHandleA
(
NULL
));
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"not a multiple of sizeof(HMODULE) cbNeeded=%d
\n
"
,
cbNeeded
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"not a multiple of sizeof(HMODULE) cbNeeded=%
l
d
\n
"
,
cbNeeded
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ok
(
ret
,
"CreateProcess failed: %u
\n
"
,
GetLastError
());
ok
(
ret
,
"CreateProcess failed: %
l
u
\n
"
,
GetLastError
());
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
ok
(
!
ret
,
"wait timed out
\n
"
);
...
@@ -130,9 +130,9 @@ static void test_EnumProcessModules(void)
...
@@ -130,9 +130,9 @@ static void test_EnumProcessModules(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hMod
=
NULL
;
hMod
=
NULL
;
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ok
(
ret
==
1
,
"got %
d, error %
u
\n
"
,
ret
,
GetLastError
());
ok
(
ret
==
1
,
"got %
ld, error %l
u
\n
"
,
ret
,
GetLastError
());
ok
(
!!
hMod
,
"expected non-NULL module
\n
"
);
ok
(
!!
hMod
,
"expected non-NULL module
\n
"
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"got %u
\n
"
,
cbNeeded
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"got %
l
u
\n
"
,
cbNeeded
);
TerminateProcess
(
pi
.
hProcess
,
0
);
TerminateProcess
(
pi
.
hProcess
,
0
);
...
@@ -143,7 +143,7 @@ static void test_EnumProcessModules(void)
...
@@ -143,7 +143,7 @@ static void test_EnumProcessModules(void)
strcpy
(
buffer
,
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
);
strcpy
(
buffer
,
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ok
(
ret
,
"CreateProcess failed: %u
\n
"
,
GetLastError
());
ok
(
ret
,
"CreateProcess failed: %
l
u
\n
"
,
GetLastError
());
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
ok
(
!
ret
,
"wait timed out
\n
"
);
...
@@ -151,20 +151,20 @@ static void test_EnumProcessModules(void)
...
@@ -151,20 +151,20 @@ static void test_EnumProcessModules(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hMod
=
NULL
;
hMod
=
NULL
;
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ok
(
ret
==
1
,
"got %
d, error %
u
\n
"
,
ret
,
GetLastError
());
ok
(
ret
==
1
,
"got %
ld, error %l
u
\n
"
,
ret
,
GetLastError
());
ok
(
!!
hMod
,
"expected non-NULL module
\n
"
);
ok
(
!!
hMod
,
"expected non-NULL module
\n
"
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"got %u
\n
"
,
cbNeeded
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"got %
l
u
\n
"
,
cbNeeded
);
ret
=
GetModuleBaseNameA
(
pi
.
hProcess
,
hMod
,
name
,
sizeof
(
name
));
ret
=
GetModuleBaseNameA
(
pi
.
hProcess
,
hMod
,
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
ret
,
"got error %
l
u
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
name
,
"notepad.exe"
),
"got %s
\n
"
,
name
);
ok
(
!
strcmp
(
name
,
"notepad.exe"
),
"got %s
\n
"
,
name
);
ret
=
GetModuleFileNameExA
(
pi
.
hProcess
,
hMod
,
name
,
sizeof
(
name
));
ret
=
GetModuleFileNameExA
(
pi
.
hProcess
,
hMod
,
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
ret
,
"got error %
l
u
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
name
,
buffer
),
"got %s
\n
"
,
name
);
ok
(
!
strcmp
(
name
,
buffer
),
"got %s
\n
"
,
name
);
ret
=
GetModuleInformation
(
pi
.
hProcess
,
hMod
,
&
info
,
sizeof
(
info
));
ret
=
GetModuleInformation
(
pi
.
hProcess
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
ret
,
"got error %
l
u
\n
"
,
GetLastError
());
ok
(
info
.
lpBaseOfDll
==
hMod
,
"expected %p, got %p
\n
"
,
hMod
,
info
.
lpBaseOfDll
);
ok
(
info
.
lpBaseOfDll
==
hMod
,
"expected %p, got %p
\n
"
,
hMod
,
info
.
lpBaseOfDll
);
ok
(
info
.
SizeOfImage
,
"image size was 0
\n
"
);
ok
(
info
.
SizeOfImage
,
"image size was 0
\n
"
);
ok
(
info
.
EntryPoint
>=
info
.
lpBaseOfDll
,
"got entry point %p
\n
"
,
info
.
EntryPoint
);
ok
(
info
.
EntryPoint
>=
info
.
lpBaseOfDll
,
"got entry point %p
\n
"
,
info
.
EntryPoint
);
...
@@ -176,16 +176,16 @@ static void test_EnumProcessModules(void)
...
@@ -176,16 +176,16 @@ static void test_EnumProcessModules(void)
pWow64DisableWow64FsRedirection
(
&
cookie
);
pWow64DisableWow64FsRedirection
(
&
cookie
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
pWow64RevertWow64FsRedirection
(
cookie
);
pWow64RevertWow64FsRedirection
(
cookie
);
ok
(
ret
,
"CreateProcess failed: %u
\n
"
,
GetLastError
());
ok
(
ret
,
"CreateProcess failed: %
l
u
\n
"
,
GetLastError
());
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ret
=
WaitForInputIdle
(
pi
.
hProcess
,
5000
);
ok
(
!
ret
,
"wait timed out
\n
"
);
ok
(
!
ret
,
"wait timed out
\n
"
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
!
ret
,
"got %
l
d
\n
"
,
ret
);
todo_wine
todo_wine
ok
(
GetLastError
()
==
ERROR_PARTIAL_COPY
,
"got error %u
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_PARTIAL_COPY
,
"got error %
l
u
\n
"
,
GetLastError
());
TerminateProcess
(
pi
.
hProcess
,
0
);
TerminateProcess
(
pi
.
hProcess
,
0
);
}
}
...
@@ -199,23 +199,23 @@ static void test_GetModuleInformation(void)
...
@@ -199,23 +199,23 @@ static void test_GetModuleInformation(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleInformation
(
NULL
,
hMod
,
&
info
,
sizeof
(
info
));
GetModuleInformation
(
NULL
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleInformation
(
hpQI
,
hMod
,
&
info
,
sizeof
(
info
));
GetModuleInformation
(
hpQI
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleInformation
(
hpQV
,
hBad
,
&
info
,
sizeof
(
info
));
GetModuleInformation
(
hpQV
,
hBad
,
&
info
,
sizeof
(
info
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
)
-
1
);
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
)
-
1
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
));
ret
=
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
ok
(
info
.
lpBaseOfDll
==
hMod
,
"lpBaseOfDll=%p hMod=%p
\n
"
,
info
.
lpBaseOfDll
,
hMod
);
ok
(
info
.
lpBaseOfDll
==
hMod
,
"lpBaseOfDll=%p hMod=%p
\n
"
,
info
.
lpBaseOfDll
,
hMod
);
}
}
...
@@ -234,7 +234,7 @@ static void test_GetPerformanceInfo(void)
...
@@ -234,7 +234,7 @@ static void test_GetPerformanceInfo(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetPerformanceInfo
(
&
info
,
sizeof
(
info
)
-
1
);
ret
=
GetPerformanceInfo
(
&
info
,
sizeof
(
info
)
-
1
);
ok
(
!
ret
,
"GetPerformanceInfo unexpectedly succeeded
\n
"
);
ok
(
!
ret
,
"GetPerformanceInfo unexpectedly succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_BAD_LENGTH
,
"expected error=ERROR_BAD_LENGTH but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_BAD_LENGTH
,
"expected error=ERROR_BAD_LENGTH but got %
l
d
\n
"
,
GetLastError
());
if
(
!
pNtQuerySystemInformation
)
if
(
!
pNtQuerySystemInformation
)
win_skip
(
"NtQuerySystemInformation not found, skipping tests
\n
"
);
win_skip
(
"NtQuerySystemInformation not found, skipping tests
\n
"
);
...
@@ -249,57 +249,57 @@ static void test_GetPerformanceInfo(void)
...
@@ -249,57 +249,57 @@ static void test_GetPerformanceInfo(void)
/* compare with values from SYSTEM_PERFORMANCE_INFORMATION */
/* compare with values from SYSTEM_PERFORMANCE_INFORMATION */
size
=
0
;
size
=
0
;
status
=
pNtQuerySystemInformation
(
SystemPerformanceInformation
,
sys_performance_info
,
sizeof
(
performance_buffer
),
&
size
);
status
=
pNtQuerySystemInformation
(
SystemPerformanceInformation
,
sys_performance_info
,
sizeof
(
performance_buffer
),
&
size
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08
l
x
\n
"
,
status
);
ok
(
size
>=
sizeof
(
SYSTEM_PERFORMANCE_INFORMATION
),
"incorrect length %d
\n
"
,
size
);
ok
(
size
>=
sizeof
(
SYSTEM_PERFORMANCE_INFORMATION
),
"incorrect length %
l
d
\n
"
,
size
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetPerformanceInfo
(
&
info
,
sizeof
(
info
));
ret
=
GetPerformanceInfo
(
&
info
,
sizeof
(
info
));
ok
(
ret
,
"GetPerformanceInfo failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetPerformanceInfo failed with %
l
d
\n
"
,
GetLastError
());
ok
(
info
.
cb
==
sizeof
(
PERFORMANCE_INFORMATION
),
"got %d
\n
"
,
info
.
cb
);
ok
(
info
.
cb
==
sizeof
(
PERFORMANCE_INFORMATION
),
"got %
l
d
\n
"
,
info
.
cb
);
ok
(
check_with_margin
(
info
.
CommitTotal
,
sys_performance_info
->
TotalCommittedPages
,
2048
),
ok
(
check_with_margin
(
info
.
CommitTotal
,
sys_performance_info
->
TotalCommittedPages
,
2048
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
CommitTotal
,
sys_performance_info
->
TotalCommittedPages
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
CommitTotal
,
sys_performance_info
->
TotalCommittedPages
);
ok
(
check_with_margin
(
info
.
CommitLimit
,
sys_performance_info
->
TotalCommitLimit
,
32
),
ok
(
check_with_margin
(
info
.
CommitLimit
,
sys_performance_info
->
TotalCommitLimit
,
32
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
CommitLimit
,
sys_performance_info
->
TotalCommitLimit
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
CommitLimit
,
sys_performance_info
->
TotalCommitLimit
);
ok
(
check_with_margin
(
info
.
CommitPeak
,
sys_performance_info
->
PeakCommitment
,
32
),
ok
(
check_with_margin
(
info
.
CommitPeak
,
sys_performance_info
->
PeakCommitment
,
32
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
CommitPeak
,
sys_performance_info
->
PeakCommitment
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
CommitPeak
,
sys_performance_info
->
PeakCommitment
);
ok
(
check_with_margin
(
info
.
PhysicalAvailable
,
sys_performance_info
->
AvailablePages
,
2048
),
ok
(
check_with_margin
(
info
.
PhysicalAvailable
,
sys_performance_info
->
AvailablePages
,
2048
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
PhysicalAvailable
,
sys_performance_info
->
AvailablePages
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
PhysicalAvailable
,
sys_performance_info
->
AvailablePages
);
/* TODO: info.SystemCache not checked yet - to which field(s) does this value correspond to? */
/* TODO: info.SystemCache not checked yet - to which field(s) does this value correspond to? */
ok
(
check_with_margin
(
info
.
KernelTotal
,
sys_performance_info
->
PagedPoolUsage
+
sys_performance_info
->
NonPagedPoolUsage
,
256
),
ok
(
check_with_margin
(
info
.
KernelTotal
,
sys_performance_info
->
PagedPoolUsage
+
sys_performance_info
->
NonPagedPoolUsage
,
256
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
KernelTotal
,
"expected approximately %
Id but got %l
d
\n
"
,
info
.
KernelTotal
,
sys_performance_info
->
PagedPoolUsage
+
sys_performance_info
->
NonPagedPoolUsage
);
sys_performance_info
->
PagedPoolUsage
+
sys_performance_info
->
NonPagedPoolUsage
);
ok
(
check_with_margin
(
info
.
KernelPaged
,
sys_performance_info
->
PagedPoolUsage
,
256
),
ok
(
check_with_margin
(
info
.
KernelPaged
,
sys_performance_info
->
PagedPoolUsage
,
256
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
KernelPaged
,
sys_performance_info
->
PagedPoolUsage
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
KernelPaged
,
sys_performance_info
->
PagedPoolUsage
);
ok
(
check_with_margin
(
info
.
KernelNonpaged
,
sys_performance_info
->
NonPagedPoolUsage
,
16
),
ok
(
check_with_margin
(
info
.
KernelNonpaged
,
sys_performance_info
->
NonPagedPoolUsage
,
16
),
"expected approximately %
ld but got %
d
\n
"
,
info
.
KernelNonpaged
,
sys_performance_info
->
NonPagedPoolUsage
);
"expected approximately %
Id but got %l
d
\n
"
,
info
.
KernelNonpaged
,
sys_performance_info
->
NonPagedPoolUsage
);
/* compare with values from SYSTEM_BASIC_INFORMATION */
/* compare with values from SYSTEM_BASIC_INFORMATION */
size
=
0
;
size
=
0
;
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
&
sys_basic_info
,
sizeof
(
sys_basic_info
),
&
size
);
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
&
sys_basic_info
,
sizeof
(
sys_basic_info
),
&
size
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08
l
x
\n
"
,
status
);
ok
(
size
>=
sizeof
(
SYSTEM_BASIC_INFORMATION
),
"incorrect length %d
\n
"
,
size
);
ok
(
size
>=
sizeof
(
SYSTEM_BASIC_INFORMATION
),
"incorrect length %
l
d
\n
"
,
size
);
ok
(
info
.
PhysicalTotal
==
sys_basic_info
.
MmNumberOfPhysicalPages
,
ok
(
info
.
PhysicalTotal
==
sys_basic_info
.
MmNumberOfPhysicalPages
,
"expected info.PhysicalTotal=%
u but got %
u
\n
"
,
"expected info.PhysicalTotal=%
lu but got %l
u
\n
"
,
sys_basic_info
.
MmNumberOfPhysicalPages
,
(
ULONG
)
info
.
PhysicalTotal
);
sys_basic_info
.
MmNumberOfPhysicalPages
,
(
ULONG
)
info
.
PhysicalTotal
);
ok
(
info
.
PageSize
==
sys_basic_info
.
PageSize
,
ok
(
info
.
PageSize
==
sys_basic_info
.
PageSize
,
"expected info.PageSize=%
u but got %
u
\n
"
,
"expected info.PageSize=%
lu but got %l
u
\n
"
,
sys_basic_info
.
PageSize
,
(
ULONG
)
info
.
PageSize
);
sys_basic_info
.
PageSize
,
(
ULONG
)
info
.
PageSize
);
/* compare with values from SYSTEM_PROCESS_INFORMATION */
/* compare with values from SYSTEM_PROCESS_INFORMATION */
size
=
0
;
size
=
0
;
status
=
pNtQuerySystemInformation
(
SystemProcessInformation
,
NULL
,
0
,
&
size
);
status
=
pNtQuerySystemInformation
(
SystemProcessInformation
,
NULL
,
0
,
&
size
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"expected STATUS_INFO_LENGTH_MISMATCH, got %08x
\n
"
,
status
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"expected STATUS_INFO_LENGTH_MISMATCH, got %08
l
x
\n
"
,
status
);
ok
(
size
>
0
,
"incorrect length %d
\n
"
,
size
);
ok
(
size
>
0
,
"incorrect length %
l
d
\n
"
,
size
);
while
(
status
==
STATUS_INFO_LENGTH_MISMATCH
)
while
(
status
==
STATUS_INFO_LENGTH_MISMATCH
)
{
{
sys_process_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
sys_process_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
@@ -308,7 +308,7 @@ static void test_GetPerformanceInfo(void)
...
@@ -308,7 +308,7 @@ static void test_GetPerformanceInfo(void)
if
(
status
==
STATUS_SUCCESS
)
break
;
if
(
status
==
STATUS_SUCCESS
)
break
;
HeapFree
(
GetProcessHeap
(),
0
,
sys_process_info
);
HeapFree
(
GetProcessHeap
(),
0
,
sys_process_info
);
}
}
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08
l
x
\n
"
,
status
);
process_count
=
handle_count
=
thread_count
=
0
;
process_count
=
handle_count
=
thread_count
=
0
;
for
(
spi
=
sys_process_info
;;
spi
=
(
SYSTEM_PROCESS_INFORMATION
*
)(((
char
*
)
spi
)
+
spi
->
NextEntryOffset
))
for
(
spi
=
sys_process_info
;;
spi
=
(
SYSTEM_PROCESS_INFORMATION
*
)(((
char
*
)
spi
)
+
spi
->
NextEntryOffset
))
...
@@ -321,13 +321,13 @@ static void test_GetPerformanceInfo(void)
...
@@ -321,13 +321,13 @@ static void test_GetPerformanceInfo(void)
HeapFree
(
GetProcessHeap
(),
0
,
sys_process_info
);
HeapFree
(
GetProcessHeap
(),
0
,
sys_process_info
);
ok
(
check_with_margin
(
info
.
HandleCount
,
handle_count
,
512
),
ok
(
check_with_margin
(
info
.
HandleCount
,
handle_count
,
512
),
"expected approximately %
d but got %
d
\n
"
,
info
.
HandleCount
,
handle_count
);
"expected approximately %
ld but got %l
d
\n
"
,
info
.
HandleCount
,
handle_count
);
ok
(
check_with_margin
(
info
.
ProcessCount
,
process_count
,
4
),
ok
(
check_with_margin
(
info
.
ProcessCount
,
process_count
,
4
),
"expected approximately %
d but got %
d
\n
"
,
info
.
ProcessCount
,
process_count
);
"expected approximately %
ld but got %l
d
\n
"
,
info
.
ProcessCount
,
process_count
);
ok
(
check_with_margin
(
info
.
ThreadCount
,
thread_count
,
4
),
ok
(
check_with_margin
(
info
.
ThreadCount
,
thread_count
,
4
),
"expected approximately %
d but got %
d
\n
"
,
info
.
ThreadCount
,
thread_count
);
"expected approximately %
ld but got %l
d
\n
"
,
info
.
ThreadCount
,
thread_count
);
}
}
}
}
...
@@ -340,21 +340,21 @@ static void test_GetProcessMemoryInfo(void)
...
@@ -340,21 +340,21 @@ static void test_GetProcessMemoryInfo(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetProcessMemoryInfo
(
NULL
,
&
pmc
,
sizeof
(
pmc
));
ret
=
GetProcessMemoryInfo
(
NULL
,
&
pmc
,
sizeof
(
pmc
));
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetProcessMemoryInfo
(
hpSR
,
&
pmc
,
sizeof
(
pmc
));
ret
=
GetProcessMemoryInfo
(
hpSR
,
&
pmc
,
sizeof
(
pmc
));
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetProcessMemoryInfo
(
hpQI
,
&
pmc
,
sizeof
(
pmc
)
-
1
);
ret
=
GetProcessMemoryInfo
(
hpQI
,
&
pmc
,
sizeof
(
pmc
)
-
1
);
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
!
ret
,
"GetProcessMemoryInfo should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetProcessMemoryInfo
(
hpQI
,
&
pmc
,
sizeof
(
pmc
));
ret
=
GetProcessMemoryInfo
(
hpQI
,
&
pmc
,
sizeof
(
pmc
));
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
}
}
static
BOOL
nt_get_mapped_file_name
(
HANDLE
process
,
LPVOID
addr
,
LPWSTR
name
,
DWORD
len
)
static
BOOL
nt_get_mapped_file_name
(
HANDLE
process
,
LPVOID
addr
,
LPWSTR
name
,
DWORD
len
)
...
@@ -371,10 +371,10 @@ static BOOL nt_get_mapped_file_name(HANDLE process, LPVOID addr, LPWSTR name, DW
...
@@ -371,10 +371,10 @@ static BOOL nt_get_mapped_file_name(HANDLE process, LPVOID addr, LPWSTR name, DW
ret_len
=
0xdeadbeef
;
ret_len
=
0xdeadbeef
;
status
=
pNtQueryVirtualMemory
(
process
,
addr
,
MemoryMappedFilenameInformation
,
buf
,
buf_len
,
&
ret_len
);
status
=
pNtQueryVirtualMemory
(
process
,
addr
,
MemoryMappedFilenameInformation
,
buf
,
buf_len
,
&
ret_len
);
ok
(
!
status
,
"NtQueryVirtualMemory error %x
\n
"
,
status
);
ok
(
!
status
,
"NtQueryVirtualMemory error %
l
x
\n
"
,
status
);
section_name
=
(
MEMORY_SECTION_NAME
*
)
buf
;
section_name
=
(
MEMORY_SECTION_NAME
*
)
buf
;
ok
(
ret_len
==
section_name
->
SectionFileName
.
MaximumLength
+
sizeof
(
*
section_name
),
"got %
l
u, %u
\n
"
,
ok
(
ret_len
==
section_name
->
SectionFileName
.
MaximumLength
+
sizeof
(
*
section_name
),
"got %
I
u, %u
\n
"
,
ret_len
,
section_name
->
SectionFileName
.
MaximumLength
);
ret_len
,
section_name
->
SectionFileName
.
MaximumLength
);
ok
((
char
*
)
section_name
->
SectionFileName
.
Buffer
==
(
char
*
)
section_name
+
sizeof
(
*
section_name
),
"got %p, %p
\n
"
,
ok
((
char
*
)
section_name
->
SectionFileName
.
Buffer
==
(
char
*
)
section_name
+
sizeof
(
*
section_name
),
"got %p, %p
\n
"
,
section_name
,
section_name
->
SectionFileName
.
Buffer
);
section_name
,
section_name
->
SectionFileName
.
Buffer
);
...
@@ -401,20 +401,20 @@ static void test_GetMappedFileName(void)
...
@@ -401,20 +401,20 @@ static void test_GetMappedFileName(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
NULL
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ret
=
GetMappedFileNameA
(
NULL
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
hpSR
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ret
=
GetMappedFileNameA
(
hpSR
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
hpQI
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ret
=
GetMappedFileNameA
(
hpQI
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
),
/* win2k */
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
),
/* win2k */
"GetMappedFileNameA failed with error %u
\n
"
,
GetLastError
()
);
"GetMappedFileNameA failed with error %
l
u
\n
"
,
GetLastError
()
);
if
(
ret
)
if
(
ret
)
{
{
ok
(
ret
==
strlen
(
szMapPath
),
"szMapPath=
\"
%s
\"
ret=%d
\n
"
,
szMapPath
,
ret
);
ok
(
ret
==
strlen
(
szMapPath
),
"szMapPath=
\"
%s
\"
ret=%
l
d
\n
"
,
szMapPath
,
ret
);
ok
(
szMapPath
[
0
]
==
'\\'
,
"szMapPath=
\"
%s
\"\n
"
,
szMapPath
);
ok
(
szMapPath
[
0
]
==
'\\'
,
"szMapPath=
\"
%s
\"\n
"
,
szMapPath
);
szMapBaseName
=
strrchr
(
szMapPath
,
'\\'
);
/* That's close enough for us */
szMapBaseName
=
strrchr
(
szMapPath
,
'\\'
);
/* That's close enough for us */
ok
(
szMapBaseName
&&
*
szMapBaseName
,
"szMapPath=
\"
%s
\"\n
"
,
szMapPath
);
ok
(
szMapBaseName
&&
*
szMapBaseName
,
"szMapPath=
\"
%s
\"\n
"
,
szMapPath
);
...
@@ -434,49 +434,49 @@ static void test_GetMappedFileName(void)
...
@@ -434,49 +434,49 @@ static void test_GetMappedFileName(void)
drive
[
2
]
=
0
;
drive
[
2
]
=
0
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
QueryDosDeviceA
(
drive
,
device_name
,
sizeof
(
device_name
));
ret
=
QueryDosDeviceA
(
drive
,
device_name
,
sizeof
(
device_name
));
ok
(
ret
,
"QueryDosDeviceA error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"QueryDosDeviceA error %
l
d
\n
"
,
GetLastError
());
trace
(
"%s -> %s
\n
"
,
drive
,
device_name
);
trace
(
"%s -> %s
\n
"
,
drive
,
device_name
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hfile
=
CreateFileA
(
file_name
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
hfile
=
CreateFileA
(
file_name
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"CreateFileA(%s) error %d
\n
"
,
file_name
,
GetLastError
());
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"CreateFileA(%s) error %
l
d
\n
"
,
file_name
,
GetLastError
());
SetFilePointer
(
hfile
,
0x4000
,
NULL
,
FILE_BEGIN
);
SetFilePointer
(
hfile
,
0x4000
,
NULL
,
FILE_BEGIN
);
SetEndOfFile
(
hfile
);
SetEndOfFile
(
hfile
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hmap
=
CreateFileMappingA
(
hfile
,
NULL
,
PAGE_READONLY
|
SEC_COMMIT
,
0
,
0
,
NULL
);
hmap
=
CreateFileMappingA
(
hfile
,
NULL
,
PAGE_READONLY
|
SEC_COMMIT
,
0
,
0
,
NULL
);
ok
(
hmap
!=
0
,
"CreateFileMappingA error %d
\n
"
,
GetLastError
());
ok
(
hmap
!=
0
,
"CreateFileMappingA error %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
base
=
MapViewOfFile
(
hmap
,
FILE_MAP_READ
,
0
,
0
,
0
);
base
=
MapViewOfFile
(
hmap
,
FILE_MAP_READ
,
0
,
0
,
0
);
ok
(
base
!=
NULL
,
"MapViewOfFile error %d
\n
"
,
GetLastError
());
ok
(
base
!=
NULL
,
"MapViewOfFile error %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
0
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
0
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"wrong error %d
\n
"
,
GetLastError
());
"wrong error %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
0
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
0
,
sizeof
(
map_name
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
1
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
1
);
ok
(
ret
==
1
,
"GetMappedFileName error %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"GetMappedFileName error %
l
d
\n
"
,
GetLastError
());
ok
(
!
map_name
[
0
]
||
broken
(
map_name
[
0
]
==
device_name
[
0
])
/* before win2k */
,
"expected 0, got %c
\n
"
,
map_name
[
0
]);
ok
(
!
map_name
[
0
]
||
broken
(
map_name
[
0
]
==
device_name
[
0
])
/* before win2k */
,
"expected 0, got %c
\n
"
,
map_name
[
0
]);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
sizeof
(
map_name
));
ok
(
ret
,
"GetMappedFileName error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetMappedFileName error %
l
d
\n
"
,
GetLastError
());
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
todo_wine
todo_wine
ok
(
memcmp
(
map_name
,
device_name
,
strlen
(
device_name
))
==
0
,
"map name does not start with a device name: %s
\n
"
,
map_name
);
ok
(
memcmp
(
map_name
,
device_name
,
strlen
(
device_name
))
==
0
,
"map name does not start with a device name: %s
\n
"
,
map_name
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameW
(
GetCurrentProcess
(),
base
,
map_nameW
,
ARRAY_SIZE
(
map_nameW
));
ret
=
GetMappedFileNameW
(
GetCurrentProcess
(),
base
,
map_nameW
,
ARRAY_SIZE
(
map_nameW
));
ok
(
ret
,
"GetMappedFileNameW error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetMappedFileNameW error %
l
d
\n
"
,
GetLastError
());
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
if
(
nt_get_mapped_file_name
(
GetCurrentProcess
(),
base
,
nt_map_name
,
ARRAY_SIZE
(
nt_map_name
)))
if
(
nt_get_mapped_file_name
(
GetCurrentProcess
(),
base
,
nt_map_name
,
ARRAY_SIZE
(
nt_map_name
)))
{
{
...
@@ -488,7 +488,7 @@ static void test_GetMappedFileName(void)
...
@@ -488,7 +488,7 @@ static void test_GetMappedFileName(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
+
0x2000
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
+
0x2000
,
map_name
,
sizeof
(
map_name
));
ok
(
ret
,
"GetMappedFileName error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetMappedFileName error %
l
d
\n
"
,
GetLastError
());
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
ok
(
ret
>
strlen
(
device_name
),
"map_name should be longer than device_name
\n
"
);
todo_wine
todo_wine
ok
(
memcmp
(
map_name
,
device_name
,
strlen
(
device_name
))
==
0
,
"map name does not start with a device name: %s
\n
"
,
map_name
);
ok
(
memcmp
(
map_name
,
device_name
,
strlen
(
device_name
))
==
0
,
"map name does not start with a device name: %s
\n
"
,
map_name
);
...
@@ -496,17 +496,17 @@ static void test_GetMappedFileName(void)
...
@@ -496,17 +496,17 @@ static void test_GetMappedFileName(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
+
0x4000
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
+
0x4000
,
map_name
,
sizeof
(
map_name
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
,
"expected ERROR_UNEXP_NET_ERR, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
,
"expected ERROR_UNEXP_NET_ERR, got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
NULL
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
NULL
,
map_name
,
sizeof
(
map_name
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
,
"expected ERROR_UNEXP_NET_ERR, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_UNEXP_NET_ERR
,
"expected ERROR_UNEXP_NET_ERR, got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
0
,
base
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
0
,
base
,
map_name
,
sizeof
(
map_name
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %
l
d
\n
"
,
GetLastError
());
UnmapViewOfFile
(
base
);
UnmapViewOfFile
(
base
);
CloseHandle
(
hmap
);
CloseHandle
(
hmap
);
...
@@ -515,16 +515,16 @@ static void test_GetMappedFileName(void)
...
@@ -515,16 +515,16 @@ static void test_GetMappedFileName(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hmap
=
CreateFileMappingA
(
INVALID_HANDLE_VALUE
,
NULL
,
PAGE_READONLY
|
SEC_COMMIT
,
0
,
4096
,
NULL
);
hmap
=
CreateFileMappingA
(
INVALID_HANDLE_VALUE
,
NULL
,
PAGE_READONLY
|
SEC_COMMIT
,
0
,
4096
,
NULL
);
ok
(
hmap
!=
0
,
"CreateFileMappingA error %d
\n
"
,
GetLastError
());
ok
(
hmap
!=
0
,
"CreateFileMappingA error %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
base
=
MapViewOfFile
(
hmap
,
FILE_MAP_READ
,
0
,
0
,
0
);
base
=
MapViewOfFile
(
hmap
,
FILE_MAP_READ
,
0
,
0
,
0
);
ok
(
base
!=
NULL
,
"MapViewOfFile error %d
\n
"
,
GetLastError
());
ok
(
base
!=
NULL
,
"MapViewOfFile error %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
sizeof
(
map_name
));
ret
=
GetMappedFileNameA
(
GetCurrentProcess
(),
base
,
map_name
,
sizeof
(
map_name
));
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
!
ret
,
"GetMappedFileName should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_INVALID
,
"expected ERROR_FILE_INVALID, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_FILE_INVALID
,
"expected ERROR_FILE_INVALID, got %
l
d
\n
"
,
GetLastError
());
UnmapViewOfFile
(
base
);
UnmapViewOfFile
(
base
);
CloseHandle
(
hmap
);
CloseHandle
(
hmap
);
...
@@ -545,60 +545,60 @@ static void test_GetProcessImageFileName(void)
...
@@ -545,60 +545,60 @@ static void test_GetProcessImageFileName(void)
win_skip
(
"GetProcessImageFileName not implemented
\n
"
);
win_skip
(
"GetProcessImageFileName not implemented
\n
"
);
return
;
return
;
}
}
ok
(
0
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
0
,
"failed with %
l
d
\n
"
,
GetLastError
());
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameA
(
NULL
,
szImgPath
,
sizeof
(
szImgPath
));
GetProcessImageFileNameA
(
NULL
,
szImgPath
,
sizeof
(
szImgPath
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameA
(
hpSR
,
szImgPath
,
sizeof
(
szImgPath
));
GetProcessImageFileNameA
(
hpSR
,
szImgPath
,
sizeof
(
szImgPath
));
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameA
(
hpQI
,
szImgPath
,
0
);
GetProcessImageFileNameA
(
hpQI
,
szImgPath
,
0
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
ret
=
GetProcessImageFileNameA
(
hpQI
,
szImgPath
,
sizeof
(
szImgPath
));
ret
=
GetProcessImageFileNameA
(
hpQI
,
szImgPath
,
sizeof
(
szImgPath
));
ret1
=
GetMappedFileNameA
(
hpQV
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
ret1
=
GetMappedFileNameA
(
hpQV
,
hMod
,
szMapPath
,
sizeof
(
szMapPath
));
if
(
ret
&&
ret1
)
if
(
ret
&&
ret1
)
{
{
/* Windows returns 2*strlen-1 */
/* Windows returns 2*strlen-1 */
ok
(
ret
>=
strlen
(
szImgPath
),
"szImgPath=
\"
%s
\"
ret=%d
\n
"
,
szImgPath
,
ret
);
ok
(
ret
>=
strlen
(
szImgPath
),
"szImgPath=
\"
%s
\"
ret=%
l
d
\n
"
,
szImgPath
,
ret
);
todo_wine
ok
(
!
strcmp
(
szImgPath
,
szMapPath
),
"szImgPath=
\"
%s
\"
szMapPath=
\"
%s
\"\n
"
,
szImgPath
,
szMapPath
);
todo_wine
ok
(
!
strcmp
(
szImgPath
,
szMapPath
),
"szImgPath=
\"
%s
\"
szMapPath=
\"
%s
\"\n
"
,
szImgPath
,
szMapPath
);
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameW
(
NULL
,
szImgPathW
,
ARRAY_SIZE
(
szImgPathW
));
GetProcessImageFileNameW
(
NULL
,
szImgPathW
,
ARRAY_SIZE
(
szImgPathW
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
/* no information about correct buffer size returned: */
/* no information about correct buffer size returned: */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
0
);
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
0
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameW
(
hpQI
,
NULL
,
0
);
GetProcessImageFileNameW
(
hpQI
,
NULL
,
0
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
/* correct call */
/* correct call */
memset
(
szImgPathW
,
0xff
,
sizeof
(
szImgPathW
));
memset
(
szImgPathW
,
0xff
,
sizeof
(
szImgPathW
));
ret
=
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ARRAY_SIZE
(
szImgPathW
));
ret
=
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ARRAY_SIZE
(
szImgPathW
));
ok
(
ret
>
0
,
"GetProcessImageFileNameW should have succeeded.
\n
"
);
ok
(
ret
>
0
,
"GetProcessImageFileNameW should have succeeded.
\n
"
);
ok
(
szImgPathW
[
0
]
==
'\\'
,
"GetProcessImageFileNameW should have returned an NT path.
\n
"
);
ok
(
szImgPathW
[
0
]
==
'\\'
,
"GetProcessImageFileNameW should have returned an NT path.
\n
"
);
ok
(
lstrlenW
(
szImgPathW
)
==
ret
,
"Expected length to be %d, got %d
\n
"
,
ret
,
lstrlenW
(
szImgPathW
));
ok
(
lstrlenW
(
szImgPathW
)
==
ret
,
"Expected length to be %
l
d, got %d
\n
"
,
ret
,
lstrlenW
(
szImgPathW
));
/* boundary values of 'size' */
/* boundary values of 'size' */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ret
);
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %
l
d
\n
"
,
GetLastError
());
memset
(
szImgPathW
,
0xff
,
sizeof
(
szImgPathW
));
memset
(
szImgPathW
,
0xff
,
sizeof
(
szImgPathW
));
ret
=
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ret
+
1
);
ret
=
GetProcessImageFileNameW
(
hpQI
,
szImgPathW
,
ret
+
1
);
ok
(
ret
>
0
,
"GetProcessImageFileNameW should have succeeded.
\n
"
);
ok
(
ret
>
0
,
"GetProcessImageFileNameW should have succeeded.
\n
"
);
ok
(
szImgPathW
[
0
]
==
'\\'
,
"GetProcessImageFileNameW should have returned an NT path.
\n
"
);
ok
(
szImgPathW
[
0
]
==
'\\'
,
"GetProcessImageFileNameW should have returned an NT path.
\n
"
);
ok
(
lstrlenW
(
szImgPathW
)
==
ret
,
"Expected length to be %d, got %d
\n
"
,
ret
,
lstrlenW
(
szImgPathW
));
ok
(
lstrlenW
(
szImgPathW
)
==
ret
,
"Expected length to be %
l
d, got %d
\n
"
,
ret
,
lstrlenW
(
szImgPathW
));
}
}
static
void
test_GetModuleFileNameEx
(
void
)
static
void
test_GetModuleFileNameEx
(
void
)
...
@@ -611,22 +611,22 @@ static void test_GetModuleFileNameEx(void)
...
@@ -611,22 +611,22 @@ static void test_GetModuleFileNameEx(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleFileNameExA
(
NULL
,
hMod
,
szModExPath
,
sizeof
(
szModExPath
));
ret
=
GetModuleFileNameExA
(
NULL
,
hMod
,
szModExPath
,
sizeof
(
szModExPath
));
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleFileNameExA
(
hpQI
,
hMod
,
szModExPath
,
sizeof
(
szModExPath
));
ret
=
GetModuleFileNameExA
(
hpQI
,
hMod
,
szModExPath
,
sizeof
(
szModExPath
));
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleFileNameExA
(
hpQV
,
hBad
,
szModExPath
,
sizeof
(
szModExPath
));
ret
=
GetModuleFileNameExA
(
hpQV
,
hBad
,
szModExPath
,
sizeof
(
szModExPath
));
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
!
ret
,
"GetModuleFileNameExA succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
sizeof
(
szModExPath
));
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
sizeof
(
szModExPath
));
if
(
!
ret
)
if
(
!
ret
)
return
;
return
;
ok
(
ret
==
strlen
(
szModExPath
),
"szModExPath=
\"
%s
\"
ret=%d
\n
"
,
szModExPath
,
ret
);
ok
(
ret
==
strlen
(
szModExPath
),
"szModExPath=
\"
%s
\"
ret=%
l
d
\n
"
,
szModExPath
,
ret
);
GetModuleFileNameA
(
NULL
,
szModPath
,
sizeof
(
szModPath
));
GetModuleFileNameA
(
NULL
,
szModPath
,
sizeof
(
szModPath
));
ok
(
!
strncmp
(
szModExPath
,
szModPath
,
MAX_PATH
),
ok
(
!
strncmp
(
szModExPath
,
szModPath
,
MAX_PATH
),
"szModExPath=
\"
%s
\"
szModPath=
\"
%s
\"\n
"
,
szModExPath
,
szModPath
);
"szModExPath=
\"
%s
\"
szModPath=
\"
%s
\"\n
"
,
szModExPath
,
szModPath
);
...
@@ -634,34 +634,34 @@ static void test_GetModuleFileNameEx(void)
...
@@ -634,34 +634,34 @@ static void test_GetModuleFileNameEx(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
memset
(
szModExPath
,
0xcc
,
sizeof
(
szModExPath
)
);
memset
(
szModExPath
,
0xcc
,
sizeof
(
szModExPath
)
);
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
4
);
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
4
);
ok
(
ret
==
4
||
ret
==
strlen
(
szModExPath
),
"wrong length %u
\n
"
,
ret
);
ok
(
ret
==
4
||
ret
==
strlen
(
szModExPath
),
"wrong length %
l
u
\n
"
,
ret
);
ok
(
broken
(
szModExPath
[
3
])
/*w2kpro*/
||
strlen
(
szModExPath
)
==
3
,
ok
(
broken
(
szModExPath
[
3
])
/*w2kpro*/
||
strlen
(
szModExPath
)
==
3
,
"szModExPath=
\"
%s
\"
ret=%d
\n
"
,
szModExPath
,
ret
);
"szModExPath=
\"
%s
\"
ret=%
l
d
\n
"
,
szModExPath
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %
l
d
\n
"
,
GetLastError
());
if
(
0
)
/* crashes on Windows 10 */
if
(
0
)
/* crashes on Windows 10 */
{
{
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
0
);
ret
=
GetModuleFileNameExA
(
hpQV
,
NULL
,
szModExPath
,
0
);
ok
(
ret
==
0
,
"wrong length %u
\n
"
,
ret
);
ok
(
ret
==
0
,
"wrong length %
l
u
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got error %
l
d
\n
"
,
GetLastError
());
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
ret
=
GetModuleFileNameExW
(
hpQV
,
NULL
,
buffer
,
4
);
ret
=
GetModuleFileNameExW
(
hpQV
,
NULL
,
buffer
,
4
);
ok
(
ret
==
4
||
ret
==
lstrlenW
(
buffer
),
"wrong length %u
\n
"
,
ret
);
ok
(
ret
==
4
||
ret
==
lstrlenW
(
buffer
),
"wrong length %
l
u
\n
"
,
ret
);
ok
(
broken
(
buffer
[
3
])
/*w2kpro*/
||
lstrlenW
(
buffer
)
==
3
,
ok
(
broken
(
buffer
[
3
])
/*w2kpro*/
||
lstrlenW
(
buffer
)
==
3
,
"buffer=%s ret=%d
\n
"
,
wine_dbgstr_w
(
buffer
),
ret
);
"buffer=%s ret=%
l
d
\n
"
,
wine_dbgstr_w
(
buffer
),
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %
l
d
\n
"
,
GetLastError
());
if
(
0
)
/* crashes on Windows 10 */
if
(
0
)
/* crashes on Windows 10 */
{
{
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
buffer
[
0
]
=
0xcc
;
buffer
[
0
]
=
0xcc
;
ret
=
GetModuleFileNameExW
(
hpQV
,
NULL
,
buffer
,
0
);
ret
=
GetModuleFileNameExW
(
hpQV
,
NULL
,
buffer
,
0
);
ok
(
ret
==
0
,
"wrong length %u
\n
"
,
ret
);
ok
(
ret
==
0
,
"wrong length %
l
u
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"got error %
l
d
\n
"
,
GetLastError
());
ok
(
buffer
[
0
]
==
0xcc
,
"buffer modified %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
buffer
[
0
]
==
0xcc
,
"buffer modified %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
}
}
}
}
...
@@ -674,20 +674,20 @@ static void test_GetModuleBaseName(void)
...
@@ -674,20 +674,20 @@ static void test_GetModuleBaseName(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleBaseNameA
(
NULL
,
hMod
,
szModBaseName
,
sizeof
(
szModBaseName
));
GetModuleBaseNameA
(
NULL
,
hMod
,
szModBaseName
,
sizeof
(
szModBaseName
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleBaseNameA
(
hpQI
,
hMod
,
szModBaseName
,
sizeof
(
szModBaseName
));
GetModuleBaseNameA
(
hpQI
,
hMod
,
szModBaseName
,
sizeof
(
szModBaseName
));
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
GetModuleBaseNameA
(
hpQV
,
hBad
,
szModBaseName
,
sizeof
(
szModBaseName
));
GetModuleBaseNameA
(
hpQV
,
hBad
,
szModBaseName
,
sizeof
(
szModBaseName
));
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
ret
=
GetModuleBaseNameA
(
hpQV
,
NULL
,
szModBaseName
,
sizeof
(
szModBaseName
));
ret
=
GetModuleBaseNameA
(
hpQV
,
NULL
,
szModBaseName
,
sizeof
(
szModBaseName
));
if
(
!
ret
)
if
(
!
ret
)
return
;
return
;
ok
(
ret
==
strlen
(
szModBaseName
),
"szModBaseName=
\"
%s
\"
ret=%d
\n
"
,
szModBaseName
,
ret
);
ok
(
ret
==
strlen
(
szModBaseName
),
"szModBaseName=
\"
%s
\"
ret=%
l
d
\n
"
,
szModBaseName
,
ret
);
GetModuleFileNameA
(
NULL
,
szModPath
,
sizeof
(
szModPath
));
GetModuleFileNameA
(
NULL
,
szModPath
,
sizeof
(
szModPath
));
ok
(
!
strcmp
(
strrchr
(
szModPath
,
'\\'
)
+
1
,
szModBaseName
),
ok
(
!
strcmp
(
strrchr
(
szModPath
,
'\\'
)
+
1
,
szModBaseName
),
"szModPath=
\"
%s
\"
szModBaseName=
\"
%s
\"\n
"
,
szModPath
,
szModBaseName
);
"szModPath=
\"
%s
\"
szModBaseName=
\"
%s
\"\n
"
,
szModPath
,
szModBaseName
);
...
@@ -703,19 +703,19 @@ static void test_ws_functions(void)
...
@@ -703,19 +703,19 @@ static void test_ws_functions(void)
ws_handle
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_SET_QUOTA
|
ws_handle
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_SET_QUOTA
|
PROCESS_SET_INFORMATION
,
FALSE
,
GetCurrentProcessId
());
PROCESS_SET_INFORMATION
,
FALSE
,
GetCurrentProcessId
());
ok
(
!!
ws_handle
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!!
ws_handle
,
"got error %
l
u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
EmptyWorkingSet
(
NULL
);
EmptyWorkingSet
(
NULL
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected error=ERROR_INVALID_HANDLE but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
EmptyWorkingSet
(
hpSR
);
EmptyWorkingSet
(
hpSR
);
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %d
\n
"
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected error=ERROR_ACCESS_DENIED but got %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
EmptyWorkingSet
(
ws_handle
);
ret
=
EmptyWorkingSet
(
ws_handle
);
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
InitializeProcessForWsWatch
(
NULL
);
ret
=
InitializeProcessForWsWatch
(
NULL
);
...
@@ -727,11 +727,11 @@ static void test_ws_functions(void)
...
@@ -727,11 +727,11 @@ static void test_ws_functions(void)
trace
(
"InitializeProcessForWsWatch not supported
\n
"
);
trace
(
"InitializeProcessForWsWatch not supported
\n
"
);
return
;
return
;
}
}
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
InitializeProcessForWsWatch
(
ws_handle
);
ret
=
InitializeProcessForWsWatch
(
ws_handle
);
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
addr
=
VirtualAlloc
(
NULL
,
1
,
MEM_COMMIT
,
PAGE_READWRITE
);
addr
=
VirtualAlloc
(
NULL
,
1
,
MEM_COMMIT
,
PAGE_READWRITE
);
if
(
!
addr
)
if
(
!
addr
)
...
@@ -740,13 +740,13 @@ static void test_ws_functions(void)
...
@@ -740,13 +740,13 @@ static void test_ws_functions(void)
*
addr
=
0
;
/* make sure it's paged in (needed on wow64) */
*
addr
=
0
;
/* make sure it's paged in (needed on wow64) */
if
(
!
VirtualLock
(
addr
,
1
))
if
(
!
VirtualLock
(
addr
,
1
))
{
{
trace
(
"locking failed (error=%d) - skipping test
\n
"
,
GetLastError
());
trace
(
"locking failed (error=%
l
d) - skipping test
\n
"
,
GetLastError
());
goto
free_page
;
goto
free_page
;
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetWsChanges
(
hpQI
,
wswi
,
sizeof
(
wswi
));
ret
=
GetWsChanges
(
hpQI
,
wswi
,
sizeof
(
wswi
));
todo_wine
ok
(
ret
==
1
,
"failed with %d
\n
"
,
GetLastError
());
todo_wine
ok
(
ret
==
1
,
"failed with %
l
d
\n
"
,
GetLastError
());
if
(
ret
==
1
)
if
(
ret
==
1
)
{
{
for
(
i
=
0
;
wswi
[
i
].
FaultingVa
;
i
++
)
for
(
i
=
0
;
wswi
[
i
].
FaultingVa
;
i
++
)
...
@@ -772,14 +772,14 @@ static void check_QueryWorkingSetEx(PVOID addr, const char *desc, DWORD expected
...
@@ -772,14 +772,14 @@ static void check_QueryWorkingSetEx(PVOID addr, const char *desc, DWORD expected
memset
(
&
info
,
0x41
,
sizeof
(
info
));
memset
(
&
info
,
0x41
,
sizeof
(
info
));
info
.
VirtualAddress
=
addr
;
info
.
VirtualAddress
=
addr
;
ret
=
pQueryWorkingSetEx
(
GetCurrentProcess
(),
&
info
,
sizeof
(
info
));
ret
=
pQueryWorkingSetEx
(
GetCurrentProcess
(),
&
info
,
sizeof
(
info
));
ok
(
ret
,
"QueryWorkingSetEx failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"QueryWorkingSetEx failed with %
l
d
\n
"
,
GetLastError
());
todo_wine_if
(
todo
)
todo_wine_if
(
todo
)
ok
(
info
.
VirtualAttributes
.
Valid
==
expected_valid
,
"%s expected Valid=%u but got %u
\n
"
,
ok
(
info
.
VirtualAttributes
.
Valid
==
expected_valid
,
"%s expected Valid=%
l
u but got %u
\n
"
,
desc
,
expected_valid
,
info
.
VirtualAttributes
.
Valid
);
desc
,
expected_valid
,
info
.
VirtualAttributes
.
Valid
);
todo_wine_if
(
todo
)
todo_wine_if
(
todo
)
ok
(
info
.
VirtualAttributes
.
Win32Protection
==
expected_protection
,
"%s expected Win32Protection=%u but got %u
\n
"
,
ok
(
info
.
VirtualAttributes
.
Win32Protection
==
expected_protection
,
"%s expected Win32Protection=%
l
u but got %u
\n
"
,
desc
,
expected_protection
,
info
.
VirtualAttributes
.
Win32Protection
);
desc
,
expected_protection
,
info
.
VirtualAttributes
.
Win32Protection
);
ok
(
info
.
VirtualAttributes
.
Node
==
0
,
"%s expected Node=0 but got %u
\n
"
,
ok
(
info
.
VirtualAttributes
.
Node
==
0
,
"%s expected Node=0 but got %u
\n
"
,
...
@@ -788,7 +788,7 @@ static void check_QueryWorkingSetEx(PVOID addr, const char *desc, DWORD expected
...
@@ -788,7 +788,7 @@ static void check_QueryWorkingSetEx(PVOID addr, const char *desc, DWORD expected
desc
,
info
.
VirtualAttributes
.
LargePage
);
desc
,
info
.
VirtualAttributes
.
LargePage
);
ok
(
info
.
VirtualAttributes
.
Shared
==
expected_shared
||
broken
(
!
info
.
VirtualAttributes
.
Valid
)
/* w2003 */
,
ok
(
info
.
VirtualAttributes
.
Shared
==
expected_shared
||
broken
(
!
info
.
VirtualAttributes
.
Valid
)
/* w2003 */
,
"%s expected Shared=%u but got %u
\n
"
,
desc
,
expected_shared
,
info
.
VirtualAttributes
.
Shared
);
"%s expected Shared=%
l
u but got %u
\n
"
,
desc
,
expected_shared
,
info
.
VirtualAttributes
.
Shared
);
if
(
info
.
VirtualAttributes
.
Valid
&&
info
.
VirtualAttributes
.
Shared
)
if
(
info
.
VirtualAttributes
.
Valid
&&
info
.
VirtualAttributes
.
Shared
)
ok
(
info
.
VirtualAttributes
.
ShareCount
>
0
,
"%s expected ShareCount > 0 but got %u
\n
"
,
ok
(
info
.
VirtualAttributes
.
ShareCount
>
0
,
"%s expected ShareCount > 0 but got %u
\n
"
,
desc
,
info
.
VirtualAttributes
.
ShareCount
);
desc
,
info
.
VirtualAttributes
.
ShareCount
);
...
@@ -813,19 +813,19 @@ static void test_QueryWorkingSetEx(void)
...
@@ -813,19 +813,19 @@ static void test_QueryWorkingSetEx(void)
check_QueryWorkingSetEx
(
addr
,
"exe"
,
1
,
PAGE_READONLY
,
1
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"exe"
,
1
,
PAGE_READONLY
,
1
,
FALSE
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
PAGE_NOACCESS
,
&
prot
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
PAGE_NOACCESS
,
&
prot
);
ok
(
ret
,
"VirtualProtect failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualProtect failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"exe,noaccess"
,
0
,
0
,
1
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"exe,noaccess"
,
0
,
0
,
1
,
FALSE
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
prot
,
&
prot
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
prot
,
&
prot
);
ok
(
ret
,
"VirtualProtect failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualProtect failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"exe,readonly1"
,
0
,
0
,
1
,
TRUE
);
check_QueryWorkingSetEx
(
addr
,
"exe,readonly1"
,
0
,
0
,
1
,
TRUE
);
*
(
volatile
char
*
)
addr
;
*
(
volatile
char
*
)
addr
;
ok
(
ret
,
"VirtualProtect failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualProtect failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"exe,readonly2"
,
1
,
PAGE_READONLY
,
1
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"exe,readonly2"
,
1
,
PAGE_READONLY
,
1
,
FALSE
);
addr
=
VirtualAlloc
(
NULL
,
0x1000
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_READWRITE
);
addr
=
VirtualAlloc
(
NULL
,
0x1000
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_READWRITE
);
ok
(
addr
!=
NULL
,
"VirtualAlloc failed with %d
\n
"
,
GetLastError
());
ok
(
addr
!=
NULL
,
"VirtualAlloc failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"valloc"
,
0
,
0
,
0
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"valloc"
,
0
,
0
,
0
,
FALSE
);
*
(
volatile
char
*
)
addr
;
*
(
volatile
char
*
)
addr
;
...
@@ -835,18 +835,18 @@ static void test_QueryWorkingSetEx(void)
...
@@ -835,18 +835,18 @@ static void test_QueryWorkingSetEx(void)
check_QueryWorkingSetEx
(
addr
,
"valloc,write"
,
1
,
PAGE_READWRITE
,
0
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"valloc,write"
,
1
,
PAGE_READWRITE
,
0
,
FALSE
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
PAGE_NOACCESS
,
&
prot
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
PAGE_NOACCESS
,
&
prot
);
ok
(
ret
,
"VirtualProtect failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualProtect failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"valloc,noaccess"
,
0
,
0
,
0
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"valloc,noaccess"
,
0
,
0
,
0
,
FALSE
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
prot
,
&
prot
);
ret
=
VirtualProtect
(
addr
,
0x1000
,
prot
,
&
prot
);
ok
(
ret
,
"VirtualProtect failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualProtect failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"valloc,readwrite1"
,
0
,
0
,
0
,
TRUE
);
check_QueryWorkingSetEx
(
addr
,
"valloc,readwrite1"
,
0
,
0
,
0
,
TRUE
);
*
(
volatile
char
*
)
addr
;
*
(
volatile
char
*
)
addr
;
check_QueryWorkingSetEx
(
addr
,
"valloc,readwrite2"
,
1
,
PAGE_READWRITE
,
0
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"valloc,readwrite2"
,
1
,
PAGE_READWRITE
,
0
,
FALSE
);
ret
=
VirtualFree
(
addr
,
0
,
MEM_RELEASE
);
ret
=
VirtualFree
(
addr
,
0
,
MEM_RELEASE
);
ok
(
ret
,
"VirtualFree failed with %d
\n
"
,
GetLastError
());
ok
(
ret
,
"VirtualFree failed with %
l
d
\n
"
,
GetLastError
());
check_QueryWorkingSetEx
(
addr
,
"valloc,free"
,
FALSE
,
0
,
0
,
FALSE
);
check_QueryWorkingSetEx
(
addr
,
"valloc,free"
,
FALSE
,
0
,
0
,
FALSE
);
}
}
...
@@ -860,13 +860,13 @@ START_TEST(psapi_main)
...
@@ -860,13 +860,13 @@ START_TEST(psapi_main)
IsWow64Process
(
GetCurrentProcess
(),
&
wow64
);
IsWow64Process
(
GetCurrentProcess
(),
&
wow64
);
hpSR
=
OpenProcess
(
STANDARD_RIGHTS_REQUIRED
,
FALSE
,
pid
);
hpSR
=
OpenProcess
(
STANDARD_RIGHTS_REQUIRED
,
FALSE
,
pid
);
ok
(
!!
hpSR
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!!
hpSR
,
"got error %
l
u
\n
"
,
GetLastError
());
hpQI
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
pid
);
hpQI
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
pid
);
ok
(
!!
hpQI
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!!
hpQI
,
"got error %
l
u
\n
"
,
GetLastError
());
hpVR
=
OpenProcess
(
PROCESS_VM_READ
,
FALSE
,
pid
);
hpVR
=
OpenProcess
(
PROCESS_VM_READ
,
FALSE
,
pid
);
ok
(
!!
hpVR
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!!
hpVR
,
"got error %
l
u
\n
"
,
GetLastError
());
hpQV
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_VM_READ
,
FALSE
,
pid
);
hpQV
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_VM_READ
,
FALSE
,
pid
);
ok
(
!!
hpQV
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!!
hpQV
,
"got error %
l
u
\n
"
,
GetLastError
());
test_EnumProcesses
();
test_EnumProcesses
();
test_EnumProcessModules
();
test_EnumProcessModules
();
...
...
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