#include <apitest.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winreg.h>
#include <winspool.h>
#include <winsplp.h>
#include "../localspl_apitest.h"
#include <spoolss.h>
Go to the source code of this file.
◆ MAX_PRINTER_NAME
◆ WIN32_NO_STATUS
◆ GetDefaultPrinterFromRegistry()
We don't link against winspool, so we don't have GetDefaultPrinterW. We can easily implement a similar function ourselves though.
Definition at line 43 of file main.c.
44{
45 static const WCHAR wszWindowsKey[] =
L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows";
47
54
55
58 {
59 skip(
"RegOpenKeyExW failed with status %u!\n", dwErrorCode);
61 }
62
63
66 {
67 skip(
"RegQueryValueExW failed with status %u!\n", dwErrorCode);
69 }
70
71
73 if (!pwszDevice)
74 {
75 skip(
"HeapAlloc failed!\n");
77 }
78
79
82 {
83 skip(
"RegQueryValueExW failed with status %u!\n", dwErrorCode);
85 }
86
87
88
89 pwszComma =
wcschr(pwszDevice,
L',');
90 if (!pwszComma)
91 {
92 skip(
"Found no or invalid default printer: %S!\n", pwszDevice);
94 }
95
96
97 *pwszComma = 0;
98 pwszReturnValue = pwszDevice;
99
101 if (hWindowsKey)
103
104 return pwszReturnValue;
105}
static const WCHAR wszWindowsKey[]
static const WCHAR wszDeviceValue[]
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static const WCHAR Cleanup[]
#define HKEY_CURRENT_USER
Referenced by START_TEST().
◆ GetLocalsplFuncs()
Definition at line 108 of file main.c.
109{
112
113
115 if (!hLocalspl)
116 {
119 }
120
121
123 if (!pfnInitializePrintProvidor)
124 {
127 }
128
129
131 {
134 }
135
137}
#define GetProcAddress(x, y)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
BOOL(WINAPI * PInitializePrintProvidor)(LPPRINTPROVIDOR, DWORD, LPWSTR)
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ START_TEST()
Definition at line 27 of file fpSetJob.c.
28{
32
35
36
37 ok(!pp.fpSetJob(
NULL, 0, 0,
NULL, 0),
"fpSetJob returns TRUE\n");
39
40
42 if (!pwszDefaultPrinter)
43 {
44 skip(
"Could not determine the default printer!\n");
46 }
47
48 if (!pp.fpOpenPrinter(pwszDefaultPrinter, &hPrinter,
NULL))
49 {
50 skip(
"Could not open a handle to the default printer, last error is %lu!\n",
GetLastError());
52 }
53
54
55 ok(!pp.fpSetJob(hPrinter, 0, 0,
NULL, 0),
"fpSetJob returns TRUE\n");
57
59 if (pwszDefaultPrinter)
61
62 if (hPrinter)
63 pp.fpClosePrinter(hPrinter);
64}
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
PWSTR GetDefaultPrinterFromRegistry(VOID)
BOOL GetLocalsplFuncs(LPPRINTPROVIDOR pp)