#include <stdarg.h>
#include "wine/test.h"
#include <windef.h>
#include <winbase.h>
#include <winerror.h>
#include <lmcons.h>
#include <lmerr.h>
#include <lmapibuf.h>
#include <lmaccess.h>
Go to the source code of this file.
◆ NET_API_STATUS()
◆ run_apibuf_tests()
Definition at line 38 of file apibuf.c.
39{
43
44
46 "Reserved memory\n");
48 ok(
dwSize >= 1024,
"The size is correct\n");
49
51 "Reallocated\n");
53 ok(
dwSize >= 1500,
"The size is correct\n");
54
56
58
59
60 ok(pNetApiBufferReallocate(0, 1500, &
p) ==
NERR_Success,
"Reallocate with OldBuffer = NULL failed\n");
61 ok(
p !=
NULL,
"No memory got allocated\n");
63
64 ok(pNetApiBufferAllocate(1024, &
p) ==
NERR_Success,
"Memory not reserved\n");
66 ok(
p ==
NULL,
"Pointer not cleared\n");
67
68
70 "Reserved memory\n");
72 ok(
dwSize < 0xFFFFFFFF,
"The size of the 0-length buffer\n");
74
75
76
78 res = pNetApiBufferAllocate(0,
NULL);
80 "returned %d with 0x%x (expected ERROR_INVALID_PARAMETER with "
82
84 res = pNetApiBufferAllocate(1024,
NULL);
86 "returned %d with 0x%x (expected ERROR_INVALID_PARAMETER with "
88}
#define ERROR_INVALID_PARAMETER
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ START_TEST()
Definition at line 90 of file apibuf.c.
91{
93
94 pNetApiBufferAllocate=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferAllocate");
95 pNetApiBufferFree=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferFree");
96 pNetApiBufferReallocate=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferReallocate");
97 pNetApiBufferSize=(
void*)
GetProcAddress(hnetapi32,
"NetApiBufferSize");
98
99 if (pNetApiBufferAllocate && pNetApiBufferFree && pNetApiBufferReallocate && pNetApiBufferSize)
101 else
102 win_skip(
"Needed functions are not available\n");
103
105}
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
static void run_apibuf_tests(void)
◆ DWORD
◆ LPDWORD