diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 915cb5989a2..65e938949a8 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -506,24 +506,6 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset ) } -/******************************************************************* - * MapWindowPoints (USER.258) - */ -void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo, - LPPOINT16 lppt, UINT16 count ) -{ - POINT offset; - - WINPOS_GetWinOffset( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), &offset ); - while (count--) - { - lppt->x += offset.x; - lppt->y += offset.y; - lppt++; - } -} - - /******************************************************************* * MapWindowPoints (USER32.@) */ diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index 69686839696..dfcd71f3b32 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -1260,6 +1260,30 @@ HWND16 WINAPI GetOpenClipboardWindow16(void) } +/******************************************************************* + * MapWindowPoints (USER.258) + */ +void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo, LPPOINT16 lppt, UINT16 count ) +{ + POINT buffer[8], *ppt = buffer; + UINT i; + + if (count > 8) ppt = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*ppt) ); + for (i = 0; i < count; i++) + { + ppt[i].x = lppt[i].x; + ppt[i].y = lppt[i].y; + } + MapWindowPoints( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), ppt, count ); + for (i = 0; i < count; i++) + { + lppt[i].x = ppt[i].x; + lppt[i].y = ppt[i].y; + } + if (ppt != buffer) HeapFree( GetProcessHeap(), 0, ppt ); +} + + /************************************************************************** * BeginDeferWindowPos (USER.259) */