94 TRACE (
"phDpa=%p loadProc=%p pStream=%p pData=%p\n",
95 phDpa, loadProc, pStream,
pData);
97 if (!phDpa || !loadProc || !pStream)
104 errCode = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos);
109 errCode = IStream_Read (pStream, &streamData,
sizeof(
STREAMDATA), &ulRead);
113 TRACE (
"dwSize=%u dwData2=%u dwItems=%u\n",
120 IStream_Seek (pStream, position, STREAM_SEEK_SET,
NULL);
140 errCode = (loadProc)(&streamInfo, pStream,
pData);
141 if (errCode !=
S_OK) {
155 TRACE (
"new hDpa=%p, errorcode=%x\n", hDpa, errCode);
189 TRACE (
"hDpa=%p saveProc=%p pStream=%p pData=%p\n",
190 hDpa, saveProc, pStream,
pData);
192 if (!hDpa || !saveProc || !pStream)
return E_INVALIDARG;
196 hr = IStream_Seek (pStream, position, STREAM_SEEK_CUR, &initial_pos);
201 streamData.
dwSize =
sizeof(streamData);
205 hr = IStream_Write (pStream, &streamData,
sizeof(streamData),
NULL);
208 IStream_Seek (pStream, position, STREAM_SEEK_SET,
NULL);
218 hr = (saveProc)(&streamInfo, pStream,
pData);
228 IStream_Seek (pStream, position, STREAM_SEEK_CUR, &curr_pos);
235 IStream_Seek (pStream, position, STREAM_SEEK_SET,
NULL);
236 IStream_Write (pStream, &streamData,
sizeof(streamData),
NULL);
239 IStream_Seek (pStream, position, STREAM_SEEK_SET,
NULL);
274 TRACE(
"(%p %p %08x %p %p %08lx)\n",
290 TRACE(
"sorting dpa's.\n");
293 TRACE (
"dpa 1 sorted.\n");
296 TRACE (
"dpa 2 sorted.\n");
302 TRACE(
"hdpa1->nItemCount=%d hdpa2->nItemCount=%d\n",
311 pWork1 = &hdpa1->
ptrs[nIndex];
312 pWork2 = &hdpa2->
ptrs[nCount];
317 TRACE(
"%d items to be inserted at start of DPA 1\n",
319 for (
i=nCount;
i>=0;
i--) {
331 nResult = (pfnCompare)(*pWork1, *pWork2,
lParam);
332 TRACE(
"compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n",
333 nResult, nIndex, nCount);
347 else if (nResult > 0)
398 TRACE(
"(%p)\n", hdpa);
426 TRACE(
"(%p %d)\n", hdpa, nGrow);
431 nGrow =
max( 8, nGrow );
478 TRACE(
"(%p %p)\n", hdpa, hdpaNew);
490 if (hdpaTemp->
ptrs) {
499 nNewItems = hdpaTemp->
nGrow *
529 TRACE(
"(%p %d)\n", hdpa, nIndex);
534 WARN(
"no pointer array.\n");
537 if ((nIndex < 0) || (nIndex >= hdpa->
nItemCount)) {
538 WARN(
"not enough pointers in array (%d vs %d).\n",nIndex,hdpa->
nItemCount);
544 return hdpa->
ptrs[nIndex];
565 if (!hdpa || !hdpa->
ptrs)
593 TRACE(
"(%p %d %p)\n", hdpa,
i,
p);
595 if (!hdpa ||
i < 0)
return -1;
630 TRACE(
"(%p %d %p)\n", hdpa,
i,
p);
682 TRACE(
"(%p %d)\n", hdpa,
i);
684 if ((!hdpa) || i < 0 || i >= hdpa->
nItemCount)
687 lpTemp = hdpa->
ptrs[
i];
690 if (i < hdpa->nItemCount - 1) {
691 lpDest = hdpa->
ptrs +
i;
694 TRACE(
"-- move dest=%p src=%p size=%x\n",
695 lpDest, lpSrc,
nSize);
732 TRACE(
"(%p)\n", hdpa);
784 while( (
l<=
m) && (
m<
r) )
786 if(pfnCompare(lpPtrs[
l],lpPtrs[
m+1],
lParam)>0)
789 memmove(&lpPtrs[
l+1],&lpPtrs[
l],(
m-
l+1)*
sizeof(lpPtrs[
l]));
815 if (!hdpa || !pfnCompare)
818 TRACE(
"(%p %p 0x%lx)\n", hdpa, pfnCompare,
lParam);
848 if (!hdpa || !pfnCompare || !pFind)
851 TRACE(
"(%p %p %d %p 0x%08lx 0x%08x)\n",
852 hdpa, pFind, nStart, pfnCompare,
lParam, uOptions);
865 n = (pfnCompare)(pFind, lpPtr[
x],
lParam);
880 nIndex = (nStart == -1)? 0 : nStart;
883 if ((pfnCompare)(pFind, lpPtr[nIndex],
lParam) == 0)
913 TRACE(
"(%d %p)\n", nGrow, hHeap);
918 hdpa =
Alloc (
sizeof(*hdpa));
928 TRACE(
"-- %p\n", hdpa);
1025 TRACE(
"(%p)\n", hdpa);
1027 if (!hdpa)
return 0;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
static VOID DPA_QuickSort(LPVOID *lpPtrs, INT l, INT r, PFNDPACOMPARE pfnCompare, LPARAM lParam)
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
struct _STREAMDATA * PSTREAMDATA
ULONGLONG WINAPI DPA_GetSize(HDPA hdpa)
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)
#define HeapFree(x, y, z)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
BOOL NTAPI IsBadCodePtr(FARPROC lpfn)
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLdouble r
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
#define memmove(s1, s2, n)
#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 *)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
*nSize LPSTR _Inout_ LPDWORD nSize
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags