Commit f5cb3dde authored by Alexandre Julliard's avatar Alexandre Julliard

Moved undocumented functions out of the exported commctrl.h.

parent 209ce0be
......@@ -39,6 +39,7 @@
#include "commctrl.h"
#include "vfw.h"
#include "mmsystem.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(animate);
......
......@@ -38,6 +38,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/unicode.h"
......
......@@ -155,4 +155,28 @@ typedef struct
WNDPROC origproc;
} SUBCLASS_INFO, *LPSUBCLASS_INFO;
/* private heap memory functions */
LPVOID WINAPI COMCTL32_Alloc (DWORD);
LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD);
BOOL WINAPI COMCTL32_Free (LPVOID);
DWORD WINAPI COMCTL32_GetSize (LPVOID);
/* undocumented functions */
INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
INT WINAPI DPA_GetPtrIndex (const HDPA, LPVOID);
BOOL WINAPI DPA_Grow (const HDPA, INT);
#define DPAM_NOSORT 0x0001
#define DPAM_INSERT 0x0004
#define DPAM_DELETE 0x0008
typedef PVOID (CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
#endif /* __WINE_COMCTL32_H */
......@@ -61,6 +61,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
extern HANDLE COMCTL32_hHeap; /* handle to the private heap */
struct _DSA
{
INT nItemCount;
LPVOID pData;
INT nMaxCount;
INT nItemSize;
INT nGrow;
};
struct _DPA
{
INT nItemCount;
LPVOID *ptrs;
HANDLE hHeap;
INT nGrow;
INT nMaxCount;
};
typedef struct _STREAMDATA
{
DWORD dwSize;
......@@ -224,10 +242,10 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
TRACE("%p %p %08lx %p %p %08lx)\n",
hdpa1, hdpa2, dwFlags, pfnCompare, pfnMerge, lParam);
if (IsBadWritePtr (hdpa1, sizeof(DPA)))
if (IsBadWritePtr (hdpa1, sizeof(*hdpa1)))
return FALSE;
if (IsBadWritePtr (hdpa2, sizeof(DPA)))
if (IsBadWritePtr (hdpa2, sizeof(*hdpa2)))
return FALSE;
if (IsBadCodePtr ((FARPROC)pfnCompare))
......@@ -1330,7 +1348,7 @@ DSA_Create (INT nSize, INT nGrow)
TRACE("(size=%d grow=%d)\n", nSize, nGrow);
hdsa = (HDSA)COMCTL32_Alloc (sizeof(DSA));
hdsa = (HDSA)COMCTL32_Alloc (sizeof(*hdsa));
if (hdsa)
{
hdsa->nItemCount = 0;
......@@ -1663,7 +1681,7 @@ DPA_Create (INT nGrow)
TRACE("(%d)\n", nGrow);
hdpa = (HDPA)COMCTL32_Alloc (sizeof(DPA));
hdpa = (HDPA)COMCTL32_Alloc (sizeof(*hdpa));
if (hdpa) {
hdpa->nGrow = max(8, nGrow);
hdpa->hHeap = COMCTL32_hHeap;
......@@ -1766,7 +1784,7 @@ DPA_Clone (const HDPA hdpa, const HDPA hdpaNew)
if (!hdpaNew) {
/* create a new DPA */
hdpaTemp = (HDPA)HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,
sizeof(DPA));
sizeof(*hdpaTemp));
hdpaTemp->hHeap = hdpa->hHeap;
hdpaTemp->nGrow = hdpa->nGrow;
}
......@@ -2237,9 +2255,9 @@ DPA_CreateEx (INT nGrow, HANDLE hHeap)
TRACE("(%d %p)\n", nGrow, hHeap);
if (hHeap)
hdpa = (HDPA)HeapAlloc (hHeap, HEAP_ZERO_MEMORY, sizeof(DPA));
hdpa = (HDPA)HeapAlloc (hHeap, HEAP_ZERO_MEMORY, sizeof(*hdpa));
else
hdpa = (HDPA)COMCTL32_Alloc (sizeof(DPA));
hdpa = (HDPA)COMCTL32_Alloc (sizeof(*hdpa));
if (hdpa) {
hdpa->nGrow = min(8, nGrow);
......@@ -2502,11 +2520,11 @@ COMCTL32_StrToIntW (LPWSTR lpString)
*/
VOID WINAPI
DPA_EnumCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
DPA_EnumCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
{
INT i;
TRACE("(%p %p %08lx)\n", hdpa, enumProc, lParam);
TRACE("(%p %p %p)\n", hdpa, enumProc, lParam);
if (!hdpa)
return;
......@@ -2533,18 +2551,16 @@ DPA_EnumCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
* lParam [I]
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* none
*/
BOOL WINAPI
DPA_DestroyCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
void WINAPI
DPA_DestroyCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
{
TRACE("(%p %p %08lx)\n", hdpa, enumProc, lParam);
TRACE("(%p %p %p)\n", hdpa, enumProc, lParam);
DPA_EnumCallback (hdpa, enumProc, lParam);
return DPA_Destroy (hdpa);
DPA_Destroy (hdpa);
}
......@@ -2563,11 +2579,11 @@ DPA_DestroyCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam)
*/
VOID WINAPI
DSA_EnumCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam)
DSA_EnumCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
{
INT i;
TRACE("(%p %p %08lx)\n", hdsa, enumProc, lParam);
TRACE("(%p %p %p)\n", hdsa, enumProc, lParam);
if (!hdsa)
return;
......@@ -2595,18 +2611,16 @@ DSA_EnumCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam)
* lParam [I]
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* none
*/
BOOL WINAPI
DSA_DestroyCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam)
void WINAPI
DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
{
TRACE("(%p %p %08lx)\n", hdsa, enumProc, lParam);
TRACE("(%p %p %p)\n", hdsa, enumProc, lParam);
DSA_EnumCallback (hdsa, enumProc, lParam);
return DSA_Destroy (hdsa);
DSA_Destroy (hdsa);
}
/**************************************************************************
......
......@@ -36,6 +36,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(datetime);
......
......@@ -51,6 +51,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "commctrl.h"
#include "comctl32.h"
#include "imagelist.h"
#include "wine/debug.h"
......
......@@ -44,6 +44,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
......
......@@ -1027,7 +1027,7 @@ testitem:
pickarange:
if (i->ranges)
{
if (i->index < i->ranges->hdpa->nItemCount)
if (i->index < DPA_GetPtrCount(i->ranges->hdpa))
i->range = *(RANGE*)DPA_GetPtr(i->ranges->hdpa, i->index++);
else goto end;
}
......@@ -1053,7 +1053,7 @@ static inline BOOL iterator_prev(ITERATOR* i)
if (i->nItem == -1)
{
start = TRUE;
if (i->ranges) i->index = i->ranges->hdpa->nItemCount;
if (i->ranges) i->index = DPA_GetPtrCount(i->ranges->hdpa);
goto pickarange;
}
if (i->nItem == i->nSpecial)
......@@ -1089,7 +1089,7 @@ static RANGE iterator_range(ITERATOR* i)
if (!i->ranges) return i->range;
range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, i->ranges->hdpa->nItemCount - 1)).upper;
range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
return range;
}
......@@ -1293,8 +1293,8 @@ static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(LISTVIEW_INFO *infoPtr, INT n
{
static COLUMN_INFO mainItem;
if (nSubItem == 0 && infoPtr->hdpaColumns->nItemCount == 0) return &mainItem;
assert (nSubItem >= 0 && nSubItem < infoPtr->hdpaColumns->nItemCount);
if (nSubItem == 0 && DPA_GetPtrCount(infoPtr->hdpaColumns) == 0) return &mainItem;
assert (nSubItem >= 0 && nSubItem < DPA_GetPtrCount(infoPtr->hdpaColumns));
return (COLUMN_INFO *)DPA_GetPtr(infoPtr->hdpaColumns, nSubItem);
}
......@@ -2299,7 +2299,7 @@ static SUBITEM_INFO* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, INT nSubItem)
INT i;
/* we should binary search here if need be */
for (i = 1; i < hdpaSubItems->nItemCount; i++)
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem == nSubItem)
......@@ -2333,9 +2333,9 @@ static INT LISTVIEW_CalculateItemWidth(LISTVIEW_INFO *infoPtr)
{
RECT rcHeader;
if (infoPtr->hdpaColumns->nItemCount > 0)
if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
{
LISTVIEW_GetHeaderRect(infoPtr, infoPtr->hdpaColumns->nItemCount - 1, &rcHeader);
LISTVIEW_GetHeaderRect(infoPtr, DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, &rcHeader);
nItemWidth = rcHeader.right;
}
}
......@@ -2475,12 +2475,12 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line
TRACE("*** Checking %s:%d:%s ***\n", func, line, desc);
assert (ranges);
assert (ranges->hdpa->nItemCount >= 0);
assert (DPA_GetPtrCount(ranges->hdpa) >= 0);
ranges_dump(ranges);
prev = (RANGE *)DPA_GetPtr(ranges->hdpa, 0);
if (ranges->hdpa->nItemCount > 0)
if (DPA_GetPtrCount(ranges->hdpa) > 0)
assert (prev->lower >= 0 && prev->lower < prev->upper);
for (i = 1; i < ranges->hdpa->nItemCount; i++)
for (i = 1; i < DPA_GetPtrCount(ranges->hdpa); i++)
{
curr = (RANGE *)DPA_GetPtr(ranges->hdpa, i);
assert (prev->upper <= curr->lower);
......@@ -2504,7 +2504,7 @@ static void ranges_clear(RANGES ranges)
{
INT i;
for(i = 0; i < ranges->hdpa->nItemCount; i++)
for(i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++)
COMCTL32_Free(DPA_GetPtr(ranges->hdpa, i));
DPA_DeleteAllPtrs(ranges->hdpa);
}
......@@ -2523,9 +2523,9 @@ static RANGES ranges_clone(RANGES ranges)
RANGES clone;
INT i;
if (!(clone = ranges_create(ranges->hdpa->nItemCount))) goto fail;
if (!(clone = ranges_create(DPA_GetPtrCount(ranges->hdpa)))) goto fail;
for (i = 0; i < ranges->hdpa->nItemCount; i++)
for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++)
{
RANGE *newrng = (RANGE *)COMCTL32_Alloc(sizeof(RANGE));
if (!newrng) goto fail;
......@@ -2544,7 +2544,7 @@ static RANGES ranges_diff(RANGES ranges, RANGES sub)
{
INT i;
for (i = 0; i < sub->hdpa->nItemCount; i++)
for (i = 0; i < DPA_GetPtrCount(sub->hdpa); i++)
ranges_del(ranges, *((RANGE *)DPA_GetPtr(sub->hdpa, i)));
return ranges;
......@@ -2554,7 +2554,7 @@ static void ranges_dump(RANGES ranges)
{
INT i;
for (i = 0; i < ranges->hdpa->nItemCount; i++)
for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++)
TRACE(" %s\n", debugrange(DPA_GetPtr(ranges->hdpa, i)));
}
......@@ -2571,7 +2571,7 @@ static INT ranges_itemcount(RANGES ranges)
{
INT i, count = 0;
for (i = 0; i < ranges->hdpa->nItemCount; i++)
for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++)
{
RANGE *sel = DPA_GetPtr(ranges->hdpa, i);
count += sel->upper - sel->lower;
......@@ -2588,7 +2588,7 @@ static BOOL ranges_shift(RANGES ranges, INT nItem, INT delta, INT nUpper)
index = DPA_Search(ranges->hdpa, &srchrng, 0, ranges_cmp, 0, DPAS_SORTED | DPAS_INSERTAFTER);
if (index == -1) return TRUE;
for (; index < ranges->hdpa->nItemCount; index++)
for (; index < DPA_GetPtrCount(ranges->hdpa); index++)
{
chkrng = DPA_GetPtr(ranges->hdpa, index);
if (chkrng->lower >= nItem)
......@@ -3331,7 +3331,7 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
if (infoPtr->dwStyle & LVS_OWNERDATA) return FALSE;
/* set subitem only if column is present */
if (lpLVItem->iSubItem >= infoPtr->hdpaColumns->nItemCount) return FALSE;
if (lpLVItem->iSubItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
/* First do some sanity checks */
if (lpLVItem->mask & ~(LVIF_TEXT | LVIF_IMAGE)) return FALSE;
......@@ -3350,7 +3350,7 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
lpSubItem = (SUBITEM_INFO *)COMCTL32_Alloc(sizeof(SUBITEM_INFO));
if (!lpSubItem) return FALSE;
/* we could binary search here, if need be...*/
for (i = 1; i < hdpaSubItems->nItemCount; i++)
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{
tmpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i);
if (tmpSubItem->iSubItem > lpLVItem->iSubItem) break;
......@@ -3741,12 +3741,12 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
LISTVIEW_GetOrigin(infoPtr, &Origin);
/* narrow down the columns we need to paint */
for(colRange.lower = 0; colRange.lower < infoPtr->hdpaColumns->nItemCount; colRange.lower++)
for(colRange.lower = 0; colRange.lower < DPA_GetPtrCount(infoPtr->hdpaColumns); colRange.lower++)
{
LISTVIEW_GetHeaderRect(infoPtr, colRange.lower, &rcItem);
if (rcItem.right + Origin.x >= rcClip.left) break;
}
for(colRange.upper = infoPtr->hdpaColumns->nItemCount; colRange.upper > 0; colRange.upper--)
for(colRange.upper = DPA_GetPtrCount(infoPtr->hdpaColumns); colRange.upper > 0; colRange.upper--)
{
LISTVIEW_GetHeaderRect(infoPtr, colRange.upper - 1, &rcItem);
if (rcItem.left + Origin.x < rcClip.right) break;
......@@ -4017,7 +4017,7 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr)
if (!(infoPtr->dwStyle & LVS_OWNERDATA))
{
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, i);
for (j = 0; j < hdpaSubItems->nItemCount; j++)
for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++)
{
hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, j);
if (is_textW(hdrItem->pszText)) COMCTL32_Free(hdrItem->pszText);
......@@ -4056,14 +4056,14 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx)
RECT rcOld, rcCol;
INT nCol;
if (nColumn < 0 || infoPtr->hdpaColumns->nItemCount < 1) return;
lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, min(nColumn, infoPtr->hdpaColumns->nItemCount - 1));
if (nColumn < 0 || DPA_GetPtrCount(infoPtr->hdpaColumns) < 1) return;
lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, min(nColumn, DPA_GetPtrCount(infoPtr->hdpaColumns) - 1));
rcCol = lpColumnInfo->rcHeader;
if (nColumn >= infoPtr->hdpaColumns->nItemCount)
if (nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns))
rcCol.left = rcCol.right;
/* ajust the other columns */
for (nCol = nColumn; nCol < infoPtr->hdpaColumns->nItemCount; nCol++)
for (nCol = nColumn; nCol < DPA_GetPtrCount(infoPtr->hdpaColumns); nCol++)
{
lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nCol);
lpColumnInfo->rcHeader.left += dx;
......@@ -4108,8 +4108,8 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
TRACE("nColumn=%d\n", nColumn);
if (nColumn < 0 || infoPtr->hdpaColumns->nItemCount == 0
|| nColumn >= infoPtr->hdpaColumns->nItemCount) return FALSE;
if (nColumn < 0 || DPA_GetPtrCount(infoPtr->hdpaColumns) == 0
|| nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
/* While the MSDN specifically says that column zero should not be deleted,
it does in fact work on WinNT, and at least one app depends on it. On
......@@ -4118,7 +4118,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
we just delete the last column including the header.
*/
if (nColumn == 0)
nColumn = infoPtr->hdpaColumns->nItemCount - 1;
nColumn = DPA_GetPtrCount(infoPtr->hdpaColumns) - 1;
LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol);
......@@ -4142,7 +4142,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem);
nSubItem = 0;
lpDelItem = 0;
for (i = 1; i < hdpaSubItems->nItemCount; i++)
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem == nColumn)
......@@ -4294,7 +4294,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
INT i;
hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem);
for (i = 0; i < hdpaSubItems->nItemCount; i++)
for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++)
{
hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, i);
if (is_textW(hdrItem->pszText)) COMCTL32_Free(hdrItem->pszText);
......@@ -4711,7 +4711,7 @@ static BOOL LISTVIEW_GetColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, LPLVCOLUMNW
COLUMN_INFO *lpColumnInfo;
HDITEMW hdi;
if (!lpColumn || nColumn < 0 || nColumn >= infoPtr->hdpaColumns->nItemCount) return FALSE;
if (!lpColumn || nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nColumn);
/* initialize memory */
......@@ -4788,7 +4788,7 @@ static INT LISTVIEW_GetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn)
nColumnWidth = infoPtr->nItemWidth;
break;
case LVS_REPORT:
if (nColumn < 0 || nColumn >= infoPtr->hdpaColumns->nItemCount) return 0;
if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0;
LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcHeader);
nColumnWidth = rcHeader.right - rcHeader.left;
break;
......@@ -5849,7 +5849,7 @@ static INT LISTVIEW_HitTest(LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, BOOL s
INT j;
rcBounds.right = rcBounds.left;
for (j = 0; j < infoPtr->hdpaColumns->nItemCount; j++)
for (j = 0; j < DPA_GetPtrCount(infoPtr->hdpaColumns); j++)
{
rcBounds.left = rcBounds.right;
rcBounds.right += LISTVIEW_GetColumnWidth(infoPtr, j);
......@@ -6230,7 +6230,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
TRACE("(nColumn=%d, lpColumn=%s, isW=%d)\n", nColumn, debuglvcolumn_t(lpColumn, isW), isW);
if (!lpColumn || nColumn < 0) return -1;
nColumn = min(nColumn, infoPtr->hdpaColumns->nItemCount);
nColumn = min(nColumn, DPA_GetPtrCount(infoPtr->hdpaColumns));
ZeroMemory(&hdi, sizeof(HDITEMW));
column_fill_hditem(infoPtr, &hdi, nColumn, lpColumn, isW);
......@@ -6259,7 +6259,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
{
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem);
for (i = 1; i < hdpaSubItems->nItemCount; i++)
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem >= nNewColumn)
......@@ -6305,7 +6305,7 @@ static BOOL LISTVIEW_SetColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
TRACE("(nColumn=%d, lpColumn=%s, isW=%d)\n", nColumn, debuglvcolumn_t(lpColumn, isW), isW);
if (!lpColumn || nColumn < 0 || nColumn >= infoPtr->hdpaColumns->nItemCount) return FALSE;
if (!lpColumn || nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
ZeroMemory(&hdi, sizeof(HDITEMW));
if (lpColumn->mask & LVCF_FMT)
......@@ -6398,9 +6398,9 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
return TRUE;
}
if (nColumn < 0 || nColumn >= infoPtr->hdpaColumns->nItemCount) return FALSE;
if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
if (cx == LVSCW_AUTOSIZE || (cx == LVSCW_AUTOSIZE_USEHEADER && nColumn < infoPtr->hdpaColumns->nItemCount -1))
if (cx == LVSCW_AUTOSIZE || (cx == LVSCW_AUTOSIZE_USEHEADER && nColumn < DPA_GetPtrCount(infoPtr->hdpaColumns) -1))
{
INT nLabelWidth;
LVITEMW lvItem;
......@@ -6427,7 +6427,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
else if(cx == LVSCW_AUTOSIZE_USEHEADER)
{
/* if iCol is the last column make it fill the remainder of the controls width */
if(nColumn == infoPtr->hdpaColumns->nItemCount - 1)
if(nColumn == DPA_GetPtrCount(infoPtr->hdpaColumns) - 1)
{
RECT rcHeader;
POINT Origin;
......@@ -7884,7 +7884,7 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
TRACE("(lpnmh=%p)\n", lpnmh);
if (!lpnmh || lpnmh->iItem < 0 || lpnmh->iItem >= infoPtr->hdpaColumns->nItemCount) return 0;
if (!lpnmh || lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0;
switch (lpnmh->hdr.code)
{
......
......@@ -35,6 +35,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(nativefont);
......
......@@ -36,6 +36,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(pager);
......
......@@ -40,6 +40,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(progress);
......
......@@ -150,6 +150,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(rebar);
......
......@@ -50,6 +50,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(statusbar);
......
......@@ -2607,7 +2607,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
COMCTL32_Free(oldStrings);
}
np=COMCTL32_StrChrW (p, L'|');
np=strchrW (p, '|');
if (np!=NULL) {
len = np - p;
np++;
......
......@@ -81,6 +81,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(tooltips);
......
......@@ -1815,7 +1815,7 @@ TREEVIEW_GetFont(TREEVIEW_INFO *infoPtr)
static INT CALLBACK
TREEVIEW_ResetTextWidth(LPVOID pItem, DWORD unused)
TREEVIEW_ResetTextWidth(LPVOID pItem, LPVOID unused)
{
(void)unused;
......
......@@ -39,6 +39,7 @@
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
......
......@@ -267,24 +267,19 @@ BOOL SIC_Initialize(void)
*
* frees the cache
*/
void SIC_Destroy(void)
static INT CALLBACK sic_free( LPVOID ptr, LPVOID lparam )
{
LPSIC_ENTRY lpsice;
int i;
SHFree(ptr);
return TRUE;
}
void SIC_Destroy(void)
{
TRACE("\n");
EnterCriticalSection(&SHELL32_SicCS);
if (sic_hdpa && NULL != DPA_GetPtr (sic_hdpa, 0))
{
for (i=0; i < DPA_GetPtrCount(sic_hdpa); ++i)
{
lpsice = DPA_GetPtr(sic_hdpa, i);
SHFree(lpsice);
}
DPA_Destroy(sic_hdpa);
}
if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
sic_hdpa = NULL;
......
......@@ -959,15 +959,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
*/
void (WINAPI *pDLLInitComctl)(LPVOID);
LPVOID (WINAPI *pCOMCTL32_Alloc) (INT);
BOOL (WINAPI *pCOMCTL32_Free) (LPVOID);
HANDLE (WINAPI *pCreateMRUListA) (LPVOID lpcml);
DWORD (WINAPI *pFreeMRUListA) (HANDLE hMRUList);
INT (WINAPI *pAddMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData);
INT (WINAPI *pFindMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
INT (WINAPI *pEnumMRUListA) (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
static HINSTANCE hComctl32;
HINSTANCE shell32_hInstance = 0;
......
......@@ -563,12 +563,21 @@ static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCIT
* - fills the list into the view
*/
static INT CALLBACK fill_list( LPVOID ptr, LPVOID arg )
{
LPITEMIDLIST pidl = ptr;
IShellViewImpl *This = arg;
/* in a commdlg This works as a filemask*/
if ( IncludeObject(This, pidl)==S_OK ) LV_AddItem(This, pidl);
SHFree(pidl);
return TRUE;
}
static HRESULT ShellView_FillList(IShellViewImpl * This)
{
LPENUMIDLIST pEnumIDList;
LPITEMIDLIST pidl;
DWORD dwFetched;
INT i;
HRESULT hRes;
HDPA hdpa;
......@@ -605,21 +614,12 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
/*turn the listview's redrawing off*/
SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0);
for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/
{
pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i);
/* in a commdlg This works as a filemask*/
if ( IncludeObject(This, pidl)==S_OK )
LV_AddItem(This, pidl);
SHFree(pidl);
}
DPA_DestroyCallback( hdpa, fill_list, This );
/*turn the listview's redrawing back on and force it to draw*/
SendMessageA(This->hWndList, WM_SETREDRAW, TRUE, 0);
IEnumIDList_Release(pEnumIDList); /* destroy the list*/
DPA_Destroy(hdpa);
return S_OK;
}
......
......@@ -4378,112 +4378,41 @@ DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMATQUERY)
SNDMSGA (hdp, DTM_GETMCFONT, 0, 0)
struct _DSA;
typedef struct _DSA *HDSA;
typedef INT (CALLBACK *PFNDSAENUMCALLBACK)(LPVOID, LPVOID);
/**************************************************************************
* UNDOCUMENTED functions
*/
/* private heap memory functions */
LPVOID WINAPI COMCTL32_Alloc (DWORD);
LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD);
BOOL WINAPI COMCTL32_Free (LPVOID);
DWORD WINAPI COMCTL32_GetSize (LPVOID);
LPWSTR WINAPI COMCTL32_StrChrW (LPCWSTR, WORD);
INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
BOOL WINAPI Str_SetPtrA (LPSTR *, LPCSTR);
INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
#define Str_GetPtr WINELIB_NAME_AW(Str_GetPtr)
#define Str_SetPtr WINELIB_NAME_AW(Str_SetPtr)
/* Dynamic Storage Array */
typedef struct _DSA
{
INT nItemCount;
LPVOID pData;
INT nMaxCount;
INT nItemSize;
INT nGrow;
} DSA, *HDSA;
HDSA WINAPI DSA_Create (INT, INT);
BOOL WINAPI DSA_DeleteAllItems (const HDSA);
INT WINAPI DSA_DeleteItem (const HDSA, INT);
BOOL WINAPI DSA_Destroy (const HDSA);
BOOL WINAPI DSA_GetItem (const HDSA, INT, LPVOID);
LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT);
INT WINAPI DSA_InsertItem (const HDSA, INT, LPVOID);
BOOL WINAPI DSA_SetItem (const HDSA, INT, LPVOID);
typedef INT (CALLBACK *DSAENUMPROC)(LPVOID, DWORD);
VOID WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM);
BOOL WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM);
/* Dynamic Pointer Array */
typedef struct _DPA
{
INT nItemCount;
LPVOID *ptrs;
HANDLE hHeap;
INT nGrow;
INT nMaxCount;
} DPA, *HDPA;
HDPA WINAPI DPA_Create (INT);
HDPA WINAPI DPA_CreateEx (INT, HANDLE);
BOOL WINAPI DPA_Destroy (const HDPA);
HDPA WINAPI DPA_Clone (const HDPA, const HDPA);
LPVOID WINAPI DPA_GetPtr (const HDPA, INT);
INT WINAPI DPA_GetPtrIndex (const HDPA, LPVOID);
BOOL WINAPI DPA_Grow (const HDPA, INT);
BOOL WINAPI DPA_SetPtr (const HDPA, INT, LPVOID);
INT WINAPI DPA_InsertPtr (const HDPA, INT, LPVOID);
LPVOID WINAPI DPA_DeletePtr (const HDPA, INT);
BOOL WINAPI DPA_DeleteAllPtrs (const HDPA);
typedef INT (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM);
BOOL WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM);
HDSA WINAPI DSA_Create(INT, INT);
BOOL WINAPI DSA_Destroy(HDSA);
void WINAPI DSA_DestroyCallback(HDSA, PFNDSAENUMCALLBACK, LPVOID);
LPVOID WINAPI DSA_GetItemPtr(HDSA, INT);
INT WINAPI DSA_InsertItem(HDSA, INT, LPVOID);
#define DPAS_SORTED 0x0001
#define DPAS_INSERTBEFORE 0x0002
#define DPAS_INSERTAFTER 0x0004
INT WINAPI DPA_Search (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
#define DPAM_NOSORT 0x0001
#define DPAM_INSERT 0x0004
#define DPAM_DELETE 0x0008
typedef PVOID (CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
struct _DPA;
typedef struct _DPA *HDPA;
typedef INT (CALLBACK *DPAENUMPROC)(LPVOID, DWORD);
VOID WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM);
BOOL WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM);
#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
#define DPA_GetPtrPtr(hdpa) (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT))))
#define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i])
/* notification helper functions */
typedef INT (CALLBACK *PFNDPAENUMCALLBACK)(LPVOID, LPVOID);
typedef INT (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM);
LRESULT WINAPI COMCTL32_SendNotify (HWND, HWND, UINT, LPNMHDR);
HDPA WINAPI DPA_Create(INT);
BOOL WINAPI DPA_Destroy(HDPA);
LPVOID WINAPI DPA_DeletePtr(HDPA, INT);
BOOL WINAPI DPA_DeleteAllPtrs(HDPA);
BOOL WINAPI DPA_SetPtr(HDPA, INT, LPVOID);
LPVOID WINAPI DPA_GetPtr(HDPA, INT);
INT WINAPI DPA_InsertPtr(HDPA, INT, LPVOID);
BOOL WINAPI DPA_Sort(HDPA, PFNDPACOMPARE, LPARAM);
void WINAPI DPA_EnumCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID);
void WINAPI DPA_DestroyCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID);
INT WINAPI DPA_Search(HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
/* type and functionality of last parameter is still unknown */
LRESULT WINAPI COMCTL32_SendNotifyEx (HWND, HWND, UINT, LPNMHDR, DWORD);
BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment