16{
18 char* pInputBuffer;
19 char* pOutputBuffer;
22
23
25
26
28 cbBuffer = 8;
29 pOutputBuffer = (
char*)
AlignRpcPtr(pInputBuffer, &cbBuffer);
30 ok(pOutputBuffer == pInputBuffer,
"pOutputBuffer != pInputBuffer\n");
31 ok(cbBuffer == 8,
"cbBuffer is %lu\n", cbBuffer);
32
33
35 cbBuffer = 7;
36 pOutputBuffer = (
char*)
AlignRpcPtr(pInputBuffer, &cbBuffer);
37 ok(pOutputBuffer == pInputBuffer,
"pOutputBuffer != pInputBuffer\n");
38 ok(cbBuffer == 4,
"cbBuffer is %lu\n", cbBuffer);
39
40
41
42
44 cbBuffer = 8;
45 pOutputBuffer = (
char*)
AlignRpcPtr(pInputBuffer, &cbBuffer);
46 ok(pOutputBuffer != pInputBuffer,
"pOutputBuffer == pInputBuffer\n");
47 ok(cbBuffer == 8,
"cbBuffer is %lu\n", cbBuffer);
49
50
52 cbBuffer = 7;
53 pOutputBuffer = (
char*)
AlignRpcPtr(pInputBuffer, &cbBuffer);
54 ok(pOutputBuffer != pInputBuffer,
"pOutputBuffer == pInputBuffer\n");
55 ok(cbBuffer == 4,
"cbBuffer is %lu\n", cbBuffer);
56
57
58 cbBuffer = 6;
60 ok(cbBuffer == 4,
"cbBuffer is %lu\n", cbBuffer);
61
62
63
64
65
66 strcpy(pOutputBuffer,
"abc");
67 strcpy(pInputBuffer,
"XXXXXXXXX");
68 cbBuffer = 5;
70 ok(
strcmp(pInputBuffer,
"abc") == 0,
"pInputBuffer is %s\n", pInputBuffer);
71 ok(pcbBuffer == &cbBuffer,
"pcbBuffer != &cbBuffer\n");
72 ok(cbBuffer == 8,
"cbBuffer is %lu\n", cbBuffer);
73
74
77
78
79
81
82
83 cbBuffer = 0xFFFFFFFD;
85 ok(pcbBuffer == &cbBuffer,
"pcbBuffer != &cbBuffer\n");
86 ok(cbBuffer == 0,
"cbBuffer is %lu\n", cbBuffer);
87
89}
int strcmp(const char *String1, const char *String2)
char * strcpy(char *DstString, const char *SrcString)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
PVOID WINAPI AlignRpcPtr(PVOID pBuffer, PDWORD pcbBuffer)
PDWORD WINAPI UndoAlignRpcPtr(PVOID pDestinationBuffer, PVOID pSourceBuffer, DWORD cbBuffer, PDWORD pcbNeeded)