ReactOS
0.4.16-dev-963-g182f353
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
OpenPrinter.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 OpenPrinterA/OpenPrinterW
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
16
START_TEST
(
OpenPrinter
)
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
}
apitest.h
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
ERROR_SUCCESS
#define ERROR_SUCCESS
Definition:
deptool.c:10
NULL
#define NULL
Definition:
types.h:112
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition:
compat.h:101
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
void
Definition:
nsiface.idl:2307
winbase.h
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
windef.h
wingdi.h
winspool.h
OpenPrinterW
WINBOOL WINAPI OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault)
Definition:
printers.c:2653
ClosePrinter
WINBOOL WINAPI ClosePrinter(HANDLE hPrinter)
Definition:
printers.c:176
OpenPrinter
#define OpenPrinter
Definition:
winspool.h:921
modules
rostests
apitests
winspool
OpenPrinter.c
Generated on Mon Apr 7 2025 06:10:39 for ReactOS by
1.9.6