[PRINTING] Implement the undocumented MarshallDownStructure, MarshallDownStructuresAr...
[reactos.git] / modules / rostests / apitests / spoolss / MarshallUpStructuresArray.c
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 START_TEST(MarshallUpStructuresArray)
16 {
17 // Setting cElements to zero should yield success.
18 SetLastError(0xDEADBEEF);
19 ok(MarshallUpStructuresArray(0, NULL, 0, NULL, 0, FALSE), "MarshallUpStructuresArray returns FALSE!\n");
20 ok(GetLastError() == 0xDEADBEEF, "GetLastError returns %lu!\n", GetLastError());
21
22 // Setting cElements non-zero should fail with ERROR_INVALID_PARAMETER.
23 SetLastError(0xDEADBEEF);
24 ok(!MarshallUpStructuresArray(0, NULL, 1, NULL, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
25 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
26
27 // This is triggered by both pStructuresArray and pInfo.
28 SetLastError(0xDEADBEEF);
29 ok(!MarshallUpStructuresArray(0, (PVOID)0xDEADDEAD, 1, NULL, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
30 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
31
32 SetLastError(0xDEADBEEF);
33 ok(!MarshallUpStructuresArray(0, NULL, 1, (const MARSHALLING_INFO*)0xDEADDEAD, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
34 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
35
36 // More testing is conducted in the MarshallDownStructuresArray test.
37 }