ReactOS 0.4.15-dev-7659-ga55345b
StartDocPrinter.c
Go to the documentation of this file.
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
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
42}
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define StartDocPrinter
Definition: winspool.h:941
DWORD WINAPI StartDocPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)