24{
25 const DWORD cElements = 2;
31 };
32
37 PCWSTR pwszStrings[] = {
L"PortName",
L"MonitorName",
L"Description" };
39 DWORD fPortType = 1337;
41
42
46
47
51
52
56
60
61
63 pPortInfoEnd = (
PBYTE)pPortInfo2 + cbPortInfo2Size;
64
65 (&pPortInfo2[0])->fPortType = fPortType;
68
69 (&pPortInfo2[1])->fPortType = fPortType + 1;
72
73
75 CopyMemory(pPortInfo2Copy, pPortInfo2, cbPortInfo2Size);
76
77
81
82
83 ok((&pPortInfo2[0])->fPortType == fPortType,
"fPortType is %lu!\n", (&pPortInfo2[0])->fPortType);
85 ok((&pPortInfo2[1])->fPortType == fPortType + 1,
"fPortType is %lu!\n", (&pPortInfo2[1])->fPortType);
87
88
89 ok((
ULONG_PTR)(&pPortInfo2[0])->pPortName == ((
ULONG_PTR)(&pPortInfo2Copy[0])->pPortName - (
ULONG_PTR)(&pPortInfo2[0])),
"pPortName is %p!\n", (&pPortInfo2[0])->pPortName);
90 ok((
ULONG_PTR)(&pPortInfo2[0])->pMonitorName == ((
ULONG_PTR)(&pPortInfo2Copy[0])->pMonitorName - (
ULONG_PTR)(&pPortInfo2[0])),
"pMonitorName is %p!\n", (&pPortInfo2[0])->pMonitorName);
91 ok((
ULONG_PTR)(&pPortInfo2[0])->pDescription == ((
ULONG_PTR)(&pPortInfo2Copy[0])->pDescription - (
ULONG_PTR)(&pPortInfo2[0])),
"pDescription is %p!\n", (&pPortInfo2[0])->pDescription);
92 ok((
ULONG_PTR)(&pPortInfo2[1])->pPortName == ((
ULONG_PTR)(&pPortInfo2Copy[1])->pPortName - (
ULONG_PTR)(&pPortInfo2[1])),
"pPortName is %p!\n", (&pPortInfo2[1])->pPortName);
93 ok((
ULONG_PTR)(&pPortInfo2[1])->pMonitorName == ((
ULONG_PTR)(&pPortInfo2Copy[1])->pMonitorName - (
ULONG_PTR)(&pPortInfo2[1])),
"pMonitorName is %p!\n", (&pPortInfo2[1])->pMonitorName);
94 ok((
ULONG_PTR)(&pPortInfo2[1])->pDescription == ((
ULONG_PTR)(&pPortInfo2Copy[1])->pDescription - (
ULONG_PTR)(&pPortInfo2[1])),
"pDescription is %p!\n", (&pPortInfo2[1])->pDescription);
95
96
97
99 CopyMemory(pPortInfo2Test, pPortInfo2, cbPortInfo2Size);
100
101
102
106
107
108
112
113
114 ok(
RtlEqualMemory(pPortInfo2, pPortInfo2Copy, cbPortInfo2Size),
"pPortInfo2 and pPortInfo2Copy are not equal after marshalling down and up!\n");
115
116
120}
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RtlEqualMemory(dst, src, len)
BOOL WINAPI MarshallUpStructuresArray(DWORD cbSize, PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
BOOL WINAPI MarshallDownStructuresArray(PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
#define FIELD_OFFSET(t, f)
static const MARSHALLING * pPortInfoMarshalling[]
static DWORD dwPortInfo2Offsets[]
DWORD WINAPI GetLastError(void)
_Reserved_ PVOID Reserved
#define ERROR_INVALID_DATA
struct _PORT_INFO_2W * PPORT_INFO_2W
struct _PORT_INFO_2W PORT_INFO_2W