ReactOS
0.4.16-dev-59-gd481587
MarshallUpStructuresArray.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Spooler Router API Tests
3
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4
* PURPOSE: Tests for MarshallUpStructuresArray
5
* COPYRIGHT: Copyright 2018 Colin Finck (colin@reactos.org)
6
*/
7
8
#include <
apitest.h
>
9
10
#define WIN32_NO_STATUS
11
#include <
windef.h
>
12
#include <
winbase.h
>
13
#include <
marshalling/marshalling.h
>
14
15
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
16
17
START_TEST
(
MarshallUpStructuresArray
)
18
{
19
// Setting cElements to zero should yield success.
20
SetLastError
(0xDEADBEEF);
21
ok
(
MarshallUpStructuresArray
(0,
NULL
, 0,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns FALSE!\n"
);
22
ok
(
GetLastError
() == 0xDEADBEEF,
"GetLastError returns %lu!\n"
,
GetLastError
());
23
24
// Setting cElements non-zero should fail with ERROR_INVALID_PARAMETER.
25
SetLastError
(0xDEADBEEF);
26
ok
(!
MarshallUpStructuresArray
(0,
NULL
, 1,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
27
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
28
29
// This is triggered by both pStructuresArray and pInfo.
30
SetLastError
(0xDEADBEEF);
31
ok
(!
MarshallUpStructuresArray
(0,
INVALID_POINTER
, 1,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
32
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
33
34
SetLastError
(0xDEADBEEF);
35
ok
(!
MarshallUpStructuresArray
(0,
NULL
, 1, (
const
MARSHALLING_INFO
*)
INVALID_POINTER
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
36
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
37
38
// More testing is conducted in the MarshallDownStructuresArray test.
39
}
INVALID_POINTER
#define INVALID_POINTER
Definition:
MarshallUpStructuresArray.c:15
apitest.h
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NULL
#define NULL
Definition:
types.h:112
FALSE
#define FALSE
Definition:
types.h:117
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition:
compat.h:101
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
MarshallUpStructuresArray
BOOL WINAPI MarshallUpStructuresArray(DWORD cbSize, PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition:
marshalling.c:202
marshalling.h
_MARSHALLING_INFO
Definition:
marshalling.h:13
winbase.h
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
windef.h
modules
rostests
apitests
spoolss
MarshallUpStructuresArray.c
Generated on Thu Sep 19 2024 06:07:33 for ReactOS by
1.9.6