comctl32/dsa: Implement DSA_Clone().

This commit is contained in:
Nikolay Sivov 2015-03-31 08:44:23 +03:00 committed by Alexandre Julliard
parent db4dd8cd38
commit ff0634dfe1
2 changed files with 37 additions and 0 deletions

View File

@ -131,6 +131,7 @@
@ stdcall DrawShadowText(long wstr long ptr long long long long long)
@ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA
@ stdcall DrawStatusTextW(long ptr wstr long)
@ stdcall DSA_Clone(ptr)
@ stdcall FlatSB_EnableScrollBar (long long long)
@ stdcall FlatSB_GetScrollInfo (long long ptr)
@ stdcall FlatSB_GetScrollPos (long long)

View File

@ -434,3 +434,39 @@ void WINAPI DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc,
DSA_EnumCallback (hdsa, enumProc, lParam);
DSA_Destroy (hdsa);
}
/**************************************************************************
* DSA_Clone [COMCTL32.@]
*
* Creates a copy of a dsa
*
* PARAMS
* hdsa [I] handle to the dynamic storage array
*
* RETURNS
* Cloned dsa
*/
HDSA WINAPI DSA_Clone(HDSA hdsa)
{
HDSA dest;
INT i;
TRACE("(%p)\n", hdsa);
if (!hdsa)
return NULL;
dest = DSA_Create (hdsa->nItemSize, hdsa->nGrow);
if (!dest)
return NULL;
for (i = 0; i < hdsa->nItemCount; i++) {
void *ptr = DSA_GetItemPtr (hdsa, i);
if (DSA_InsertItem (dest, DA_LAST, ptr) == -1) {
DSA_Destroy (dest);
return NULL;
}
}
return dest;
}