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
9ed10e48
Commit
9ed10e48
authored
Mar 09, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c9714294
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
110 deletions
+117
-110
atom.c
dlls/kernel32/tests/atom.c
+17
-16
drive.c
dlls/kernel32/tests/drive.c
+19
-18
mailslot.c
dlls/kernel32/tests/mailslot.c
+27
-26
power.c
dlls/kernel32/tests/power.c
+6
-5
resource.c
dlls/kernel32/tests/resource.c
+24
-23
timer.c
dlls/kernel32/tests/timer.c
+15
-14
toolhelp.c
dlls/kernel32/tests/toolhelp.c
+9
-8
No files found.
dlls/kernel32/tests/atom.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -115,20 +116,20 @@ static void test_add_atom(void)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomA
((
LPCSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %
l
x
\n
"
,
i
);
"failed to add atom %
I
x
\n
"
,
i
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomW
((
LPCWSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %
l
x
\n
"
,
i
);
"failed to add atom %
I
x
\n
"
,
i
);
}
}
for
(
i
=
0xc000
;
i
<=
0xffff
;
i
++
)
{
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %
l
x
\n
"
,
i
);
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %
I
x
\n
"
,
i
);
if
(
unicode_OS
)
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %
l
x
\n
"
,
i
);
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %
I
x
\n
"
,
i
);
}
}
...
...
@@ -196,7 +197,7 @@ static void test_get_atom_name(void)
len
=
GlobalGetAtomNameA
(
(
ATOM
)
i
,
buf
,
2
);
ok
(
!
len
,
"bad length %d
\n
"
,
len
);
ok
(
GetLastError
()
==
ERROR_MORE_DATA
||
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error conditions %u for %u
\n
"
,
GetLastError
(),
i
);
"wrong error conditions %
l
u for %u
\n
"
,
GetLastError
(),
i
);
}
memset
(
buf
,
'.'
,
sizeof
(
buf
)
);
...
...
@@ -229,7 +230,7 @@ static void test_get_atom_name(void)
SetLastError
(
0xdeadbeef
);
len
=
GlobalGetAtomNameA
(
atom
,
out
,
10
);
ok
(
!
len
,
"bad length %d
\n
"
,
len
);
ok
(
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error code (%u instead of %u)
\n
"
,
GetLastError
(),
ERROR_MORE_DATA
);
ok
(
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error code (%
l
u instead of %u)
\n
"
,
GetLastError
(),
ERROR_MORE_DATA
);
for
(
i
=
0
;
i
<
9
;
i
++
)
{
ok
(
out
[
i
]
==
"abcdefghij"
[
i
%
10
],
"wrong string at %i (%c instead of %c)
\n
"
,
i
,
out
[
i
],
"abcdefghij"
[
i
%
10
]);
...
...
@@ -266,7 +267,7 @@ static void test_get_atom_name(void)
{
/* len == 0 with ERROR_MORE_DATA is on NT3.51 */
ok
(
len
==
1
||
(
len
==
0
&&
GetLastError
()
==
ERROR_MORE_DATA
),
"0x%04x: got %u with %d (expected '1' or '0' with "
"0x%04x: got %u with %
l
d (expected '1' or '0' with "
"ERROR_MORE_DATA)
\n
"
,
i
,
len
,
GetLastError
());
ok
(
outW
[
1
]
==
DOUBLE
(
'.'
),
"buffer overwrite
\n
"
);
}
...
...
@@ -373,20 +374,20 @@ static void test_local_add_atom(void)
{
SetLastError
(
0xdeadbeef
);
ok
(
AddAtomA
((
LPCSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %
l
x
\n
"
,
i
);
"failed to add atom %
I
x
\n
"
,
i
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
AddAtomW
((
LPCWSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %
l
x
\n
"
,
i
);
"failed to add atom %
I
x
\n
"
,
i
);
}
}
for
(
i
=
0xc000
;
i
<=
0xffff
;
i
++
)
{
ok
(
!
AddAtomA
((
LPCSTR
)
i
),
"succeeded adding %
l
x
\n
"
,
i
);
ok
(
!
AddAtomA
((
LPCSTR
)
i
),
"succeeded adding %
I
x
\n
"
,
i
);
if
(
unicode_OS
)
ok
(
!
AddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %
l
x
\n
"
,
i
);
ok
(
!
AddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %
I
x
\n
"
,
i
);
}
}
...
...
@@ -472,11 +473,11 @@ static void test_local_get_atom_name(void)
if
(
i
)
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
||
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error conditions %u for %u
\n
"
,
GetLastError
(),
i
);
"wrong error conditions %
l
u for %u
\n
"
,
GetLastError
(),
i
);
else
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error conditions %u for %u
\n
"
,
GetLastError
(),
i
);
"wrong error conditions %
l
u for %u
\n
"
,
GetLastError
(),
i
);
}
/* test string limits & overflow */
do_initA
(
in
,
"abcdefghij"
,
255
);
...
...
@@ -505,7 +506,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error code (%u)
\n
"
,
GetLastError
());
"wrong error code (%
l
u)
\n
"
,
GetLastError
());
if
(
unicode_OS
)
{
...
...
@@ -532,7 +533,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok
(
GetLastError
()
==
ERROR_MORE_DATA
||
GetLastError
()
==
(
i
?
ERROR_INSUFFICIENT_BUFFER
:
ERROR_INVALID_PARAMETER
),
"wrong error conditions %u for %u
\n
"
,
GetLastError
(),
i
);
"wrong error conditions %
l
u for %u
\n
"
,
GetLastError
(),
i
);
}
do_initW
(
inW
,
"abcdefghij"
,
255
);
atom
=
AddAtomW
(
inW
);
...
...
@@ -560,7 +561,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error code (%u)
\n
"
,
GetLastError
());
"wrong error code (%
l
u)
\n
"
,
GetLastError
());
}
}
...
...
dlls/kernel32/tests/drive.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include <stdarg.h>
...
...
@@ -35,7 +36,7 @@ static void test_GetDriveTypeA(void)
UINT
type
;
logical_drives
=
GetLogicalDrives
();
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %d
\n
"
,
GetLastError
());
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %
l
d
\n
"
,
GetLastError
());
for
(
drive
[
0
]
=
'A'
;
drive
[
0
]
<=
'Z'
;
drive
[
0
]
++
)
{
...
...
@@ -88,7 +89,7 @@ static void test_GetDriveTypeW(void)
UINT
type
;
logical_drives
=
GetLogicalDrives
();
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %d
\n
"
,
GetLastError
());
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %
l
d
\n
"
,
GetLastError
());
for
(
drive
[
0
]
=
'A'
;
drive
[
0
]
<=
'Z'
;
drive
[
0
]
++
)
{
...
...
@@ -142,21 +143,21 @@ static void test_GetDiskFreeSpaceA(void)
DWORD
logical_drives
;
ret
=
GetDiskFreeSpaceA
(
NULL
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
ret
,
"GetDiskFreeSpaceA error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceA error %
l
d
\n
"
,
GetLastError
());
ret
=
GetDiskFreeSpaceA
(
""
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
||
GetLastError
()
==
ERROR_INVALID_NAME
),
"GetDiskFreeSpaceA(
\"\"
): ret=%d GetLastError=%d
\n
"
,
"GetDiskFreeSpaceA(
\"\"
): ret=%d GetLastError=%
l
d
\n
"
,
ret
,
GetLastError
());
ret
=
GetDiskFreeSpaceA
(
"
\\
"
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
ret
,
"GetDiskFreeSpaceA error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceA error %
l
d
\n
"
,
GetLastError
());
ret
=
GetDiskFreeSpaceA
(
"/"
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
ret
,
"GetDiskFreeSpaceA error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceA error %
l
d
\n
"
,
GetLastError
());
logical_drives
=
GetLogicalDrives
();
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %d
\n
"
,
GetLastError
());
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %
l
d
\n
"
,
GetLastError
());
for
(
drive
[
0
]
=
'A'
;
drive
[
0
]
<=
'Z'
;
drive
[
0
]
++
)
{
...
...
@@ -169,7 +170,7 @@ static void test_GetDiskFreeSpaceA(void)
ret
=
GetDiskFreeSpaceA
(
drive
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
if
(
!
(
logical_drives
&
1
))
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
||
GetLastError
()
==
ERROR_INVALID_DRIVE
),
"GetDiskFreeSpaceA(%s): ret=%d GetLastError=%d
\n
"
,
"GetDiskFreeSpaceA(%s): ret=%d GetLastError=%
l
d
\n
"
,
drive
,
ret
,
GetLastError
());
else
{
...
...
@@ -177,12 +178,12 @@ static void test_GetDiskFreeSpaceA(void)
if
(
!
ret
)
/* GetDiskFreeSpaceA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
trace
(
"GetDiskFreeSpaceA(%s) failed with %d
\n
"
,
drive
,
GetLastError
());
trace
(
"GetDiskFreeSpaceA(%s) failed with %
l
d
\n
"
,
drive
,
GetLastError
());
if
(
GetVersion
()
&
0x80000000
)
/* win3.0 through winME */
ok
(
total_clusters
<=
65535
,
"total clusters is %d > 65535
\n
"
,
total_clusters
);
"total clusters is %
l
d > 65535
\n
"
,
total_clusters
);
else
if
(
pGetDiskFreeSpaceExA
)
{
/* NT, 2k, XP : GetDiskFreeSpace should be accurate */
ULARGE_INTEGER
totEx
,
tot
,
d
;
...
...
@@ -194,7 +195,7 @@ static void test_GetDiskFreeSpaceA(void)
if
(
!
ret
)
/* GetDiskFreeSpaceExA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
trace
(
"GetDiskFreeSpaceExA(%s) failed with %d
\n
"
,
drive
,
GetLastError
());
trace
(
"GetDiskFreeSpaceExA(%s) failed with %
l
d
\n
"
,
drive
,
GetLastError
());
ok
(
bytes_per_sector
==
0
||
/* empty cd rom drive */
totEx
.
QuadPart
<=
tot
.
QuadPart
,
...
...
@@ -222,21 +223,21 @@ static void test_GetDiskFreeSpaceW(void)
win_skip
(
"GetDiskFreeSpaceW is not available
\n
"
);
return
;
}
ok
(
ret
,
"GetDiskFreeSpaceW error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceW error %
l
d
\n
"
,
GetLastError
());
ret
=
GetDiskFreeSpaceW
(
empty_pathW
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"GetDiskFreeSpaceW(
\"\"
): ret=%d GetLastError=%d
\n
"
,
"GetDiskFreeSpaceW(
\"\"
): ret=%d GetLastError=%
l
d
\n
"
,
ret
,
GetLastError
());
ret
=
GetDiskFreeSpaceW
(
root_pathW
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
ret
,
"GetDiskFreeSpaceW(
\"\"
) error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceW(
\"\"
) error %
l
d
\n
"
,
GetLastError
());
ret
=
GetDiskFreeSpaceW
(
unix_style_root_pathW
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
ok
(
ret
,
"GetDiskFreeSpaceW error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetDiskFreeSpaceW error %
l
d
\n
"
,
GetLastError
());
logical_drives
=
GetLogicalDrives
();
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %d
\n
"
,
GetLastError
());
ok
(
logical_drives
!=
0
,
"GetLogicalDrives error %
l
d
\n
"
,
GetLastError
());
for
(
drive
[
0
]
=
'A'
;
drive
[
0
]
<=
'Z'
;
drive
[
0
]
++
)
{
...
...
@@ -247,12 +248,12 @@ static void test_GetDiskFreeSpaceW(void)
ret
=
GetDiskFreeSpaceW
(
drive
,
&
sectors_per_cluster
,
&
bytes_per_sector
,
&
free_clusters
,
&
total_clusters
);
if
(
!
(
logical_drives
&
1
))
ok
(
!
ret
&&
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"GetDiskFreeSpaceW(%c): ret=%d GetLastError=%d
\n
"
,
"GetDiskFreeSpaceW(%c): ret=%d GetLastError=%
l
d
\n
"
,
drive
[
0
],
ret
,
GetLastError
());
else
if
(
!
ret
)
/* GetDiskFreeSpaceW() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
trace
(
"GetDiskFreeSpaceW(%c) failed with %d
\n
"
,
drive
[
0
],
GetLastError
());
trace
(
"GetDiskFreeSpaceW(%c) failed with %
l
d
\n
"
,
drive
[
0
],
GetLastError
());
}
logical_drives
>>=
1
;
}
...
...
dlls/kernel32/tests/mailslot.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
...
...
@@ -81,38 +82,38 @@ static int mailslot_test(void)
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buffer
,
0
,
&
count
,
NULL
);
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"expected 0, got %u
\n
"
,
count
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %
l
u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"expected 0, got %
l
u
\n
"
,
count
);
count
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hSlot
,
buffer
,
0
,
&
count
,
NULL
);
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"expected 0, got %u
\n
"
,
count
);
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"expected 0, got %
l
u
\n
"
,
count
);
count
=
0
;
memset
(
buffer
,
0
,
sizeof
buffer
);
ret
=
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
);
ok
(
!
ret
,
"slot read
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %
l
u
\n
"
,
count
);
ok
(
!
WriteFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
),
"slot write
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
/* now try and open the client, but with the wrong sharing mode */
hWriter
=
CreateFileA
(
szmspath
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
/* vista */
||
GetLastError
()
==
ERROR_SHARING_VIOLATION
,
"error should be ERROR_SHARING_VIOLATION got %p / %u
\n
"
,
hWriter
,
GetLastError
());
"error should be ERROR_SHARING_VIOLATION got %p / %
l
u
\n
"
,
hWriter
,
GetLastError
());
if
(
hWriter
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter
);
/* now open the client with the correct sharing mode */
hWriter
=
CreateFileA
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
,
"existing mailslot err %u
\n
"
,
GetLastError
());
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
,
"existing mailslot err %
l
u
\n
"
,
GetLastError
());
/*
* opening a client should make no difference to
...
...
@@ -120,11 +121,11 @@ static int mailslot_test(void)
*/
ret
=
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
/
2
,
&
count
,
NULL
);
ok
(
!
ret
,
"slot read
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %
l
u
\n
"
,
count
);
ok
(
!
WriteFile
(
hSlot
,
buffer
,
sizeof
buffer
/
2
,
&
count
,
NULL
),
"slot write
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
/*
* we can't read from this client,
...
...
@@ -133,13 +134,13 @@ static int mailslot_test(void)
ok
(
!
ReadFile
(
hWriter
,
buffer
,
sizeof
buffer
/
2
,
&
count
,
NULL
),
"can read client
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
"wrong error %
l
u
\n
"
,
GetLastError
()
);
ok
(
WriteFile
(
hWriter
,
buffer
,
sizeof
buffer
/
2
,
&
count
,
NULL
),
"can't write client
\n
"
);
ok
(
!
ReadFile
(
hWriter
,
buffer
,
sizeof
buffer
/
2
,
&
count
,
NULL
),
"can read client
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
"wrong error %
l
u
\n
"
,
GetLastError
()
);
/*
* seeing as there's something in the slot,
...
...
@@ -152,8 +153,8 @@ static int mailslot_test(void)
/* but not again */
ret
=
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
);
ok
(
!
ret
,
"slot read
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %
l
u
\n
"
,
count
);
/* now try open another writer... should fail */
hWriter2
=
CreateFileA
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
...
...
@@ -214,8 +215,8 @@ static int mailslot_test(void)
/* check there's still no data */
ret
=
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
);
ok
(
!
ret
,
"slot read
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %
l
u
\n
"
,
count
);
/* write two messages */
buffer
[
0
]
=
'a'
;
...
...
@@ -250,7 +251,7 @@ static int mailslot_test(void)
"getmailslotinfo failed
\n
"
);
ok
(
dwNext
==
1
,
"dwNext incorrect
\n
"
);
todo_wine
ok
(
dwMsgCount
==
3
,
"dwMsgCount incorrect %u
\n
"
,
dwMsgCount
);
ok
(
dwMsgCount
==
3
,
"dwMsgCount incorrect %
l
u
\n
"
,
dwMsgCount
);
buffer
[
0
]
=
buffer
[
1
]
=
0
;
...
...
@@ -269,7 +270,7 @@ static int mailslot_test(void)
"getmailslotinfo failed
\n
"
);
ok
(
dwNext
==
2
,
"dwNext incorrect
\n
"
);
todo_wine
{
ok
(
dwMsgCount
==
2
,
"dwMsgCount incorrect %u
\n
"
,
dwMsgCount
);
ok
(
dwMsgCount
==
2
,
"dwMsgCount incorrect %
l
u
\n
"
,
dwMsgCount
);
}
/* read the second message */
...
...
@@ -282,9 +283,9 @@ static int mailslot_test(void)
dwNext
=
dwMsgCount
=
0
;
ok
(
GetMailslotInfo
(
hSlot
,
NULL
,
&
dwNext
,
&
dwMsgCount
,
NULL
),
"getmailslotinfo failed
\n
"
);
ok
(
dwNext
==
0
,
"dwNext incorrect %u
\n
"
,
dwNext
);
ok
(
dwNext
==
0
,
"dwNext incorrect %
l
u
\n
"
,
dwNext
);
todo_wine
{
ok
(
dwMsgCount
==
1
,
"dwMsgCount incorrect %u
\n
"
,
dwMsgCount
);
ok
(
dwMsgCount
==
1
,
"dwMsgCount incorrect %
l
u
\n
"
,
dwMsgCount
);
}
/* read the 3rd (zero length) message */
...
...
@@ -307,8 +308,8 @@ static int mailslot_test(void)
/* check that reads fail */
ret
=
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
);
ok
(
!
ret
,
"3rd slot read succeeded
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
else
ok
(
count
==
0
,
"wrong count %
l
u
\n
"
,
count
);
/* finally close the mailslot and its client */
ok
(
CloseHandle
(
hWriter2
),
"closing 2nd client
\n
"
);
...
...
@@ -322,9 +323,9 @@ static int mailslot_test(void)
memset
(
buffer
,
0
,
sizeof
buffer
);
dwTimeout
=
GetTickCount
();
ok
(
!
ReadFile
(
hSlot
,
buffer
,
sizeof
buffer
,
&
count
,
NULL
),
"slot read
\n
"
);
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
dwTimeout
=
GetTickCount
()
-
dwTimeout
;
ok
(
dwTimeout
>=
900
,
"timeout too short %u
\n
"
,
dwTimeout
);
ok
(
dwTimeout
>=
900
,
"timeout too short %
l
u
\n
"
,
dwTimeout
);
ok
(
CloseHandle
(
hSlot
),
"closing the mailslot
\n
"
);
return
0
;
...
...
dlls/kernel32/tests/power.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include "wine/test.h"
...
...
@@ -53,14 +54,14 @@ void test_GetSystemPowerStatus(void)
"expected %u%%-charged battery to have capacity flags 0x%02x, got 0x%02x
\n
"
,
ps
.
BatteryLifePercent
,
expected_capacity_flags
,
capacity_flags
);
ok
(
ps
.
BatteryLifeTime
<=
ps
.
BatteryFullLifeTime
,
"expected BatteryLifeTime %
u to be less than or equal to BatteryFullLifeTime %
u
\n
"
,
"expected BatteryLifeTime %
lu to be less than or equal to BatteryFullLifeTime %l
u
\n
"
,
ps
.
BatteryLifeTime
,
ps
.
BatteryFullLifeTime
);
if
(
ps
.
BatteryFlag
&
BATTERY_FLAG_CHARGING
)
{
ok
(
ps
.
BatteryLifeTime
==
BATTERY_LIFE_UNKNOWN
,
"expected BatteryLifeTime to be -1 when charging, got %u
\n
"
,
ps
.
BatteryLifeTime
);
"expected BatteryLifeTime to be -1 when charging, got %
l
u
\n
"
,
ps
.
BatteryLifeTime
);
ok
(
ps
.
BatteryFullLifeTime
==
BATTERY_LIFE_UNKNOWN
,
"expected BatteryFullLifeTime to be -1 when charging, got %u
\n
"
,
ps
.
BatteryFullLifeTime
);
"expected BatteryFullLifeTime to be -1 when charging, got %
l
u
\n
"
,
ps
.
BatteryFullLifeTime
);
}
}
else
...
...
@@ -71,9 +72,9 @@ void test_GetSystemPowerStatus(void)
ok
(
ps
.
BatteryLifePercent
==
BATTERY_PERCENTAGE_UNKNOWN
,
"expected BatteryLifePercent to be -1, got %u
\n
"
,
ps
.
BatteryLifePercent
);
ok
(
ps
.
BatteryLifeTime
==
BATTERY_LIFE_UNKNOWN
,
"expected BatteryLifeTime to be -1, got %u
\n
"
,
ps
.
BatteryLifeTime
);
"expected BatteryLifeTime to be -1, got %
l
u
\n
"
,
ps
.
BatteryLifeTime
);
ok
(
ps
.
BatteryFullLifeTime
==
BATTERY_LIFE_UNKNOWN
,
"expected BatteryFullLifeTime to be -1, got %u
\n
"
,
ps
.
BatteryFullLifeTime
);
"expected BatteryFullLifeTime to be -1, got %
l
u
\n
"
,
ps
.
BatteryFullLifeTime
);
}
}
...
...
dlls/kernel32/tests/resource.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include <windows.h>
#include <stdio.h>
...
...
@@ -332,10 +333,10 @@ static void update_resources_version( void )
MAKEINTRESOURCEA
(
0x4567
),
0xabcd
,
foo
,
sizeof
foo
);
ok
(
r
==
TRUE
,
"UpdateResource failed: %d
\n
"
,
GetLastError
());
ok
(
r
==
TRUE
,
"UpdateResource failed: %
l
d
\n
"
,
GetLastError
());
r
=
EndUpdateResourceA
(
res
,
FALSE
);
ok
(
r
,
"EndUpdateResource failed: %d
\n
"
,
GetLastError
());
ok
(
r
,
"EndUpdateResource failed: %
l
d
\n
"
,
GetLastError
());
}
static
void
update_resources_bigdata
(
void
)
...
...
@@ -352,7 +353,7 @@ static void update_resources_bigdata( void )
MAKEINTRESOURCEA
(
0x5647
),
0xcdba
,
foo
,
sizeof
foo
);
ok
(
r
==
TRUE
,
"UpdateResource failed: %d
\n
"
,
GetLastError
());
ok
(
r
==
TRUE
,
"UpdateResource failed: %
l
d
\n
"
,
GetLastError
());
r
=
EndUpdateResourceA
(
res
,
FALSE
);
ok
(
r
,
"EndUpdateResource failed
\n
"
);
...
...
@@ -367,27 +368,27 @@ static void update_resources_name( void )
BOOL
ret
;
res
=
BeginUpdateResourceA
(
filename
,
TRUE
);
ok
(
res
!=
NULL
,
"BeginUpdateResource failed: %u
\n
"
,
GetLastError
()
);
ok
(
res
!=
NULL
,
"BeginUpdateResource failed: %
l
u
\n
"
,
GetLastError
()
);
if
(
!
res
)
return
;
ret
=
UpdateResourceA
(
res
,
res_type
,
res_name
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
),
foo
,
sizeof
(
foo
)
);
ok
(
ret
==
TRUE
,
"UpdateResource failed: %u
\n
"
,
GetLastError
()
);
ok
(
ret
==
TRUE
,
"UpdateResource failed: %
l
u
\n
"
,
GetLastError
()
);
ret
=
EndUpdateResourceA
(
res
,
FALSE
);
ok
(
ret
,
"EndUpdateResource failed: %u
\n
"
,
GetLastError
()
);
ok
(
ret
,
"EndUpdateResource failed: %
l
u
\n
"
,
GetLastError
()
);
if
(
!
ret
)
return
;
module
=
LoadLibraryExA
(
filename
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
module
!=
NULL
,
"LoadLibraryEx failed: %u
\n
"
,
GetLastError
()
);
ok
(
module
!=
NULL
,
"LoadLibraryEx failed: %
l
u
\n
"
,
GetLastError
()
);
if
(
!
module
)
return
;
rsrc
=
FindResourceA
(
module
,
res_name
,
res_type
);
ok
(
rsrc
!=
NULL
||
broken
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
)
/* win2008 */
,
"FindResource failed: %u
\n
"
,
GetLastError
()
);
"FindResource failed: %
l
u
\n
"
,
GetLastError
()
);
ret
=
FreeLibrary
(
module
);
ok
(
ret
,
"FreeLibrary failed: %u
\n
"
,
GetLastError
()
);
ok
(
ret
,
"FreeLibrary failed: %
l
u
\n
"
,
GetLastError
()
);
}
static
void
check_exe
(
const
sec_verify
*
verify
)
...
...
@@ -402,7 +403,7 @@ static void check_exe( const sec_verify *verify )
DWORD
length
,
sec_count
=
0
;
file
=
CreateFileA
(
filename
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to create file (%d)
\n
"
,
GetLastError
());
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to create file (%
l
d)
\n
"
,
GetLastError
());
length
=
GetFileSize
(
file
,
NULL
);
ok
(
length
>=
verify
->
length
,
"file size wrong
\n
"
);
...
...
@@ -423,11 +424,11 @@ static void check_exe( const sec_verify *verify )
for
(
i
=
0
;
i
<
max_sections
;
i
++
)
if
(
verify
->
sect_out
[
i
])
{
ok
(
!
memcmp
(
&
verify
->
sect_out
[
i
]
->
Name
,
&
sec
[
sec_count
].
Name
,
8
),
"section %d name wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
VirtualAddress
==
sec
[
sec_count
].
VirtualAddress
,
"section %d vaddr wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
SizeOfRawData
<=
sec
[
sec_count
].
SizeOfRawData
,
"section %
d SizeOfRawData wrong (%d vs %
d)
\n
"
,
sec_count
,
verify
->
sect_out
[
i
]
->
SizeOfRawData
,
sec
[
sec_count
].
SizeOfRawData
);
ok
(
verify
->
sect_out
[
i
]
->
PointerToRawData
==
sec
[
sec_count
].
PointerToRawData
,
"section %d PointerToRawData wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
Characteristics
==
sec
[
sec_count
].
Characteristics
,
"section %d characteristics wrong
\n
"
,
sec_count
);
ok
(
!
memcmp
(
&
verify
->
sect_out
[
i
]
->
Name
,
&
sec
[
sec_count
].
Name
,
8
),
"section %
l
d name wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
VirtualAddress
==
sec
[
sec_count
].
VirtualAddress
,
"section %
l
d vaddr wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
SizeOfRawData
<=
sec
[
sec_count
].
SizeOfRawData
,
"section %
ld SizeOfRawData wrong (%ld vs %l
d)
\n
"
,
sec_count
,
verify
->
sect_out
[
i
]
->
SizeOfRawData
,
sec
[
sec_count
].
SizeOfRawData
);
ok
(
verify
->
sect_out
[
i
]
->
PointerToRawData
==
sec
[
sec_count
].
PointerToRawData
,
"section %
l
d PointerToRawData wrong
\n
"
,
sec_count
);
ok
(
verify
->
sect_out
[
i
]
->
Characteristics
==
sec
[
sec_count
].
Characteristics
,
"section %
l
d characteristics wrong
\n
"
,
sec_count
);
sec_count
++
;
}
...
...
@@ -438,17 +439,17 @@ static void check_exe( const sec_verify *verify )
dir
=
(
void
*
)
((
BYTE
*
)
dos
+
sec
[
verify
->
rsrc_section
].
VirtualAddress
);
ok
(
dir
->
Characteristics
==
0
,
"Characteristics wrong
\n
"
);
ok
(
dir
->
TimeDateStamp
==
0
,
"TimeDateStamp wrong %u
\n
"
,
dir
->
TimeDateStamp
);
ok
(
dir
->
TimeDateStamp
==
0
,
"TimeDateStamp wrong %
l
u
\n
"
,
dir
->
TimeDateStamp
);
ok
(
dir
->
MajorVersion
==
4
,
"MajorVersion wrong
\n
"
);
ok
(
dir
->
MinorVersion
==
0
,
"MinorVersion wrong
\n
"
);
ok
(
dir
->
NumberOfNamedEntries
==
verify
->
NumberOfNamedEntries
,
"NumberOfNamedEntries should be %d instead of %d
\n
"
,
ok
(
dir
->
NumberOfNamedEntries
==
verify
->
NumberOfNamedEntries
,
"NumberOfNamedEntries should be %
l
d instead of %d
\n
"
,
verify
->
NumberOfNamedEntries
,
dir
->
NumberOfNamedEntries
);
ok
(
dir
->
NumberOfIdEntries
==
verify
->
NumberOfIdEntries
,
"NumberOfIdEntries should be %d instead of %d
\n
"
,
ok
(
dir
->
NumberOfIdEntries
==
verify
->
NumberOfIdEntries
,
"NumberOfIdEntries should be %
l
d instead of %d
\n
"
,
verify
->
NumberOfIdEntries
,
dir
->
NumberOfIdEntries
);
ok
(
opt
->
DataDirectory
[
IMAGE_FILE_RESOURCE_DIRECTORY
].
VirtualAddress
==
sec
[
verify
->
rsrc_section
].
VirtualAddress
,
"VirtualAddress in optional header should be %
d instead of %
d
\n
"
,
"VirtualAddress in optional header should be %
ld instead of %l
d
\n
"
,
sec
[
verify
->
rsrc_section
].
VirtualAddress
,
opt
->
DataDirectory
[
IMAGE_FILE_RESOURCE_DIRECTORY
].
VirtualAddress
);
}
...
...
@@ -476,24 +477,24 @@ static void test_find_resource(void)
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceW
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
1
),
(
LPCWSTR
)
RT_DIALOG
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceW
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
2
),
(
LPCWSTR
)
RT_MENU
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_NAME_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_NAME_NOT_FOUND
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceExW
(
GetModuleHandleW
(
NULL
),
(
LPCWSTR
)
RT_MENU
,
MAKEINTRESOURCEW
(
1
),
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
)
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResourceExW
(
GetModuleHandleW
(
NULL
),
(
LPCWSTR
)
RT_MENU
,
MAKEINTRESOURCEW
(
1
),
MAKELANGID
(
LANG_FRENCH
,
SUBLANG_DEFAULT
)
);
ok
(
!
rsrc
,
"resource found
\n
"
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_LANG_NOT_FOUND
,
"wrong error %
l
u
\n
"
,
GetLastError
()
);
}
typedef
struct
...
...
dlls/kernel32/tests/timer.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include "wine/test.h"
#include "winbase.h"
...
...
@@ -79,10 +80,10 @@ static DWORD WINAPI thread_WaitForSingleObject(void *arg)
ok
(
event
!=
NULL
,
"CreateEvent failed
\n
"
);
t
=
GetTickCount
();
r
=
WaitForSingleObject
(
event
,
3000
);
ok
(
r
==
WAIT_TIMEOUT
,
"WiatForSingleObject returned %x
\n
"
,
r
);
ok
(
r
==
WAIT_TIMEOUT
,
"WiatForSingleObject returned %
l
x
\n
"
,
r
);
CloseHandle
(
event
);
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -92,7 +93,7 @@ static DWORD WINAPI thread_Sleep(void *arg)
Sleep
(
3000
);
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -102,7 +103,7 @@ static DWORD WINAPI thread_SleepEx(void *arg)
SleepEx
(
3000
,
TRUE
);
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -122,10 +123,10 @@ static DWORD WINAPI thread_WaitableTimer_rel(void *arg)
ok
(
r
,
"SetWaitableTimer failed
\n
"
);
r
=
WaitForSingleObject
(
timer
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %d
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
d
\n
"
,
r
);
CloseHandle
(
timer
);
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -149,10 +150,10 @@ static DWORD WINAPI thread_WaitableTimer_abs(void *arg)
ok
(
r
,
"SetWaitableTimer failed
\n
"
);
r
=
WaitForSingleObject
(
timer
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %d
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
d
\n
"
,
r
);
CloseHandle
(
timer
);
t
=
GetTickCount
()
-
t
;
ok
(
t
<
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
<
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -172,13 +173,13 @@ static DWORD WINAPI thread_WaitableTimer_period(void *arg)
ok
(
r
,
"SetWaitableTimer failed
\n
"
);
r
=
WaitForSingleObject
(
timer
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %d
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
d
\n
"
,
r
);
r
=
WaitForSingleObject
(
timer
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %d
\n
"
,
r
);
ok
(
r
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %
l
d
\n
"
,
r
);
CloseHandle
(
timer
);
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
return
0
;
}
...
...
@@ -189,7 +190,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
MSG
msg
;
timer
=
SetTimer
(
NULL
,
0
,
3000
,
NULL
);
ok
(
timer
,
"SetTimer failed (%d)
\n
"
,
GetLastError
());
ok
(
timer
,
"SetTimer failed (%
l
d)
\n
"
,
GetLastError
());
while
(
GetMessageW
(
&
msg
,
NULL
,
0
,
0
))
{
...
...
@@ -198,7 +199,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
}
t
=
GetTickCount
()
-
t
;
ok
(
t
>
2000
,
"t = %d
\n
"
,
t
);
ok
(
t
>
2000
,
"t = %
l
d
\n
"
,
t
);
KillTimer
(
NULL
,
timer
);
return
0
;
}
...
...
@@ -210,7 +211,7 @@ static void test_timeouts(void)
if
(
!
adjust_system_time
(
1
))
{
skip
(
"can't adjust system clock (%d)
\n
"
,
GetLastError
());
skip
(
"can't adjust system clock (%
l
d)
\n
"
,
GetLastError
());
return
;
}
...
...
dlls/kernel32/tests/toolhelp.c
View file @
9ed10e48
...
...
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#undef WINE_NO_LONG_TYPES
/* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
...
...
@@ -124,7 +125,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if
(
pe
.
th32ProcessID
==
curr_pid
)
found
++
;
if
(
pe
.
th32ProcessID
==
sub_pcs_pid
)
{
childpos
=
num
;
found
++
;
}
trace
(
"PID=%x %s
\n
"
,
pe
.
th32ProcessID
,
pe
.
szExeFile
);
trace
(
"PID=%
l
x %s
\n
"
,
pe
.
th32ProcessID
,
pe
.
szExeFile
);
num
++
;
}
while
(
pProcess32Next
(
hSnapshot
,
&
pe
));
}
...
...
@@ -138,7 +139,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if
(
pe
.
th32ProcessID
==
curr_pid
)
found
++
;
if
(
pe
.
th32ProcessID
==
sub_pcs_pid
)
found
++
;
trace
(
"PID=%x %s
\n
"
,
pe
.
th32ProcessID
,
pe
.
szExeFile
);
trace
(
"PID=%
l
x %s
\n
"
,
pe
.
th32ProcessID
,
pe
.
szExeFile
);
num
--
;
}
while
(
pProcess32Next
(
hSnapshot
,
&
pe
));
}
...
...
@@ -237,7 +238,7 @@ static DWORD WINAPI get_id_thread(void* curr_pid)
free
(
pcs_buffer
);
pcs_buffer
=
malloc
(
buf_size
);
}
ok
(
status
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"got %#
l
x
\n
"
,
status
);
found
=
FALSE
;
matched_idx
=
-
1
;
...
...
@@ -332,7 +333,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if
(
te
.
th32OwnerProcessID
==
curr_pid
)
curr_found
++
;
if
(
te
.
th32OwnerProcessID
==
sub_pcs_pid
)
sub_found
++
;
if
(
winetest_debug
>
1
)
trace
(
"PID=%
x TID=%x %
d
\n
"
,
te
.
th32OwnerProcessID
,
te
.
th32ThreadID
,
te
.
tpBasePri
);
trace
(
"PID=%
lx TID=%lx %l
d
\n
"
,
te
.
th32OwnerProcessID
,
te
.
th32ThreadID
,
te
.
tpBasePri
);
num
++
;
}
while
(
pThread32Next
(
hSnapshot
,
&
te
));
}
...
...
@@ -349,7 +350,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if
(
te
.
th32OwnerProcessID
==
curr_pid
)
curr_found
++
;
if
(
te
.
th32OwnerProcessID
==
sub_pcs_pid
)
sub_found
++
;
if
(
winetest_debug
>
1
)
trace
(
"PID=%
x TID=%x %
d
\n
"
,
te
.
th32OwnerProcessID
,
te
.
th32ThreadID
,
te
.
tpBasePri
);
trace
(
"PID=%
lx TID=%lx %l
d
\n
"
,
te
.
th32OwnerProcessID
,
te
.
th32ThreadID
,
te
.
tpBasePri
);
num
--
;
}
while
(
pThread32Next
(
hSnapshot
,
&
te
));
}
...
...
@@ -399,7 +400,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
trace
(
"PID=%
x base=%p size=%
x %s %s
\n
"
,
trace
(
"PID=%
lx base=%p size=%l
x %s %s
\n
"
,
me
.
th32ProcessID
,
me
.
modBaseAddr
,
me
.
modBaseSize
,
me
.
szExePath
,
me
.
szModule
);
ok
(
me
.
th32ProcessID
==
pid
,
"wrong returned process id
\n
"
);
for
(
i
=
0
;
i
<
num_expected
;
i
++
)
...
...
@@ -418,7 +419,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
trace
(
"PID=%
x base=%p size=%
x %s %s
\n
"
,
trace
(
"PID=%
lx base=%p size=%l
x %s %s
\n
"
,
me
.
th32ProcessID
,
me
.
modBaseAddr
,
me
.
modBaseSize
,
me
.
szExePath
,
me
.
szModule
);
for
(
i
=
0
;
i
<
num_expected
;
i
++
)
if
(
!
lstrcmpiA
(
expected
[
i
],
me
.
szModule
))
found
[
i
]
++
;
...
...
@@ -489,7 +490,7 @@ START_TEST(toolhelp)
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
startup
.
wShowWindow
=
SW_SHOWNORMAL
;
sprintf
(
buffer
,
"%s toolhelp %
lu %l
u"
,
selfname
,
(
DWORD_PTR
)
ev1
,
(
DWORD_PTR
)
ev2
);
sprintf
(
buffer
,
"%s toolhelp %
Iu %I
u"
,
selfname
,
(
DWORD_PTR
)
ev1
,
(
DWORD_PTR
)
ev2
);
ok
(
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
),
"CreateProcess
\n
"
);
/* wait for child to be initialized */
w
=
WaitForSingleObject
(
ev1
,
WAIT_TIME
);
...
...
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