ReactOS
0.4.16-dev-570-g1868985
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
MarshallUpStructuresArray.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Spooler Router API Tests
3
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4
* PURPOSE: Tests for MarshallUpStructuresArray
5
* COPYRIGHT: Copyright 2018 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 <
marshalling/marshalling.h
>
14
15
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
16
17
START_TEST
(
MarshallUpStructuresArray
)
18
{
19
// Setting cElements to zero should yield success.
20
SetLastError
(0xDEADBEEF);
21
ok
(
MarshallUpStructuresArray
(0,
NULL
, 0,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns FALSE!\n"
);
22
ok
(
GetLastError
() == 0xDEADBEEF,
"GetLastError returns %lu!\n"
,
GetLastError
());
23
24
// Setting cElements non-zero should fail with ERROR_INVALID_PARAMETER.
25
SetLastError
(0xDEADBEEF);
26
ok
(!
MarshallUpStructuresArray
(0,
NULL
, 1,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
27
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
28
29
// This is triggered by both pStructuresArray and pInfo.
30
SetLastError
(0xDEADBEEF);
31
ok
(!
MarshallUpStructuresArray
(0,
INVALID_POINTER
, 1,
NULL
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
32
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
33
34
SetLastError
(0xDEADBEEF);
35
ok
(!
MarshallUpStructuresArray
(0,
NULL
, 1, (
const
MARSHALLING_INFO
*)
INVALID_POINTER
, 0,
FALSE
),
"MarshallUpStructuresArray returns TRUE!\n"
);
36
ok
(
GetLastError
() ==
ERROR_INVALID_PARAMETER
,
"GetLastError returns %lu!\n"
,
GetLastError
());
37
38
// More testing is conducted in the MarshallDownStructuresArray test.
39
}
INVALID_POINTER
#define INVALID_POINTER
Definition:
MarshallUpStructuresArray.c:15
apitest.h
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NULL
#define NULL
Definition:
types.h:112
FALSE
#define FALSE
Definition:
types.h:117
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition:
compat.h:101
SetLastError
#define SetLastError(x)
Definition:
compat.h:752
MarshallUpStructuresArray
BOOL WINAPI MarshallUpStructuresArray(DWORD cbSize, PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition:
marshalling.c:202
marshalling.h
_MARSHALLING_INFO
Definition:
marshalling.h:13
winbase.h
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
windef.h
modules
rostests
apitests
spoolss
MarshallUpStructuresArray.c
Generated on Wed Jan 22 2025 06:08:02 for ReactOS by
1.9.6