ReactOS 0.4.15-dev-7705-g2320c37
MarshallUpStructuresArray.c File Reference
#include <apitest.h>
#include <windef.h>
#include <winbase.h>
#include <marshalling/marshalling.h>
Include dependency graph for MarshallUpStructuresArray.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define INVALID_POINTER   ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
 

Functions

 START_TEST (MarshallUpStructuresArray)
 

Macro Definition Documentation

◆ INVALID_POINTER

#define INVALID_POINTER   ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)

Definition at line 15 of file MarshallUpStructuresArray.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file MarshallUpStructuresArray.c.

Function Documentation

◆ START_TEST()

START_TEST ( MarshallUpStructuresArray  )

Definition at line 17 of file MarshallUpStructuresArray.c.

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}
#define INVALID_POINTER
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI MarshallUpStructuresArray(DWORD cbSize, PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition: marshalling.c:202
DWORD WINAPI GetLastError(void)
Definition: except.c:1042