Commit ff0634df authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/dsa: Implement DSA_Clone().

parent db4dd8cd
......@@ -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)
......
......@@ -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;
}
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