35#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
67#define X2(f, ord) p##f = (void*)GetProcAddress(hComCtl32, (const char *)ord);
95 ok(lp == 0x1abe11ed,
"lp=%ld\n", lp);
96 return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
101 ok(lp == 0x1abe11ed,
"lp=%ld\n", lp);
102 return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;
114 ok(lp == 0x1abe11ed,
"lp=%ld\n", lp);
121 ok(lp == 0x1abe11ed,
"lp=%ld\n", lp);
122 return ((
PCHAR)p2)+1;
131 i = pDPA_GetPtrIndex(lp, pItem);
134 pDPA_SetPtr(lp,
i, (
PVOID)7);
135 return pItem != (
PVOID)3;
142 ok(lp == (
LPVOID)0xdeadbeef,
"lp=%p\n", lp);
143 hRes = IStream_Write(pStm, &pInfo->
iPos,
sizeof(
INT),
NULL);
155 iOldPos = pInfo->
iPos;
156 ok(lp == (
LPVOID)0xdeadbeef,
"lp=%p\n", lp);
157 hRes = IStream_Read(pStm, &pInfo->
iPos,
sizeof(
INT),
NULL);
159 ok(pInfo->
iPos == iOldPos,
"iPos=%d iOldPos=%d\n", pInfo->
iPos, iOldPos);
174 dwOut = dwOut << 4 | (ulItem & 0xf);
181 pDPA_DeleteAllPtrs(dpa);
200 HDPA dpa, dpa2, dpa3;
209 dpa3 = pDPA_CreateEx(0, hHeap);
215 dpa = pDPA_Create(0);
219 ok(pDPA_SetPtr(dpa, 1, (
PVOID)6),
"\n");
221 ok(pDPA_SetPtr(dpa, 0, (
PVOID)5),
"\n");
223 ok(rc,
"dw=0x%x\n",
dw);
226 ret = pDPA_InsertPtr(dpa, 1, (
PVOID)1);
229 ret = pDPA_InsertPtr(dpa, 3, (
PVOID)3);
232 ret = pDPA_InsertPtr(dpa, 5, (
PVOID)2);
239 ok(rc,
"dw=0x%x\n",
dw);
241 for(
i = 1;
i <= 6;
i++)
247 ok(
j ==
k,
"j=%d k=%d\n",
j,
k);
251 ok(pDPA_Sort(dpa,
CB_CmpGT, 0x1abe11ed),
"\n");
253 ok(rc,
"dw=0x%x\n",
dw);
256 dpa2 = pDPA_Clone(dpa,
NULL);
260 ok(rc,
"dw=0x%x\n", dw2);
261 ok(pDPA_Sort(dpa,
CB_CmpLT, 0x1abe11ed),
"\n");
265 ok(rc,
"dw=0x%x\n",
dw );
267 ok(rc,
"dw2=0x%x\n", dw2);
271 p = pDPA_Clone(dpa, dpa3);
272 ok(
p == dpa3,
"p=%p\n",
p);
274 ok(rc,
"dw3=0x%x\n", dw3);
276 for(
i = 1;
i <= 6;
i++)
282 ok(
j+1 ==
i,
"j=%d i=%d\n",
j,
i);
284 ok(
j+1 ==
i,
"j=%d i=%d\n",
j,
i);
291 ok(
j+1 ==
i,
"j=%d i=%d\n",
j,
i);
295 i = pDPA_GetPtrIndex(dpa, (
PVOID)7);
299 p = pDPA_DeletePtr(dpa, -1);
301 p = pDPA_DeletePtr(dpa, 6);
305 p = pDPA_DeletePtr(dpa, 2);
308 ok(rc,
"dw=0x%x\n",
dw);
311 i = pDPA_Search(dpa, (
PVOID)3, 0,
313 ok(
i == 2,
"i=%d\n",
i);
315 i = pDPA_Search(dpa, (
PVOID)3, 0,
317 ok(
i == 2,
"i=%d\n",
i);
319 i = pDPA_Search(dpa, (
PVOID)3, 0,
321 ok(
i == -1,
"i=%d\n",
i);
324 ret = pDPA_InsertPtr(dpa, 2, (
PVOID)3);
325 ok(
ret == 2,
"ret=%d i=%d\n",
ret, 2);
327 ok(rc,
"dw=0x%x\n",
dw);
331 for(
i = 0;
i < 6;
i++)
335 ok(
j !=
i,
"i=%d\n",
i);
339 ok(pDPA_SetPtr(dpa2, 0x12345, (
PVOID)0xdeadbeef),
"\n");
340 ret = pDPA_GetPtrIndex(dpa2, (
PVOID)0xdeadbeef);
341 ok(
ret == 0x12345,
"ret=%d\n",
ret);
343 pDPA_DeleteAllPtrs(dpa2);
345 ok(rc,
"dw2=0x%x\n", dw2);
354 HDPA dpa, dpa2, dpa3;
361 win_skip(
"DPA_Merge() not available\n");
365 dpa = pDPA_Create(0);
366 dpa2 = pDPA_Create(0);
367 dpa3 = pDPA_Create(0);
369 ret = pDPA_InsertPtr(dpa, 0, (
PVOID)1);
371 ret = pDPA_InsertPtr(dpa, 1, (
PVOID)3);
373 ret = pDPA_InsertPtr(dpa, 2, (
PVOID)5);
377 ok(rc,
"dw=0x%x\n",
dw);
379 for (
i = 0;
i < 6;
i++)
388 ok(rc,
"dw=0x%x\n",
dw);
390 ok(rc,
"dw=0x%x\n",
dw);
397 ok(rc,
"dw=0x%x\n",
dw);
403 for (
i = 0;
i < 6;
i++)
414 ok(rc,
"dw=0x%x\n",
dw);
421 pDPA_DeleteAllPtrs(dpa);
422 pDPA_InsertPtr(dpa, 0, (
PVOID)1);
423 pDPA_InsertPtr(dpa, 1, (
PVOID)3);
424 pDPA_InsertPtr(dpa, 2, (
PVOID)5);
425 pDPA_DeleteAllPtrs(dpa2);
426 pDPA_InsertPtr(dpa2, 0, (
PVOID)2);
427 pDPA_InsertPtr(dpa2, 1, (
PVOID)4);
428 pDPA_InsertPtr(dpa2, 2, (
PVOID)6);
453 pDPA_DeleteAllPtrs(dpa2);
454 pDPA_InsertPtr(dpa2, 0, (
PVOID)2);
455 pDPA_InsertPtr(dpa2, 1, (
PVOID)4);
456 pDPA_InsertPtr(dpa2, 2, (
PVOID)6);
468 ok(rc,
"dw=0x%x\n",
dw);
474 ok(rc,
"dw=0x%x\n",
dw);
488 if(!pDPA_EnumCallback)
490 win_skip(
"DPA_EnumCallback() not available\n");
494 dpa = pDPA_Create(0);
496 for (
i = 0;
i < 6;
i++)
503 ok(rc,
"dw=0x%x\n",
dw);
509 ok(rc,
"dw=0x%x\n",
dw);
520 if(!pDPA_DestroyCallback)
522 win_skip(
"DPA_DestroyCallback() not available\n");
526 dpa = pDPA_Create(0);
528 for (
i = 0;
i < 3;
i++)
541 static const WCHAR szStg[] = {
'S',
't',
'g',0 };
554 win_skip(
"DPA_LoadStream() not available. Skipping stream tests.\n");
561 ok(0,
"hResult: %d\n", hRes);
569 hRes = IStorage_CreateStream(pStg, szStg, dwMode, 0, 0, &pStm);
574 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
580 hRes = IStream_SetSize(pStm, uli);
582 hRes = IStream_Write(pStm, &
header,
sizeof(
header)-1, &written);
584 written -=
sizeof(
header)-1;
588 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
597 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_CUR, &uli);
599 ok(uli.
QuadPart == 0,
"Expected to position reset\n");
608 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
612 hRes = IStream_SetSize(pStm, uli);
615 hRes = IStream_Write(pStm, &
header,
sizeof(
header), &written);
617 written -=
sizeof(
header);
621 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
635 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
637 hRes = IStream_Write(pStm, &
header,
sizeof(
header), &written);
639 written -=
sizeof(
header);
643 hRes = IStream_Seek(pStm,
li, STREAM_SEEK_SET,
NULL);
646 hRes = pDPA_LoadStream(&dpa,
CB_Load, pStm, (
void*)0xdeadbeef);
649 ret = IStream_Release(pStm);
652 ret = IStorage_Release(pStg);
661 static const WCHAR szStg[] = {
'S',
't',
'g',0 };
673 win_skip(
"DPA_SaveStream() not available. Skipping stream tests.\n");
680 ok(0,
"hResult: %d\n", hRes);
688 hRes = IStorage_CreateStream(pStg, szStg, dwMode, 0, 0, &pStm);
691 dpa = pDPA_Create(0);
694 hRes = pDPA_SaveStream(dpa,
NULL, pStm,
NULL);
696 broken(hRes ==
S_OK) ,
"Wrong result, %d\n", hRes);
707 for (
i = 0;
i < 6;
i++)
714 hRes = IStream_Seek(pStm, liZero, STREAM_SEEK_SET,
NULL);
717 hRes = pDPA_SaveStream(dpa,
CB_Save, pStm, (
void*)0xdeadbeef);
722 hRes = IStream_Seek(pStm, liZero, STREAM_SEEK_SET,
NULL);
724 hRes = pDPA_LoadStream(&dpa,
CB_Load, pStm, (
void*)0xdeadbeef);
727 ok(rc,
"dw=0x%x\n",
dw);
730 ret = IStream_Release(pStm);
733 ret = IStorage_Release(pStg);
#define ERROR_NOT_ENOUGH_MEMORY
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
struct _STREAMDATA * PSTREAMDATA
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
BOOL WINAPI DPA_Merge(HDPA hdpa1, HDPA hdpa2, DWORD dwFlags, PFNDPACOMPARE pfnCompare, PFNDPAMERGE pfnMerge, LPARAM lParam)
HDPA WINAPI DPA_Clone(const HDPA hdpa, HDPA hdpaNew)
HDPA WINAPI DPA_CreateEx(INT nGrow, HANDLE hHeap)
BOOL WINAPI DPA_SetPtr(HDPA hdpa, INT i, LPVOID p)
BOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa)
VOID WINAPI DPA_EnumCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
HRESULT WINAPI DPA_LoadStream(HDPA *phDpa, PFNDPASTREAM loadProc, IStream *pStream, LPVOID pData)
HRESULT WINAPI DPA_SaveStream(HDPA hDpa, PFNDPASTREAM saveProc, IStream *pStream, LPVOID pData)
INT WINAPI DPA_GetPtrIndex(HDPA hdpa, LPCVOID p)
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
BOOL WINAPI DPA_Grow(HDPA hdpa, INT nGrow)
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
BOOL WINAPI DPA_Destroy(HDPA hdpa)
HDPA WINAPI DPA_Create(INT nGrow)
struct _STREAMDATA STREAMDATA
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
REFIID LPVOID DWORD_PTR dw
static void test_DPA_DestroyCallback(void)
static void test_DPA_SaveStream(void)
static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
static BOOL CheckDPA(HDPA dpa, DWORD dwIn, PDWORD pdwOut)
static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
static void test_DPA_Merge(void)
#define expect(expected, got)
static INT CALLBACK CB_EnumFirstThree(PVOID pItem, PVOID lp)
static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
static HRESULT CALLBACK CB_Load(DPASTREAMINFO *pInfo, IStream *pStm, LPVOID lp)
static void test_DPA_LoadStream(void)
static HRESULT CALLBACK CB_Save(DPASTREAMINFO *pInfo, IStream *pStm, LPVOID lp)
static void init_functions(void)
static void test_dpa(void)
static void test_DPA_EnumCallback(void)
static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
_In_ UINT _In_ DWORD dwIn
#define STGM_SHARE_EXCLUSIVE
#define STGM_DELETEONRELEASE
#define DPAS_INSERTBEFORE
void *(CALLBACK * PFNDPAMERGE)(_In_ UINT, _In_ void *, _In_ void *, _In_ LPARAM)
int(CALLBACK * PFNDPAENUMCALLBACK)(void *p, void *pData)
int(CALLBACK * PFNDPACOMPARE)(void *p1, void *p2, LPARAM lParam)
HRESULT(CALLBACK * PFNDPASTREAM)(_In_ DPASTREAMINFO *, _In_ struct IStream *, _In_opt_ void *)
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
DWORD WINAPI GetLastError(void)