1 /*
2 * PROJECT: ReactOS Print Spooler DLL API Tests
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Tests for StartDocPrinterA/StartDocPrinterW
5 * COPYRIGHT: Copyright 2015 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 <wingdi.h>
14 #include <winspool.h>
15
START_TEST(StartDocPrinter)16 START_TEST(StartDocPrinter)
17 {
18 DWORD dwResult;
19 DOCINFOW docInfo = { 0 };
20
21 SetLastError(0xDEADBEEF);
22 dwResult = StartDocPrinterW(NULL, 0, NULL);
23 ok(dwResult == 0, "StartDocPrinterW returns %lu!\n", dwResult);
24 ok(GetLastError() == ERROR_INVALID_HANDLE, "StartDocPrinter returns error %lu!\n", GetLastError());
25
26 SetLastError(0xDEADBEEF);
27 dwResult = StartDocPrinterW(NULL, 1, NULL);
28 ok(dwResult == 0, "StartDocPrinterW returns %lu!\n", dwResult);
29 ok(GetLastError() == ERROR_INVALID_HANDLE, "StartDocPrinter returns error %lu!\n", GetLastError());
30
31 SetLastError(0xDEADBEEF);
32 dwResult = StartDocPrinterW(NULL, 0, (LPBYTE)&docInfo);
33 ok(dwResult == 0, "StartDocPrinterW returns %lu!\n", dwResult);
34 ok(GetLastError() == ERROR_INVALID_HANDLE, "StartDocPrinter returns error %lu!\n", GetLastError());
35
36 SetLastError(0xDEADBEEF);
37 dwResult = StartDocPrinterW(NULL, 1, (LPBYTE)&docInfo);
38 ok(dwResult == 0, "StartDocPrinterW returns %lu!\n", dwResult);
39 ok(GetLastError() == ERROR_INVALID_HANDLE, "StartDocPrinter returns error %lu!\n", GetLastError());
40
41 /// ERROR_INVALID_LEVEL with correct handle but invalid Level
42 }
43