ReactOS 0.4.15-dev-8135-g1bc6c90
OpenPrinter.c File Reference
#include <apitest.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winspool.h>
Include dependency graph for OpenPrinter.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

 START_TEST (OpenPrinter)
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file OpenPrinter.c.

Function Documentation

◆ START_TEST()

START_TEST ( OpenPrinter  )

Definition at line 16 of file OpenPrinter.c.

17{
18 HANDLE hPrinter;
19
20 // Give no handle at all, this has to fail
21 SetLastError(0xDEADBEEF);
22 ok(!OpenPrinterW(NULL, NULL, NULL), "OpenPrinterW returns TRUE!\n");
23 ok(GetLastError() == ERROR_INVALID_PARAMETER, "OpenPrinterW returns error %lu!\n", GetLastError());
24
25 // Open a handle to the local print server
26 SetLastError(0xDEADBEEF);
27 ok(OpenPrinterW(NULL, &hPrinter, NULL), "OpenPrinterW returns FALSE!\n");
28 ok(GetLastError() == ERROR_SUCCESS, "OpenPrinterW returns error %lu!\n", GetLastError());
29 ClosePrinter(hPrinter);
30}
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WINBOOL WINAPI OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault)
Definition: printers.c:2653
WINBOOL WINAPI ClosePrinter(HANDLE hPrinter)
Definition: printers.c:176