Commit 3c39a991 authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the non-standard CONV_POINT and CONV_RECT functions.

parent 1c251e9a
...@@ -2133,9 +2133,13 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, ...@@ -2133,9 +2133,13 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
lParam = (LPARAM)MapSL(lParam); lParam = (LPARAM)MapSL(lParam);
if( lParam ) if( lParam )
{ {
RECT r; RECT r;
CBGetDroppedControlRect( lphc, &r ); RECT16 *r16 = (RECT16 *)lParam;
CONV_RECT32TO16( &r, (LPRECT16)lParam ); CBGetDroppedControlRect( lphc, &r );
r16->left = r.left;
r16->top = r.top;
r16->right = r.right;
r16->bottom = r.bottom;
} }
return CB_OKAY; return CB_OKAY;
case CB_GETDROPPEDCONTROLRECT: case CB_GETDROPPEDCONTROLRECT:
......
...@@ -460,7 +460,13 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, ...@@ -460,7 +460,13 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
case EM_GETRECT16: case EM_GETRECT16:
if (lParam) if (lParam)
CONV_RECT32TO16(&es->format_rect, MapSL(lParam)); {
RECT16 *r16 = MapSL(lParam);
r16->left = es->format_rect.left;
r16->top = es->format_rect.top;
r16->right = es->format_rect.right;
r16->bottom = es->format_rect.bottom;
}
break; break;
case EM_GETRECT: case EM_GETRECT:
if (lParam) if (lParam)
...@@ -470,7 +476,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, ...@@ -470,7 +476,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
case EM_SETRECT16: case EM_SETRECT16:
if ((es->style & ES_MULTILINE) && lParam) { if ((es->style & ES_MULTILINE) && lParam) {
RECT rc; RECT rc;
CONV_RECT16TO32(MapSL(lParam), &rc); RECT16 *r16 = MapSL(lParam);
rc.left = r16->left;
rc.top = r16->top;
rc.right = r16->right;
rc.bottom = r16->bottom;
EDIT_SetRectNP(es, &rc); EDIT_SetRectNP(es, &rc);
EDIT_UpdateText(es, NULL, TRUE); EDIT_UpdateText(es, NULL, TRUE);
} }
...@@ -485,7 +495,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, ...@@ -485,7 +495,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
case EM_SETRECTNP16: case EM_SETRECTNP16:
if ((es->style & ES_MULTILINE) && lParam) { if ((es->style & ES_MULTILINE) && lParam) {
RECT rc; RECT rc;
CONV_RECT16TO32(MapSL(lParam), &rc); RECT16 *r16 = MapSL(lParam);
rc.left = r16->left;
rc.top = r16->top;
rc.right = r16->right;
rc.bottom = r16->bottom;
EDIT_SetRectNP(es, &rc); EDIT_SetRectNP(es, &rc);
} }
break; break;
......
...@@ -2721,8 +2721,12 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, ...@@ -2721,8 +2721,12 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
case LB_GETITEMRECT16: case LB_GETITEMRECT16:
{ {
RECT rect; RECT rect;
RECT16 *r16 = MapSL(lParam);
ret = LISTBOX_GetItemRect( descr, (INT16)wParam, &rect ); ret = LISTBOX_GetItemRect( descr, (INT16)wParam, &rect );
CONV_RECT32TO16( &rect, MapSL(lParam) ); r16->left = rect.left;
r16->top = rect.top;
r16->right = rect.right;
r16->bottom = rect.bottom;
} }
return ret; return ret;
......
...@@ -320,15 +320,18 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message, ...@@ -320,15 +320,18 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
{ {
DRAWITEMSTRUCT16* dis16 = MapSL(lParam); DRAWITEMSTRUCT16* dis16 = MapSL(lParam);
DRAWITEMSTRUCT dis; DRAWITEMSTRUCT dis;
dis.CtlType = dis16->CtlType; dis.CtlType = dis16->CtlType;
dis.CtlID = dis16->CtlID; dis.CtlID = dis16->CtlID;
dis.itemID = dis16->itemID; dis.itemID = dis16->itemID;
dis.itemAction = dis16->itemAction; dis.itemAction = dis16->itemAction;
dis.itemState = dis16->itemState; dis.itemState = dis16->itemState;
dis.hwndItem = HWND_32(dis16->hwndItem); dis.hwndItem = HWND_32(dis16->hwndItem);
dis.hDC = HDC_32(dis16->hDC); dis.hDC = HDC_32(dis16->hDC);
dis.itemData = dis16->itemData; dis.itemData = dis16->itemData;
CONV_RECT16TO32( &dis16->rcItem, &dis.rcItem ); dis.rcItem.left = dis16->rcItem.left;
dis.rcItem.top = dis16->rcItem.top;
dis.rcItem.right = dis16->rcItem.right;
dis.rcItem.bottom = dis16->rcItem.bottom;
res = CFn_WMDrawItem(hDlg, wParam, (LPARAM)&dis); res = CFn_WMDrawItem(hDlg, wParam, (LPARAM)&dis);
} }
break; break;
......
...@@ -947,13 +947,14 @@ BOOL WINAPI PlayEnhMetaFileRecord( ...@@ -947,13 +947,14 @@ BOOL WINAPI PlayEnhMetaFileRecord(
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually /* NB POINTS array doesn't start at pPolyPoly->apts it's actually
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */ pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
POINT *pts = HeapAlloc( GetProcessHeap(), 0, POINT16 *pts16 = (POINT16 *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
pPolyPoly->cpts * sizeof(POINT) ); POINT *pts = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) );
DWORD i; DWORD i;
for(i = 0; i < pPolyPoly->cpts; i++) for(i = 0; i < pPolyPoly->cpts; i++)
CONV_POINT16TO32((POINT16*) (pPolyPoly->aPolyCounts + {
pPolyPoly->nPolys) + i, pts + i); pts[i].x = pts16[i].x;
pts[i].y = pts16[i].y;
}
PolyPolygon(hdc, pts, (INT*)pPolyPoly->aPolyCounts, pPolyPoly->nPolys); PolyPolygon(hdc, pts, (INT*)pPolyPoly->aPolyCounts, pPolyPoly->nPolys);
HeapFree( GetProcessHeap(), 0, pts ); HeapFree( GetProcessHeap(), 0, pts );
break; break;
...@@ -964,13 +965,14 @@ BOOL WINAPI PlayEnhMetaFileRecord( ...@@ -964,13 +965,14 @@ BOOL WINAPI PlayEnhMetaFileRecord(
/* NB POINTS array doesn't start at pPolyPoly->apts it's actually /* NB POINTS array doesn't start at pPolyPoly->apts it's actually
pPolyPoly->aPolyCounts + pPolyPoly->nPolys */ pPolyPoly->aPolyCounts + pPolyPoly->nPolys */
POINT *pts = HeapAlloc( GetProcessHeap(), 0, POINT16 *pts16 = (POINT16 *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys);
pPolyPoly->cpts * sizeof(POINT) ); POINT *pts = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) );
DWORD i; DWORD i;
for(i = 0; i < pPolyPoly->cpts; i++) for(i = 0; i < pPolyPoly->cpts; i++)
CONV_POINT16TO32((POINT16*) (pPolyPoly->aPolyCounts + {
pPolyPoly->nPolys) + i, pts + i); pts[i].x = pts16[i].x;
pts[i].y = pts16[i].y;
}
PolyPolyline(hdc, pts, pPolyPoly->aPolyCounts, pPolyPoly->nPolys); PolyPolyline(hdc, pts, pPolyPoly->aPolyCounts, pPolyPoly->nPolys);
HeapFree( GetProcessHeap(), 0, pts ); HeapFree( GetProcessHeap(), 0, pts );
break; break;
......
...@@ -486,7 +486,11 @@ BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count ) ...@@ -486,7 +486,11 @@ BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count )
count*sizeof(POINT) ); count*sizeof(POINT) );
if (!pt32) return FALSE; if (!pt32) return FALSE;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i])); for (i=count;i--;)
{
pt32[i].x = pt[i].x;
pt32[i].y = pt[i].y;
}
ret = Polygon(HDC_32(hdc),pt32,count); ret = Polygon(HDC_32(hdc),pt32,count);
HeapFree( GetProcessHeap(), 0, pt32 ); HeapFree( GetProcessHeap(), 0, pt32 );
return ret; return ret;
...@@ -504,7 +508,11 @@ BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count ) ...@@ -504,7 +508,11 @@ BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count )
count*sizeof(POINT) ); count*sizeof(POINT) );
if (!pt32) return FALSE; if (!pt32) return FALSE;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i])); for (i=count;i--;)
{
pt32[i].x = pt[i].x;
pt32[i].y = pt[i].y;
}
ret = Polyline(HDC_32(hdc),pt32,count); ret = Polyline(HDC_32(hdc),pt32,count);
HeapFree( GetProcessHeap(), 0, pt32 ); HeapFree( GetProcessHeap(), 0, pt32 );
return ret; return ret;
...@@ -1414,7 +1422,10 @@ INT16 WINAPI GetRgnBox16( HRGN16 hrgn, LPRECT16 rect ) ...@@ -1414,7 +1422,10 @@ INT16 WINAPI GetRgnBox16( HRGN16 hrgn, LPRECT16 rect )
{ {
RECT r; RECT r;
INT16 ret = GetRgnBox( HRGN_32(hrgn), &r ); INT16 ret = GetRgnBox( HRGN_32(hrgn), &r );
CONV_RECT32TO16( &r, rect ); rect->left = r.left;
rect->top = r.top;
rect->right = r.right;
rect->bottom = r.bottom;
return ret; return ret;
} }
...@@ -1554,7 +1565,10 @@ UINT16 WINAPI SetBoundsRect16( HDC16 hdc, const RECT16* rect, UINT16 flags ) ...@@ -1554,7 +1565,10 @@ UINT16 WINAPI SetBoundsRect16( HDC16 hdc, const RECT16* rect, UINT16 flags )
if (rect) if (rect)
{ {
RECT rect32; RECT rect32;
CONV_RECT16TO32( rect, &rect32 ); rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
return SetBoundsRect( HDC_32( hdc ), &rect32, flags ); return SetBoundsRect( HDC_32( hdc ), &rect32, flags );
} }
else return SetBoundsRect( HDC_32( hdc ), NULL, flags ); else return SetBoundsRect( HDC_32( hdc ), NULL, flags );
...@@ -1568,7 +1582,13 @@ UINT16 WINAPI GetBoundsRect16( HDC16 hdc, LPRECT16 rect, UINT16 flags) ...@@ -1568,7 +1582,13 @@ UINT16 WINAPI GetBoundsRect16( HDC16 hdc, LPRECT16 rect, UINT16 flags)
{ {
RECT rect32; RECT rect32;
UINT ret = GetBoundsRect( HDC_32( hdc ), &rect32, flags ); UINT ret = GetBoundsRect( HDC_32( hdc ), &rect32, flags );
if (rect) CONV_RECT32TO16( &rect32, rect ); if (rect)
{
rect->left = rect32.left;
rect->top = rect32.top;
rect->right = rect32.right;
rect->bottom = rect32.bottom;
}
return ret; return ret;
} }
...@@ -1842,7 +1862,13 @@ BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags, ...@@ -1842,7 +1862,13 @@ BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
if(lpdx32 == NULL) return FALSE; if(lpdx32 == NULL) return FALSE;
for (i=count;i--;) lpdx32[i]=lpDx[i]; for (i=count;i--;) lpdx32[i]=lpDx[i];
} }
if (lprect) CONV_RECT16TO32(lprect,&rect32); if (lprect)
{
rect32.left = lprect->left;
rect32.top = lprect->top;
rect32.right = lprect->right;
rect32.bottom = lprect->bottom;
}
ret = ExtTextOutA(HDC_32(hdc),x,y,flags,lprect?&rect32:NULL,str,count,lpdx32); ret = ExtTextOutA(HDC_32(hdc),x,y,flags,lprect?&rect32:NULL,str,count,lpdx32);
if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 ); if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 );
return ret; return ret;
...@@ -2202,7 +2228,10 @@ BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts, ...@@ -2202,7 +2228,10 @@ BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts,
pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts); pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
if(pt32 == NULL) return FALSE; if(pt32 == NULL) return FALSE;
for (i=nrpts;i--;) for (i=nrpts;i--;)
CONV_POINT16TO32(&(pt[i]),&(pt32[i])); {
pt32[i].x = pt[i].x;
pt32[i].y = pt[i].y;
}
counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) ); counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) );
if(counts32 == NULL) { if(counts32 == NULL) {
HeapFree( GetProcessHeap(), 0, pt32 ); HeapFree( GetProcessHeap(), 0, pt32 );
...@@ -2230,7 +2259,11 @@ HRGN16 WINAPI CreatePolyPolygonRgn16( const POINT16 *points, ...@@ -2230,7 +2259,11 @@ HRGN16 WINAPI CreatePolyPolygonRgn16( const POINT16 *points,
for (i = 0; i < nbpolygons; i++) npts += count[i]; for (i = 0; i < nbpolygons; i++) npts += count[i];
points32 = HeapAlloc( GetProcessHeap(), 0, npts * sizeof(POINT) ); points32 = HeapAlloc( GetProcessHeap(), 0, npts * sizeof(POINT) );
for (i = 0; i < npts; i++) CONV_POINT16TO32( &(points[i]), &(points32[i]) ); for (i = 0; i < npts; i++)
{
points32[i].x = points[i].x;
points32[i].y = points[i].y;
}
count32 = HeapAlloc( GetProcessHeap(), 0, nbpolygons * sizeof(INT) ); count32 = HeapAlloc( GetProcessHeap(), 0, nbpolygons * sizeof(INT) );
for (i = 0; i < nbpolygons; i++) count32[i] = count[i]; for (i = 0; i < nbpolygons; i++) count32[i] = count[i];
...@@ -2257,7 +2290,11 @@ void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner ) ...@@ -2257,7 +2290,11 @@ void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner )
BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect16 ) BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect16 )
{ {
RECT rect; RECT rect;
CONV_RECT16TO32( rect16, &rect );
rect.left = rect16->left;
rect.top = rect16->top;
rect.right = rect16->right;
rect.bottom = rect16->bottom;
return RectVisible( HDC_32(hdc), &rect ); return RectVisible( HDC_32(hdc), &rect );
} }
...@@ -2270,7 +2307,10 @@ BOOL16 WINAPI RectInRegion16( HRGN16 hrgn, const RECT16 *rect ) ...@@ -2270,7 +2307,10 @@ BOOL16 WINAPI RectInRegion16( HRGN16 hrgn, const RECT16 *rect )
{ {
RECT r32; RECT r32;
CONV_RECT16TO32(rect, &r32); r32.left = rect->left;
r32.top = rect->top;
r32.right = rect->right;
r32.bottom = rect->bottom;
return RectInRegion( HRGN_32(hrgn), &r32 ); return RectInRegion( HRGN_32(hrgn), &r32 );
} }
...@@ -2398,7 +2438,11 @@ BOOL16 WINAPI OffsetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt) ...@@ -2398,7 +2438,11 @@ BOOL16 WINAPI OffsetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt)
{ {
POINT pt32; POINT pt32;
BOOL16 ret = OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt32 ); BOOL16 ret = OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
if (pt) CONV_POINT32TO16( &pt32, pt ); if (pt)
{
pt->x = pt32.x;
pt->y = pt32.y;
}
return ret; return ret;
} }
...@@ -2410,7 +2454,11 @@ BOOL16 WINAPI OffsetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) ...@@ -2410,7 +2454,11 @@ BOOL16 WINAPI OffsetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
{ {
POINT pt32; POINT pt32;
BOOL16 ret = OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt32 ); BOOL16 ret = OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
if (pt) CONV_POINT32TO16( &pt32, pt ); if (pt)
{
pt->x = pt32.x;
pt->y = pt32.y;
}
return ret; return ret;
} }
...@@ -2451,7 +2499,11 @@ BOOL16 WINAPI SetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) ...@@ -2451,7 +2499,11 @@ BOOL16 WINAPI SetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
{ {
POINT pt32; POINT pt32;
BOOL16 ret = SetViewportOrgEx( HDC_32(hdc), x, y, &pt32 ); BOOL16 ret = SetViewportOrgEx( HDC_32(hdc), x, y, &pt32 );
if (pt) CONV_POINT32TO16( &pt32, pt ); if (pt)
{
pt->x = pt32.x;
pt->y = pt32.y;
}
return ret; return ret;
} }
...@@ -2475,7 +2527,11 @@ BOOL16 WINAPI SetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) ...@@ -2475,7 +2527,11 @@ BOOL16 WINAPI SetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
{ {
POINT pt32; POINT pt32;
BOOL16 ret = SetWindowOrgEx( HDC_32(hdc), x, y, &pt32 ); BOOL16 ret = SetWindowOrgEx( HDC_32(hdc), x, y, &pt32 );
if (pt) CONV_POINT32TO16( &pt32, pt ); if (pt)
{
pt->x = pt32.x;
pt->y = pt32.y;
}
return ret; return ret;
} }
...@@ -2488,7 +2544,11 @@ BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) ...@@ -2488,7 +2544,11 @@ BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
POINT pt32; POINT pt32;
if (!MoveToEx( HDC_32(hdc), x, y, &pt32 )) return FALSE; if (!MoveToEx( HDC_32(hdc), x, y, &pt32 )) return FALSE;
if (pt) CONV_POINT32TO16( &pt32, pt ); if (pt)
{
pt->x = pt32.x;
pt->y = pt32.y;
}
return TRUE; return TRUE;
} }
...@@ -2531,7 +2591,11 @@ BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints ) ...@@ -2531,7 +2591,11 @@ BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
cPoints*sizeof(POINT) ); cPoints*sizeof(POINT) );
if(!pt32) return FALSE; if(!pt32) return FALSE;
for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i])); for (i=cPoints;i--;)
{
pt32[i].x = lppt[i].x;
pt32[i].y = lppt[i].y;
}
ret= PolyBezier(HDC_32(hdc), pt32, cPoints); ret= PolyBezier(HDC_32(hdc), pt32, cPoints);
HeapFree( GetProcessHeap(), 0, pt32 ); HeapFree( GetProcessHeap(), 0, pt32 );
return ret; return ret;
...@@ -2548,7 +2612,11 @@ BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints ) ...@@ -2548,7 +2612,11 @@ BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
cPoints*sizeof(POINT) ); cPoints*sizeof(POINT) );
if(!pt32) return FALSE; if(!pt32) return FALSE;
for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i])); for (i=cPoints;i--;)
{
pt32[i].x = lppt[i].x;
pt32[i].y = lppt[i].y;
}
ret= PolyBezierTo(HDC_32(hdc), pt32, cPoints); ret= PolyBezierTo(HDC_32(hdc), pt32, cPoints);
HeapFree( GetProcessHeap(), 0, pt32 ); HeapFree( GetProcessHeap(), 0, pt32 );
return ret; return ret;
......
...@@ -156,7 +156,11 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) ...@@ -156,7 +156,11 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
if(!pt16) return FALSE; if(!pt16) return FALSE;
for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); for (i=count;i--;)
{
pt16[i].x = pt[i].x;
pt16[i].y = pt[i].y;
}
ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count); ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count);
HeapFree( GetProcessHeap(), 0, pt16 ); HeapFree( GetProcessHeap(), 0, pt16 );
...@@ -176,7 +180,11 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) ...@@ -176,7 +180,11 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
if(!pt16) return FALSE; if(!pt16) return FALSE;
for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); for (i=count;i--;)
{
pt16[i].x = pt[i].x;
pt16[i].y = pt[i].y;
}
ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count); ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count);
HeapFree( GetProcessHeap(), 0, pt16 ); HeapFree( GetProcessHeap(), 0, pt16 );
...@@ -215,7 +223,8 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon ...@@ -215,7 +223,8 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
/* convert all points */ /* convert all points */
for (j = totalpoint16; j--;){ for (j = totalpoint16; j--;){
CONV_POINT32TO16(&(pt[j]),&(pt16[j])); pt16[j].x = pt[j].x;
pt16[j].y = pt[j].y;
} }
len = sizeof(METARECORD) + sizeof(WORD) + polygons*sizeof(INT16) + totalpoint16*sizeof(POINT16); len = sizeof(METARECORD) + sizeof(WORD) + polygons*sizeof(INT16) + totalpoint16*sizeof(POINT16);
......
...@@ -130,7 +130,13 @@ MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, ...@@ -130,7 +130,13 @@ MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
TRACE("mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len)); TRACE("mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len));
if (lprect) CONV_RECT32TO16(lprect,&rect16); if (lprect)
{
rect16.left = lprect->left;
rect16.top = lprect->top;
rect16.right = lprect->right;
rect16.bottom = lprect->bottom;
}
if(lpDx) { if(lpDx) {
lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16)*len ); lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16)*len );
......
...@@ -156,7 +156,8 @@ static INT PEN_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ...@@ -156,7 +156,8 @@ static INT PEN_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
logpen.lopnStyle = pen->logpen.lopnStyle; logpen.lopnStyle = pen->logpen.lopnStyle;
logpen.lopnColor = pen->logpen.lopnColor; logpen.lopnColor = pen->logpen.lopnColor;
CONV_POINT32TO16( &pen->logpen.lopnWidth, &logpen.lopnWidth ); logpen.lopnWidth.x = pen->logpen.lopnWidth.x;
logpen.lopnWidth.y = pen->logpen.lopnWidth.y;
if (count > sizeof(logpen)) count = sizeof(logpen); if (count > sizeof(logpen)) count = sizeof(logpen);
memcpy( buffer, &logpen, count ); memcpy( buffer, &logpen, count );
return count; return count;
......
...@@ -283,7 +283,10 @@ static LRESULT CALLBACK call_WH_CBT( INT code, WPARAM wp, LPARAM lp ) ...@@ -283,7 +283,10 @@ static LRESULT CALLBACK call_WH_CBT( INT code, WPARAM wp, LPARAM lp )
RECT *rect32 = (RECT *)lp; RECT *rect32 = (RECT *)lp;
RECT16 rect16; RECT16 rect16;
CONV_RECT32TO16( rect32, &rect16 ); rect16.left = rect32->left;
rect16.top = rect32->top;
rect16.right = rect32->right;
rect16.bottom = rect32->bottom;
lp = MapLS( &rect16 ); lp = MapLS( &rect16 );
ret = call_hook_16( WH_CBT, code, wp, lp ); ret = call_hook_16( WH_CBT, code, wp, lp );
UnMapLS( lp ); UnMapLS( lp );
...@@ -571,7 +574,10 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA ...@@ -571,7 +574,10 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA
RECT16 *rect16 = MapSL(lparam); RECT16 *rect16 = MapSL(lparam);
RECT rect32; RECT rect32;
CONV_RECT16TO32( rect16, &rect32 ); rect32.left = rect16->left;
rect32.top = rect16->top;
rect32.right = rect16->right;
rect32.bottom = rect16->bottom;
ret = CallNextHookEx( hhook, code, wparam, (LPARAM)&rect32 ); ret = CallNextHookEx( hhook, code, wparam, (LPARAM)&rect32 );
break; break;
} }
......
...@@ -97,6 +97,23 @@ static BOOL CALLBACK draw_state_callback( HDC hdc, LPARAM lparam, WPARAM wparam, ...@@ -97,6 +97,23 @@ static BOOL CALLBACK draw_state_callback( HDC hdc, LPARAM lparam, WPARAM wparam,
return LOWORD(ret); return LOWORD(ret);
} }
/***********************************************************************
* ClipCursor (USER.16)
*/
BOOL16 WINAPI ClipCursor16( const RECT16 *rect )
{
RECT rect32;
if (!rect) return ClipCursor( NULL );
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
return ClipCursor( &rect32 );
}
/*********************************************************************** /***********************************************************************
* SetCursor (USER.69) * SetCursor (USER.69)
*/ */
...@@ -153,7 +170,11 @@ void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect ) ...@@ -153,7 +170,11 @@ void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect )
INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect16, HBRUSH16 hbrush ) INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect16, HBRUSH16 hbrush )
{ {
RECT rect; RECT rect;
CONV_RECT16TO32( rect16, &rect );
rect.left = rect16->left;
rect.top = rect16->top;
rect.right = rect16->right;
rect.bottom = rect16->bottom;
return FrameRect( HDC_32(hdc), &rect, HBRUSH_32(hbrush) ); return FrameRect( HDC_32(hdc), &rect, HBRUSH_32(hbrush) );
} }
...@@ -177,9 +198,16 @@ INT16 WINAPI DrawText16( HDC16 hdc, LPCSTR str, INT16 count, LPRECT16 rect, UINT ...@@ -177,9 +198,16 @@ INT16 WINAPI DrawText16( HDC16 hdc, LPCSTR str, INT16 count, LPRECT16 rect, UINT
if (rect) if (rect)
{ {
RECT rect32; RECT rect32;
CONV_RECT16TO32( rect, &rect32 );
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
ret = DrawTextA( HDC_32(hdc), str, count, &rect32, flags ); ret = DrawTextA( HDC_32(hdc), str, count, &rect32, flags );
CONV_RECT32TO16( &rect32, rect ); rect->left = rect32.left;
rect->top = rect32.top;
rect->right = rect32.right;
rect->bottom = rect32.bottom;
} }
else ret = DrawTextA( HDC_32(hdc), str, count, NULL, flags); else ret = DrawTextA( HDC_32(hdc), str, count, NULL, flags);
return ret; return ret;
...@@ -197,6 +225,15 @@ DWORD WINAPI IconSize16(void) ...@@ -197,6 +225,15 @@ DWORD WINAPI IconSize16(void)
} }
/***********************************************************************
* AdjustWindowRect (USER.102)
*/
BOOL16 WINAPI AdjustWindowRect16( LPRECT16 rect, DWORD style, BOOL16 menu )
{
return AdjustWindowRectEx16( rect, style, menu, 0 );
}
/********************************************************************** /**********************************************************************
* CreateMenu (USER.151) * CreateMenu (USER.151)
*/ */
...@@ -400,12 +437,30 @@ BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect, ...@@ -400,12 +437,30 @@ BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
RECT rect32, clipRect32, rcUpdate32; RECT rect32, clipRect32, rcUpdate32;
BOOL16 ret; BOOL16 ret;
if (rect) CONV_RECT16TO32( rect, &rect32 ); if (rect)
if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 ); {
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
}
if (cliprc)
{
clipRect32.left = cliprc->left;
clipRect32.top = cliprc->top;
clipRect32.right = cliprc->right;
clipRect32.bottom = cliprc->bottom;
}
ret = ScrollDC( HDC_32(hdc), dx, dy, rect ? &rect32 : NULL, ret = ScrollDC( HDC_32(hdc), dx, dy, rect ? &rect32 : NULL,
cliprc ? &clipRect32 : NULL, HRGN_32(hrgnUpdate), cliprc ? &clipRect32 : NULL, HRGN_32(hrgnUpdate),
&rcUpdate32 ); &rcUpdate32 );
if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate ); if (rcUpdate)
{
rcUpdate->left = rcUpdate32.left;
rcUpdate->top = rcUpdate32.top;
rcUpdate->right = rcUpdate32.right;
rcUpdate->bottom = rcUpdate32.bottom;
}
return ret; return ret;
} }
...@@ -505,6 +560,23 @@ UINT16 WINAPI RealizePalette16( HDC16 hdc ) ...@@ -505,6 +560,23 @@ UINT16 WINAPI RealizePalette16( HDC16 hdc )
/*********************************************************************** /***********************************************************************
* GetClipCursor (USER.309)
*/
void WINAPI GetClipCursor16( RECT16 *rect )
{
if (rect)
{
RECT rect32;
GetClipCursor( &rect32 );
rect->left = rect32.left;
rect->top = rect32.top;
rect->right = rect32.right;
rect->bottom = rect32.bottom;
}
}
/***********************************************************************
* SignalProc (USER.314) * SignalProc (USER.314)
*/ */
void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code, void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code,
...@@ -759,6 +831,28 @@ HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE bits, UINT16 cbSize, ...@@ -759,6 +831,28 @@ HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE bits, UINT16 cbSize,
width, height, cFlag)); width, height, cFlag));
} }
/***********************************************************************
* AdjustWindowRectEx (USER.454)
*/
BOOL16 WINAPI AdjustWindowRectEx16( LPRECT16 rect, DWORD style, BOOL16 menu, DWORD exStyle )
{
RECT rect32;
BOOL ret;
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
ret = AdjustWindowRectEx( &rect32, style, menu, exStyle );
rect->left = rect32.left;
rect->top = rect32.top;
rect->right = rect32.right;
rect->bottom = rect32.bottom;
return ret;
}
/*********************************************************************** /***********************************************************************
* DestroyIcon (USER.457) * DestroyIcon (USER.457)
*/ */
...@@ -924,7 +1018,11 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -924,7 +1018,11 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc ) void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc )
{ {
RECT rect32; RECT rect32;
CONV_RECT16TO32( rc, &rect32 );
rect32.left = rc->left;
rect32.top = rc->top;
rect32.right = rc->right;
rect32.bottom = rc->bottom;
DrawFocusRect( HDC_32(hdc), &rect32 ); DrawFocusRect( HDC_32(hdc), &rect32 );
} }
...@@ -937,9 +1035,15 @@ BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType, UINT16 u ...@@ -937,9 +1035,15 @@ BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType, UINT16 u
RECT rect32; RECT rect32;
BOOL ret; BOOL ret;
CONV_RECT16TO32( rc, &rect32 ); rect32.left = rc->left;
rect32.top = rc->top;
rect32.right = rc->right;
rect32.bottom = rc->bottom;
ret = DrawFrameControl( HDC_32(hdc), &rect32, uType, uState ); ret = DrawFrameControl( HDC_32(hdc), &rect32, uType, uState );
CONV_RECT32TO16( &rect32, rc ); rc->left = rect32.left;
rc->top = rect32.top;
rc->right = rect32.right;
rc->bottom = rect32.bottom;
return ret; return ret;
} }
...@@ -951,9 +1055,15 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags ) ...@@ -951,9 +1055,15 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
RECT rect32; RECT rect32;
BOOL ret; BOOL ret;
CONV_RECT16TO32( rc, &rect32 ); rect32.left = rc->left;
rect32.top = rc->top;
rect32.right = rc->right;
rect32.bottom = rc->bottom;
ret = DrawEdge( HDC_32(hdc), &rect32, edge, flags ); ret = DrawEdge( HDC_32(hdc), &rect32, edge, flags );
CONV_RECT32TO16( &rect32, rc ); rc->left = rect32.left;
rc->top = rect32.top;
rc->right = rect32.right;
rc->bottom = rect32.bottom;
return ret; return ret;
} }
......
...@@ -164,7 +164,8 @@ HWND16 WINAPI WindowFromPoint16( POINT16 pt ) ...@@ -164,7 +164,8 @@ HWND16 WINAPI WindowFromPoint16( POINT16 pt )
{ {
POINT pt32; POINT pt32;
CONV_POINT16TO32( &pt, &pt32 ); pt32.x = pt.x;
pt32.y = pt.y;
return HWND_16( WindowFromPoint( pt32 ) ); return HWND_16( WindowFromPoint( pt32 ) );
} }
...@@ -447,8 +448,20 @@ void WINAPI ScrollWindow16( HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect, ...@@ -447,8 +448,20 @@ void WINAPI ScrollWindow16( HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect,
{ {
RECT rect32, clipRect32; RECT rect32, clipRect32;
if (rect) CONV_RECT16TO32( rect, &rect32 ); if (rect)
if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 ); {
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
}
if (clipRect)
{
clipRect32.left = clipRect->left;
clipRect32.top = clipRect->top;
clipRect32.right = clipRect->right;
clipRect32.bottom = clipRect->bottom;
}
ScrollWindow( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL, ScrollWindow( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL,
clipRect ? &clipRect32 : NULL ); clipRect ? &clipRect32 : NULL );
} }
...@@ -846,7 +859,10 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase ) ...@@ -846,7 +859,10 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
if (!rect) return GetUpdateRect( WIN_Handle32(hwnd), NULL, erase ); if (!rect) return GetUpdateRect( WIN_Handle32(hwnd), NULL, erase );
ret = GetUpdateRect( WIN_Handle32(hwnd), &r, erase ); ret = GetUpdateRect( WIN_Handle32(hwnd), &r, erase );
CONV_RECT32TO16( &r, rect ); rect->left = r.left;
rect->top = r.top;
rect->right = r.right;
rect->bottom = r.bottom;
return ret; return ret;
} }
...@@ -857,7 +873,9 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase ) ...@@ -857,7 +873,9 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
HWND16 WINAPI ChildWindowFromPoint16( HWND16 hwndParent, POINT16 pt ) HWND16 WINAPI ChildWindowFromPoint16( HWND16 hwndParent, POINT16 pt )
{ {
POINT pt32; POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
pt32.x = pt.x;
pt32.y = pt.y;
return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 )); return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 ));
} }
...@@ -1085,7 +1103,10 @@ BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate, ...@@ -1085,7 +1103,10 @@ BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate,
if (rectUpdate) if (rectUpdate)
{ {
RECT r; RECT r;
CONV_RECT16TO32( rectUpdate, &r ); r.left = rectUpdate->left;
r.top = rectUpdate->top;
r.right = rectUpdate->right;
r.bottom = rectUpdate->bottom;
return RedrawWindow(WIN_Handle32(hwnd), &r, HRGN_32(hrgnUpdate), flags); return RedrawWindow(WIN_Handle32(hwnd), &r, HRGN_32(hrgnUpdate), flags);
} }
return RedrawWindow(WIN_Handle32(hwnd), NULL, HRGN_32(hrgnUpdate), flags); return RedrawWindow(WIN_Handle32(hwnd), NULL, HRGN_32(hrgnUpdate), flags);
...@@ -1112,12 +1133,30 @@ INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy, ...@@ -1112,12 +1133,30 @@ INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy,
RECT rect32, clipRect32, rcUpdate32; RECT rect32, clipRect32, rcUpdate32;
BOOL16 ret; BOOL16 ret;
if (rect) CONV_RECT16TO32( rect, &rect32 ); if (rect)
if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 ); {
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
}
if (clipRect)
{
clipRect32.left = clipRect->left;
clipRect32.top = clipRect->top;
clipRect32.right = clipRect->right;
clipRect32.bottom = clipRect->bottom;
}
ret = ScrollWindowEx( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL, ret = ScrollWindowEx( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL,
clipRect ? &clipRect32 : NULL, HRGN_32(hrgnUpdate), clipRect ? &clipRect32 : NULL, HRGN_32(hrgnUpdate),
(rcUpdate) ? &rcUpdate32 : NULL, flags ); (rcUpdate) ? &rcUpdate32 : NULL, flags );
if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate ); if (rcUpdate)
{
rcUpdate->left = rcUpdate32.left;
rcUpdate->top = rcUpdate32.top;
rcUpdate->right = rcUpdate32.right;
rcUpdate->bottom = rcUpdate32.bottom;
}
return ret; return ret;
} }
...@@ -1131,7 +1170,10 @@ void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hb ...@@ -1131,7 +1170,10 @@ void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hb
RECT16 rc16; RECT16 rc16;
GetClientRect( WIN_Handle32(hwnd), &rect ); GetClientRect( WIN_Handle32(hwnd), &rect );
DPtoLP( HDC_32(hdc), (LPPOINT)&rect, 2 ); DPtoLP( HDC_32(hdc), (LPPOINT)&rect, 2 );
CONV_RECT32TO16( &rect, &rc16 ); rc16.left = rect.left;
rc16.top = rect.top;
rc16.right = rect.right;
rc16.bottom = rect.bottom;
PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 ); PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 );
} }
...@@ -1193,9 +1235,14 @@ BOOL16 WINAPI GetWindowPlacement16( HWND16 hwnd, WINDOWPLACEMENT16 *wp16 ) ...@@ -1193,9 +1235,14 @@ BOOL16 WINAPI GetWindowPlacement16( HWND16 hwnd, WINDOWPLACEMENT16 *wp16 )
wp16->length = sizeof(*wp16); wp16->length = sizeof(*wp16);
wp16->flags = wpl.flags; wp16->flags = wpl.flags;
wp16->showCmd = wpl.showCmd; wp16->showCmd = wpl.showCmd;
CONV_POINT32TO16( &wpl.ptMinPosition, &wp16->ptMinPosition ); wp16->ptMinPosition.x = wpl.ptMinPosition.x;
CONV_POINT32TO16( &wpl.ptMaxPosition, &wp16->ptMaxPosition ); wp16->ptMinPosition.y = wpl.ptMinPosition.y;
CONV_RECT32TO16( &wpl.rcNormalPosition, &wp16->rcNormalPosition ); wp16->ptMaxPosition.x = wpl.ptMaxPosition.x;
wp16->ptMaxPosition.y = wpl.ptMaxPosition.y;
wp16->rcNormalPosition.left = wpl.rcNormalPosition.left;
wp16->rcNormalPosition.top = wpl.rcNormalPosition.top;
wp16->rcNormalPosition.right = wpl.rcNormalPosition.right;
wp16->rcNormalPosition.bottom = wpl.rcNormalPosition.bottom;
return TRUE; return TRUE;
} }
...@@ -1229,7 +1276,9 @@ BOOL16 WINAPI SetWindowPlacement16( HWND16 hwnd, const WINDOWPLACEMENT16 *wp16 ) ...@@ -1229,7 +1276,9 @@ BOOL16 WINAPI SetWindowPlacement16( HWND16 hwnd, const WINDOWPLACEMENT16 *wp16 )
HWND16 WINAPI ChildWindowFromPointEx16( HWND16 hwndParent, POINT16 pt, UINT16 uFlags) HWND16 WINAPI ChildWindowFromPointEx16( HWND16 hwndParent, POINT16 pt, UINT16 uFlags)
{ {
POINT pt32; POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
pt32.x = pt.x;
pt32.y = pt.y;
return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags )); return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags ));
} }
...@@ -1254,7 +1303,13 @@ BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y, ...@@ -1254,7 +1303,13 @@ BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y,
INT16 nReserved, HWND16 hwnd, const RECT16 *lpRect ) INT16 nReserved, HWND16 hwnd, const RECT16 *lpRect )
{ {
RECT r; RECT r;
if (lpRect) CONV_RECT16TO32( lpRect, &r ); if (lpRect)
{
r.left = lpRect->left;
r.top = lpRect->top;
r.right = lpRect->right;
r.bottom = lpRect->bottom;
}
return TrackPopupMenu( HMENU_32(hMenu), wFlags, x, y, nReserved, return TrackPopupMenu( HMENU_32(hMenu), wFlags, x, y, nReserved,
WIN_Handle32(hwnd), lpRect ? &r : NULL ); WIN_Handle32(hwnd), lpRect ? &r : NULL );
} }
...@@ -1446,7 +1501,9 @@ void WINAPI ScrollChildren16(HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM l ...@@ -1446,7 +1501,9 @@ void WINAPI ScrollChildren16(HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM l
BOOL16 WINAPI DragDetect16( HWND16 hwnd, POINT16 pt ) BOOL16 WINAPI DragDetect16( HWND16 hwnd, POINT16 pt )
{ {
POINT pt32; POINT pt32;
CONV_POINT16TO32( &pt, &pt32 );
pt32.x = pt.x;
pt32.y = pt.y;
return DragDetect( WIN_Handle32(hwnd), pt32 ); return DragDetect( WIN_Handle32(hwnd), pt32 );
} }
...@@ -1513,8 +1570,13 @@ BOOL16 WINAPI DrawCaptionTemp16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, ...@@ -1513,8 +1570,13 @@ BOOL16 WINAPI DrawCaptionTemp16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect,
{ {
RECT rect32; RECT rect32;
if (rect) CONV_RECT16TO32(rect,&rect32); if (rect)
{
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
}
return DrawCaptionTempA( WIN_Handle32(hwnd), HDC_32(hdc), return DrawCaptionTempA( WIN_Handle32(hwnd), HDC_32(hdc),
rect ? &rect32 : NULL, HFONT_32(hFont), rect ? &rect32 : NULL, HFONT_32(hFont),
HICON_32(hIcon), str, uFlags & 0x1f ); HICON_32(hIcon), str, uFlags & 0x1f );
...@@ -1528,8 +1590,13 @@ BOOL16 WINAPI DrawCaption16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, UINT16 ...@@ -1528,8 +1590,13 @@ BOOL16 WINAPI DrawCaption16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, UINT16
{ {
RECT rect32; RECT rect32;
if (rect) CONV_RECT16TO32( rect, &rect32 ); if (rect)
{
rect32.left = rect->left;
rect32.top = rect->top;
rect32.right = rect->right;
rect32.bottom = rect->bottom;
}
return DrawCaption(WIN_Handle32(hwnd), HDC_32(hdc), rect ? &rect32 : NULL, flags); return DrawCaption(WIN_Handle32(hwnd), HDC_32(hdc), rect ? &rect32 : NULL, flags);
} }
...@@ -1544,7 +1611,10 @@ BOOL16 WINAPI GetMenuItemRect16( HWND16 hwnd, HMENU16 hMenu, UINT16 uItem, ...@@ -1544,7 +1611,10 @@ BOOL16 WINAPI GetMenuItemRect16( HWND16 hwnd, HMENU16 hMenu, UINT16 uItem,
BOOL res; BOOL res;
if (!rect) return FALSE; if (!rect) return FALSE;
res = GetMenuItemRect( WIN_Handle32(hwnd), HMENU_32(hMenu), uItem, &r32 ); res = GetMenuItemRect( WIN_Handle32(hwnd), HMENU_32(hMenu), uItem, &r32 );
CONV_RECT32TO16( &r32, rect ); rect->left = r32.left;
rect->top = r32.top;
rect->right = r32.right;
rect->bottom = r32.bottom;
return res; return res;
} }
......
...@@ -617,33 +617,4 @@ BOOL16 WINAPI WidenPath16(HDC16); ...@@ -617,33 +617,4 @@ BOOL16 WINAPI WidenPath16(HDC16);
INT16 WINAPI WriteDialog16(HPJOB16,LPSTR,INT16); INT16 WINAPI WriteDialog16(HPJOB16,LPSTR,INT16);
INT16 WINAPI WriteSpool16(HPJOB16,LPSTR,INT16); INT16 WINAPI WriteSpool16(HPJOB16,LPSTR,INT16);
inline static void CONV_POINT16TO32( const POINT16 *p16, POINT *p32 )
{
p32->x = p16->x;
p32->y = p16->y;
}
inline static void CONV_POINT32TO16( const POINT *p32, POINT16 *p16 )
{
p16->x = (INT16)p32->x;
p16->y = (INT16)p32->y;
}
inline static void CONV_RECT16TO32( const RECT16 *r16, RECT *r32 )
{
r32->left = r16->left;
r32->top = r16->top;
r32->right = r16->right;
r32->bottom = r16->bottom;
}
inline static void CONV_RECT32TO16( const RECT *r32, RECT16 *r16 )
{
r16->left = (INT16)r32->left;
r16->top = (INT16)r32->top;
r16->right = (INT16)r32->right;
r16->bottom = (INT16)r32->bottom;
}
#endif /* __WINE_WINE_WINGDI16_H */ #endif /* __WINE_WINE_WINGDI16_H */
...@@ -1411,17 +1411,6 @@ HCURSOR WINAPI GetCursor(void) ...@@ -1411,17 +1411,6 @@ HCURSOR WINAPI GetCursor(void)
/*********************************************************************** /***********************************************************************
* ClipCursor (USER.16)
*/
BOOL16 WINAPI ClipCursor16( const RECT16 *rect )
{
if (!rect) SetRectEmpty( &CURSOR_ClipRect );
else CONV_RECT16TO32( rect, &CURSOR_ClipRect );
return TRUE;
}
/***********************************************************************
* ClipCursor (USER32.@) * ClipCursor (USER32.@)
*/ */
BOOL WINAPI ClipCursor( const RECT *rect ) BOOL WINAPI ClipCursor( const RECT *rect )
...@@ -1433,15 +1422,6 @@ BOOL WINAPI ClipCursor( const RECT *rect ) ...@@ -1433,15 +1422,6 @@ BOOL WINAPI ClipCursor( const RECT *rect )
/*********************************************************************** /***********************************************************************
* GetClipCursor (USER.309)
*/
void WINAPI GetClipCursor16( RECT16 *rect )
{
if (rect) CONV_RECT32TO16( &CURSOR_ClipRect, rect );
}
/***********************************************************************
* GetClipCursor (USER32.@) * GetClipCursor (USER32.@)
*/ */
BOOL WINAPI GetClipCursor( RECT *rect ) BOOL WINAPI GetClipCursor( RECT *rect )
......
...@@ -742,9 +742,17 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam, ...@@ -742,9 +742,17 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam,
case WM_NCCALCSIZE: case WM_NCCALCSIZE:
{ {
RECT rect32; RECT rect32;
CONV_RECT16TO32( MapSL(lParam), &rect32 ); RECT16 *rect16 = MapSL(lParam);
rect32.left = rect16->left;
rect32.top = rect16->top;
rect32.right = rect16->right;
rect32.bottom = rect16->bottom;
result = NC_HandleNCCalcSize( hwnd, &rect32 ); result = NC_HandleNCCalcSize( hwnd, &rect32 );
CONV_RECT32TO16( &rect32, MapSL(lParam) ); rect16->left = rect32.left;
rect16->top = rect32.top;
rect16->right = rect32.right;
rect16->bottom = rect32.bottom;
} }
break; break;
......
...@@ -337,15 +337,6 @@ BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, ...@@ -337,15 +337,6 @@ BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
/*********************************************************************** /***********************************************************************
* AdjustWindowRect (USER.102)
*/
BOOL16 WINAPI AdjustWindowRect16( LPRECT16 rect, DWORD style, BOOL16 menu )
{
return AdjustWindowRectEx16( rect, style, menu, 0 );
}
/***********************************************************************
* AdjustWindowRect (USER32.@) * AdjustWindowRect (USER32.@)
*/ */
BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu ) BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu )
...@@ -355,22 +346,6 @@ BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu ) ...@@ -355,22 +346,6 @@ BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu )
/*********************************************************************** /***********************************************************************
* AdjustWindowRectEx (USER.454)
*/
BOOL16 WINAPI AdjustWindowRectEx16( LPRECT16 rect, DWORD style,
BOOL16 menu, DWORD exStyle )
{
RECT rect32;
BOOL ret;
CONV_RECT16TO32( rect, &rect32 );
ret = AdjustWindowRectEx( &rect32, style, menu, exStyle );
CONV_RECT32TO16( &rect32, rect );
return ret;
}
/***********************************************************************
* AdjustWindowRectEx (USER32.@) * AdjustWindowRectEx (USER32.@)
*/ */
BOOL WINAPI AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle ) BOOL WINAPI AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle )
......
...@@ -2223,7 +2223,13 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam, ...@@ -2223,7 +2223,13 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
RECT tmp; RECT tmp;
ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni ); ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
if (ret && lpvParam) if (ret && lpvParam)
CONV_RECT32TO16( &tmp, (RECT16 *)lpvParam ); {
RECT16 *r16 = (RECT16 *)lpvParam;
r16->left = tmp.left;
r16->top = tmp.top;
r16->right = tmp.right;
r16->bottom = tmp.bottom;
}
break; break;
} }
......
...@@ -642,17 +642,31 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res ...@@ -642,17 +642,31 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res
SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos ); SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos );
lpPos->hwndIconTitle = 0; /* defer until needs to be shown */ lpPos->hwndIconTitle = 0; /* defer until needs to be shown */
CONV_RECT32TO16( &wnd->rectWindow, &lpPos->rectNormal ); lpPos->rectNormal.left = wnd->rectWindow.left;
*(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF; lpPos->rectNormal.top = wnd->rectWindow.top;
lpPos->rectNormal.right = wnd->rectWindow.right;
lpPos->rectNormal.bottom = wnd->rectWindow.bottom;
lpPos->ptIconPos.x = lpPos->ptIconPos.y = -1;
lpPos->ptMaxPos.x = lpPos->ptMaxPos.y = -1;
} }
if( wnd->dwStyle & WS_MINIMIZE ) if( wnd->dwStyle & WS_MINIMIZE )
CONV_POINT32TO16( &pt, &lpPos->ptIconPos ); {
lpPos->ptIconPos.x = pt.x;
lpPos->ptIconPos.y = pt.y;
}
else if( wnd->dwStyle & WS_MAXIMIZE ) else if( wnd->dwStyle & WS_MAXIMIZE )
CONV_POINT32TO16( &pt, &lpPos->ptMaxPos ); {
lpPos->ptMaxPos.x = pt.x;
lpPos->ptMaxPos.y = pt.y;
}
else if( restoreRect ) else if( restoreRect )
CONV_RECT32TO16( restoreRect, &lpPos->rectNormal ); {
lpPos->rectNormal.left = restoreRect->left;
lpPos->rectNormal.top = restoreRect->top;
lpPos->rectNormal.right = restoreRect->right;
lpPos->rectNormal.bottom = restoreRect->bottom;
}
return lpPos; return lpPos;
} }
...@@ -772,7 +786,10 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos, ...@@ -772,7 +786,10 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos ); lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) ) if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition ); {
MinMax.ptMaxPosition.x = lpPos->ptMaxPos.x;
MinMax.ptMaxPosition.y = lpPos->ptMaxPos.y;
}
else else
{ {
MinMax.ptMaxPosition.x = -xinc; MinMax.ptMaxPosition.x = -xinc;
...@@ -883,9 +900,14 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl ) ...@@ -883,9 +900,14 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
wndpl->flags = WPF_RESTORETOMAXIMIZED; wndpl->flags = WPF_RESTORETOMAXIMIZED;
else else
wndpl->flags = 0; wndpl->flags = 0;
CONV_POINT16TO32( &lpPos->ptIconPos, &wndpl->ptMinPosition ); wndpl->ptMinPosition.x = lpPos->ptIconPos.x;
CONV_POINT16TO32( &lpPos->ptMaxPos, &wndpl->ptMaxPosition ); wndpl->ptMinPosition.y = lpPos->ptIconPos.y;
CONV_RECT16TO32( &lpPos->rectNormal, &wndpl->rcNormalPosition ); wndpl->ptMaxPosition.x = lpPos->ptMaxPos.x;
wndpl->ptMaxPosition.y = lpPos->ptMaxPos.y;
wndpl->rcNormalPosition.left = lpPos->rectNormal.left;
wndpl->rcNormalPosition.top = lpPos->rectNormal.top;
wndpl->rcNormalPosition.right = lpPos->rectNormal.right;
wndpl->rcNormalPosition.bottom = lpPos->rectNormal.bottom;
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
return TRUE; return TRUE;
} }
...@@ -902,10 +924,23 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f ...@@ -902,10 +924,23 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd, LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd,
*(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow ); *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
if( flags & PLACE_MIN ) CONV_POINT32TO16( &wndpl->ptMinPosition, &lpPos->ptIconPos ); if( flags & PLACE_MIN )
if( flags & PLACE_MAX ) CONV_POINT32TO16( &wndpl->ptMaxPosition, &lpPos->ptMaxPos ); {
if( flags & PLACE_RECT) CONV_RECT32TO16( &wndpl->rcNormalPosition, &lpPos->rectNormal ); lpPos->ptIconPos.x = wndpl->ptMinPosition.x;
lpPos->ptIconPos.y = wndpl->ptMinPosition.y;
}
if( flags & PLACE_MAX )
{
lpPos->ptMaxPos.x = wndpl->ptMaxPosition.x;
lpPos->ptMaxPos.y = wndpl->ptMaxPosition.y;
}
if( flags & PLACE_RECT)
{
lpPos->rectNormal.left = wndpl->rcNormalPosition.left;
lpPos->rectNormal.top = wndpl->rcNormalPosition.top;
lpPos->rectNormal.right = wndpl->rcNormalPosition.right;
lpPos->rectNormal.bottom = wndpl->rcNormalPosition.bottom;
}
if( pWnd->dwStyle & WS_MINIMIZE ) if( pWnd->dwStyle & WS_MINIMIZE )
{ {
WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE ); WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE );
......
...@@ -1392,16 +1392,19 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms ...@@ -1392,16 +1392,19 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)HeapAlloc(GetProcessHeap(), 0, DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)HeapAlloc(GetProcessHeap(), 0,
sizeof(*dis)); sizeof(*dis));
if (!dis) return -1; if (!dis) return -1;
dis->CtlType = dis16->CtlType; dis->CtlType = dis16->CtlType;
dis->CtlID = dis16->CtlID; dis->CtlID = dis16->CtlID;
dis->itemID = dis16->itemID; dis->itemID = dis16->itemID;
dis->itemAction = dis16->itemAction; dis->itemAction = dis16->itemAction;
dis->itemState = dis16->itemState; dis->itemState = dis16->itemState;
dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem) dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem)
: WIN_Handle32( dis16->hwndItem ); : WIN_Handle32( dis16->hwndItem );
dis->hDC = HDC_32(dis16->hDC); dis->hDC = HDC_32(dis16->hDC);
dis->itemData = dis16->itemData; dis->itemData = dis16->itemData;
CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem ); dis->rcItem.left = dis16->rcItem.left;
dis->rcItem.top = dis16->rcItem.top;
dis->rcItem.right = dis16->rcItem.right;
dis->rcItem.bottom = dis16->rcItem.bottom;
*plparam = (LPARAM)dis; *plparam = (LPARAM)dis;
} }
return 1; return 1;
...@@ -1477,13 +1480,22 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms ...@@ -1477,13 +1480,22 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
sizeof(*nc) + sizeof(LPARAM) ); sizeof(*nc) + sizeof(LPARAM) );
if (!nc) return -1; if (!nc) return -1;
nc16 = MapSL(*plparam); nc16 = MapSL(*plparam);
CONV_RECT16TO32( &nc16->rgrc[0], &nc->rgrc[0] ); nc->rgrc[0].left = nc16->rgrc[0].left;
nc->rgrc[0].top = nc16->rgrc[0].top;
nc->rgrc[0].right = nc16->rgrc[0].right;
nc->rgrc[0].bottom = nc16->rgrc[0].bottom;
if (wParam16) if (wParam16)
{ {
nc->lppos = (WINDOWPOS *)HeapAlloc( GetProcessHeap(), 0, nc->lppos = (WINDOWPOS *)HeapAlloc( GetProcessHeap(), 0,
sizeof(*nc->lppos) ); sizeof(*nc->lppos) );
CONV_RECT16TO32( &nc16->rgrc[1], &nc->rgrc[1] ); nc->rgrc[1].left = nc16->rgrc[1].left;
CONV_RECT16TO32( &nc16->rgrc[2], &nc->rgrc[2] ); nc->rgrc[1].top = nc16->rgrc[1].top;
nc->rgrc[1].right = nc16->rgrc[1].right;
nc->rgrc[1].bottom = nc16->rgrc[1].bottom;
nc->rgrc[2].left = nc16->rgrc[2].left;
nc->rgrc[2].top = nc16->rgrc[2].top;
nc->rgrc[2].right = nc16->rgrc[2].right;
nc->rgrc[2].bottom = nc16->rgrc[2].bottom;
if (nc->lppos) WINDOWPOS16to32( MapSL(nc16->lppos), nc->lppos ); if (nc->lppos) WINDOWPOS16to32( MapSL(nc16->lppos), nc->lppos );
} }
*(LPARAM *)(nc + 1) = *plparam; /* Store the previous lParam */ *(LPARAM *)(nc + 1) = *plparam; /* Store the previous lParam */
...@@ -1703,11 +1715,20 @@ LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar ...@@ -1703,11 +1715,20 @@ LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
NCCALCSIZE_PARAMS *nc = (NCCALCSIZE_PARAMS *)lParam; NCCALCSIZE_PARAMS *nc = (NCCALCSIZE_PARAMS *)lParam;
lParam = *(LPARAM *)(nc + 1); lParam = *(LPARAM *)(nc + 1);
nc16 = MapSL(lParam); nc16 = MapSL(lParam);
CONV_RECT32TO16( &nc->rgrc[0], &nc16->rgrc[0] ); nc16->rgrc[0].left = nc->rgrc[0].left;
nc16->rgrc[0].top = nc->rgrc[0].top;
nc16->rgrc[0].right = nc->rgrc[0].right;
nc16->rgrc[0].bottom = nc->rgrc[0].bottom;
if (wParam) if (wParam)
{ {
CONV_RECT32TO16( &nc->rgrc[1], &nc16->rgrc[1] ); nc16->rgrc[1].left = nc->rgrc[1].left;
CONV_RECT32TO16( &nc->rgrc[2], &nc16->rgrc[2] ); nc16->rgrc[1].top = nc->rgrc[1].top;
nc16->rgrc[1].right = nc->rgrc[1].right;
nc16->rgrc[1].bottom = nc->rgrc[1].bottom;
nc16->rgrc[2].left = nc->rgrc[2].left;
nc16->rgrc[2].top = nc->rgrc[2].top;
nc16->rgrc[2].right = nc->rgrc[2].right;
nc16->rgrc[2].bottom = nc->rgrc[2].bottom;
if (nc->lppos) if (nc->lppos)
{ {
WINDOWPOS32to16( nc->lppos, MapSL(nc16->lppos)); WINDOWPOS32to16( nc->lppos, MapSL(nc16->lppos));
...@@ -2220,15 +2241,18 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, ...@@ -2220,15 +2241,18 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
DRAWITEMSTRUCT *dis32 = (DRAWITEMSTRUCT *)*plparam; DRAWITEMSTRUCT *dis32 = (DRAWITEMSTRUCT *)*plparam;
DRAWITEMSTRUCT16 *dis = HeapAlloc( GetProcessHeap(), 0, sizeof(DRAWITEMSTRUCT16) ); DRAWITEMSTRUCT16 *dis = HeapAlloc( GetProcessHeap(), 0, sizeof(DRAWITEMSTRUCT16) );
if (!dis) return -1; if (!dis) return -1;
dis->CtlType = (UINT16)dis32->CtlType; dis->CtlType = (UINT16)dis32->CtlType;
dis->CtlID = (UINT16)dis32->CtlID; dis->CtlID = (UINT16)dis32->CtlID;
dis->itemID = (UINT16)dis32->itemID; dis->itemID = (UINT16)dis32->itemID;
dis->itemAction = (UINT16)dis32->itemAction; dis->itemAction = (UINT16)dis32->itemAction;
dis->itemState = (UINT16)dis32->itemState; dis->itemState = (UINT16)dis32->itemState;
dis->hwndItem = HWND_16( dis32->hwndItem ); dis->hwndItem = HWND_16( dis32->hwndItem );
dis->hDC = HDC_16(dis32->hDC); dis->hDC = HDC_16(dis32->hDC);
dis->itemData = dis32->itemData; dis->itemData = dis32->itemData;
CONV_RECT32TO16( &dis32->rcItem, &dis->rcItem ); dis->rcItem.left = dis32->rcItem.left;
dis->rcItem.top = dis32->rcItem.top;
dis->rcItem.right = dis32->rcItem.right;
dis->rcItem.bottom = dis32->rcItem.bottom;
*plparam = MapLS( dis ); *plparam = MapLS( dis );
} }
return 1; return 1;
...@@ -2318,12 +2342,21 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, ...@@ -2318,12 +2342,21 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
NCCALCSIZE_PARAMS16 *nc = HeapAlloc( GetProcessHeap(), 0, sizeof(*nc) + sizeof(LPARAM)); NCCALCSIZE_PARAMS16 *nc = HeapAlloc( GetProcessHeap(), 0, sizeof(*nc) + sizeof(LPARAM));
if (!nc) return -1; if (!nc) return -1;
CONV_RECT32TO16( &nc32->rgrc[0], &nc->rgrc[0] ); nc->rgrc[0].left = nc32->rgrc[0].left;
nc->rgrc[0].top = nc32->rgrc[0].top;
nc->rgrc[0].right = nc32->rgrc[0].right;
nc->rgrc[0].bottom = nc32->rgrc[0].bottom;
if (wParam32) if (wParam32)
{ {
WINDOWPOS16 *wp; WINDOWPOS16 *wp;
CONV_RECT32TO16( &nc32->rgrc[1], &nc->rgrc[1] ); nc->rgrc[1].left = nc32->rgrc[1].left;
CONV_RECT32TO16( &nc32->rgrc[2], &nc->rgrc[2] ); nc->rgrc[1].top = nc32->rgrc[1].top;
nc->rgrc[1].right = nc32->rgrc[1].right;
nc->rgrc[1].bottom = nc32->rgrc[1].bottom;
nc->rgrc[2].left = nc32->rgrc[2].left;
nc->rgrc[2].top = nc32->rgrc[2].top;
nc->rgrc[2].right = nc32->rgrc[2].right;
nc->rgrc[2].bottom = nc32->rgrc[2].bottom;
if (!(wp = HeapAlloc( GetProcessHeap(), 0, sizeof(WINDOWPOS16) ))) if (!(wp = HeapAlloc( GetProcessHeap(), 0, sizeof(WINDOWPOS16) )))
{ {
HeapFree( GetProcessHeap(), 0, nc ); HeapFree( GetProcessHeap(), 0, nc );
...@@ -2541,10 +2574,15 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, ...@@ -2541,10 +2574,15 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
case CB_GETDROPPEDCONTROLRECT: case CB_GETDROPPEDCONTROLRECT:
case LB_GETITEMRECT: case LB_GETITEMRECT:
{ {
RECT *r32;
RECT16 *rect = MapSL(p16->lParam); RECT16 *rect = MapSL(p16->lParam);
UnMapLS( p16->lParam ); UnMapLS( p16->lParam );
p16->lParam = *(LPARAM *)(rect + 1); p16->lParam = *(LPARAM *)(rect + 1);
CONV_RECT16TO32( rect, (RECT *)(p16->lParam)); r32 = (RECT *)p16->lParam;
r32->left = rect->left;
r32->top = rect->top;
r32->right = rect->right;
r32->bottom = rect->bottom;
HeapFree( GetProcessHeap(), 0, rect ); HeapFree( GetProcessHeap(), 0, rect );
} }
break; break;
...@@ -2615,13 +2653,22 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, ...@@ -2615,13 +2653,22 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
UnMapLS( p16->lParam ); UnMapLS( p16->lParam );
p16->lParam = *(LPARAM *)(nc + 1); p16->lParam = *(LPARAM *)(nc + 1);
nc32 = (NCCALCSIZE_PARAMS *)(p16->lParam); nc32 = (NCCALCSIZE_PARAMS *)(p16->lParam);
CONV_RECT16TO32( &nc->rgrc[0], &nc32->rgrc[0] ); nc32->rgrc[0].left = nc->rgrc[0].left;
nc32->rgrc[0].top = nc->rgrc[0].top;
nc32->rgrc[0].right = nc->rgrc[0].right;
nc32->rgrc[0].bottom = nc->rgrc[0].bottom;
if (p16->wParam) if (p16->wParam)
{ {
WINDOWPOS16 *pos = MapSL(nc->lppos); WINDOWPOS16 *pos = MapSL(nc->lppos);
UnMapLS( nc->lppos ); UnMapLS( nc->lppos );
CONV_RECT16TO32( &nc->rgrc[1], &nc32->rgrc[1] ); nc32->rgrc[1].left = nc->rgrc[1].left;
CONV_RECT16TO32( &nc->rgrc[2], &nc32->rgrc[2] ); nc32->rgrc[1].top = nc->rgrc[1].top;
nc32->rgrc[1].right = nc->rgrc[1].right;
nc32->rgrc[1].bottom = nc->rgrc[1].bottom;
nc32->rgrc[2].left = nc->rgrc[2].left;
nc32->rgrc[2].top = nc->rgrc[2].top;
nc32->rgrc[2].right = nc->rgrc[2].right;
nc32->rgrc[2].bottom = nc->rgrc[2].bottom;
WINDOWPOS16to32( pos, nc32->lppos ); WINDOWPOS16to32( pos, nc32->lppos );
HeapFree( GetProcessHeap(), 0, pos ); HeapFree( GetProcessHeap(), 0, pos );
} }
......
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