Changed some functions prototypes (were returning void).
diff --git a/graphics/painting.c b/graphics/painting.c
index 80f4313..0a5100d 100644
--- a/graphics/painting.c
+++ b/graphics/painting.c
@@ -345,10 +345,11 @@
/***********************************************************************
* InvertRect32 (USER32.330)
*/
-void WINAPI InvertRect32( HDC32 hdc, const RECT32 *rect )
+BOOL32 WINAPI InvertRect32( HDC32 hdc, const RECT32 *rect )
{
- PatBlt32( hdc, rect->left, rect->top,
- rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
+ return PatBlt32( hdc, rect->left, rect->top,
+ rect->right - rect->left, rect->bottom - rect->top,
+ DSTINVERT );
}
@@ -659,7 +660,7 @@
*
* FIXME: PatBlt(PATINVERT) with background brush.
*/
-void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
+BOOL32 WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
{
HPEN32 hOldPen, hnewPen;
INT32 oldDrawMode, oldBkMode;
@@ -667,7 +668,11 @@
X11DRV_PDEVICE *physDev;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
- if (!dc) return;
+ if (!dc)
+ {
+ SetLastError( ERROR_INVALID_HANDLE );
+ return FALSE;
+ }
physDev = (X11DRV_PDEVICE *)dc->physDev;
left = XLPTODP( dc, rc->left );
@@ -675,8 +680,11 @@
right = XLPTODP( dc, rc->right );
bottom = YLPTODP( dc, rc->bottom );
- if(left == right || top == bottom)
- return;
+ if(left == right || top == bottom)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return FALSE;
+ }
hnewPen = CreatePen32(PS_DOT, 1, GetSysColor32(COLOR_WINDOWTEXT) );
hOldPen = SelectObject32( hdc, hnewPen );
@@ -695,6 +703,7 @@
SetROP232(hdc, oldDrawMode);
SelectObject32(hdc, hOldPen);
DeleteObject32(hnewPen);
+ return TRUE;
}
diff --git a/include/winuser.h b/include/winuser.h
index f6da8b0..80072e4 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -3123,7 +3123,7 @@
#define DrawCaptionTemp WINELIB_NAME_AW(DrawCaptionTemp)
BOOL32 WINAPI DrawEdge32(HDC32,LPRECT32,UINT32,UINT32);
#define DrawEdge WINELIB_NAME(DrawEdge)
-void WINAPI DrawFocusRect32(HDC32,const RECT32*);
+BOOL32 WINAPI DrawFocusRect32(HDC32,const RECT32*);
#define DrawFocusRect WINELIB_NAME(DrawFocusRect)
BOOL32 WINAPI DrawFrameControl32(HDC32,LPRECT32,UINT32,UINT32);
#define DrawFrameControl WINELIB_NAME(DrawFrameControl)
@@ -3209,7 +3209,7 @@
#define GetClassName WINELIB_NAME_AW(GetClassName)
WORD WINAPI GetClassWord32(HWND32,INT32);
#define GetClassWord WINELIB_NAME(GetClassWord)
-void WINAPI GetClientRect32(HWND32,LPRECT32);
+BOOL32 WINAPI GetClientRect32(HWND32,LPRECT32);
#define GetClientRect WINELIB_NAME(GetClientRect)
HANDLE32 WINAPI GetClipboardData32(UINT32);
#define GetClipboardData WINELIB_NAME(GetClipboardData)
@@ -3220,7 +3220,7 @@
#define GetClipboardOwner WINELIB_NAME(GetClipboardOwner)
HWND32 WINAPI GetClipboardViewer32(void);
#define GetClipboardViewer WINELIB_NAME(GetClipboardViewer)
-void WINAPI GetClipCursor32(LPRECT32);
+BOOL32 WINAPI GetClipCursor32(LPRECT32);
#define GetClipCursor WINELIB_NAME(GetClipCursor)
#define GetCurrentTime32() GetTickCount()
#define GetCurrentTime WINELIB_NAME(GetCurrentTime)
@@ -3370,7 +3370,7 @@
#define HideCaret WINELIB_NAME(HideCaret)
BOOL32 WINAPI HiliteMenuItem32(HWND32,HMENU32,UINT32,UINT32);
#define HiliteMenuItem WINELIB_NAME(HiliteMenuItem)
-void WINAPI InflateRect32(LPRECT32,INT32,INT32);
+BOOL32 WINAPI InflateRect32(LPRECT32,INT32,INT32);
#define InflateRect WINELIB_NAME(InflateRect)
BOOL32 WINAPI InSendMessage32(void);
#define InSendMessage WINELIB_NAME(InSendMessage)
@@ -3382,11 +3382,11 @@
#define InsertMenuItem WINELIB_NAME_AW(InsertMenuItem)
BOOL32 WINAPI IntersectRect32(LPRECT32,const RECT32*,const RECT32*);
#define IntersectRect WINELIB_NAME(IntersectRect)
-void WINAPI InvalidateRect32(HWND32,const RECT32*,BOOL32);
+BOOL32 WINAPI InvalidateRect32(HWND32,const RECT32*,BOOL32);
#define InvalidateRect WINELIB_NAME(InvalidateRect)
-void WINAPI InvalidateRgn32(HWND32,HRGN32,BOOL32);
+BOOL32 WINAPI InvalidateRgn32(HWND32,HRGN32,BOOL32);
#define InvalidateRgn WINELIB_NAME(InvalidateRgn)
-void WINAPI InvertRect32(HDC32,const RECT32*);
+BOOL32 WINAPI InvertRect32(HDC32,const RECT32*);
#define InvertRect WINELIB_NAME(InvertRect)
BOOL32 WINAPI IsCharAlpha32A(CHAR);
BOOL32 WINAPI IsCharAlpha32W(WCHAR);
@@ -3465,9 +3465,9 @@
#define MapVirtualKey WINELIB_NAME_AW(MapVirtualKey)
UINT32 WINAPI MapVirtualKeyEx32A(UINT32,UINT32,HKL32);
#define MapVirtualKeyEx WINELIB_NAME_AW(MapVirtualKeyEx)
-void WINAPI MapDialogRect32(HWND32,LPRECT32);
+BOOL32 WINAPI MapDialogRect32(HWND32,LPRECT32);
#define MapDialogRect WINELIB_NAME(MapDialogRect)
-void WINAPI MapWindowPoints32(HWND32,HWND32,LPPOINT32,UINT32);
+INT32 WINAPI MapWindowPoints32(HWND32,HWND32,LPPOINT32,UINT32);
#define MapWindowPoints WINELIB_NAME(MapWindowPoints)
BOOL32 WINAPI MessageBeep32(UINT32);
#define MessageBeep WINELIB_NAME(MessageBeep)
@@ -3488,7 +3488,7 @@
BOOL32 WINAPI OemToCharBuff32A(LPCSTR,LPSTR,DWORD);
BOOL32 WINAPI OemToCharBuff32W(LPCSTR,LPWSTR,DWORD);
#define OemToCharBuff WINELIB_NAME_AW(OemToCharBuff)
-void WINAPI OffsetRect32(LPRECT32,INT32,INT32);
+BOOL32 WINAPI OffsetRect32(LPRECT32,INT32,INT32);
#define OffsetRect WINELIB_NAME(OffsetRect)
BOOL32 WINAPI OpenClipboard32(HWND32);
#define OpenClipboard WINELIB_NAME(OpenClipboard)
@@ -3532,7 +3532,7 @@
#define RemoveProp WINELIB_NAME_AW(RemoveProp)
BOOL32 WINAPI ReplyMessage32(LRESULT);
#define ReplyMessage WINELIB_NAME(ReplyMessage)
-void WINAPI ScreenToClient32(HWND32,LPPOINT32);
+BOOL32 WINAPI ScreenToClient32(HWND32,LPPOINT32);
#define ScreenToClient WINELIB_NAME(ScreenToClient)
VOID WINAPI ScrollChildren32(HWND32,UINT32,WPARAM32,LPARAM);
#define ScrollChildren WINELIB_NAME(ScrollChildren)
@@ -3580,7 +3580,7 @@
#define SetCursorPos WINELIB_NAME(SetCursorPos)
BOOL32 WINAPI SetDeskWallPaper32(LPCSTR);
#define SetDeskWallPaper WINELIB_NAME(SetDeskWallPaper)
-void WINAPI SetDlgItemInt32(HWND32,INT32,UINT32,BOOL32);
+BOOL32 WINAPI SetDlgItemInt32(HWND32,INT32,UINT32,BOOL32);
#define SetDlgItemInt WINELIB_NAME(SetDlgItemInt)
BOOL32 WINAPI SetDlgItemText32A(HWND32,INT32,LPCSTR);
BOOL32 WINAPI SetDlgItemText32W(HWND32,INT32,LPCWSTR);
@@ -3606,9 +3606,9 @@
BOOL32 WINAPI SetProp32A(HWND32,LPCSTR,HANDLE32);
BOOL32 WINAPI SetProp32W(HWND32,LPCWSTR,HANDLE32);
#define SetProp WINELIB_NAME_AW(SetProp)
-void WINAPI SetRect32(LPRECT32,INT32,INT32,INT32,INT32);
+BOOL32 WINAPI SetRect32(LPRECT32,INT32,INT32,INT32,INT32);
#define SetRect WINELIB_NAME(SetRect)
-void WINAPI SetRectEmpty32(LPRECT32);
+BOOL32 WINAPI SetRectEmpty32(LPRECT32);
#define SetRectEmpty WINELIB_NAME(SetRectEmpty)
INT32 WINAPI SetScrollInfo32(HWND32,INT32,const SCROLLINFO*,BOOL32);
#define SetScrollInfo WINELIB_NAME(SetScrollInfo)
diff --git a/objects/cursoricon.c b/objects/cursoricon.c
index 8421426..3144004 100644
--- a/objects/cursoricon.c
+++ b/objects/cursoricon.c
@@ -1330,9 +1330,14 @@
/***********************************************************************
* GetClipCursor32 (USER32.221)
*/
-void WINAPI GetClipCursor32( RECT32 *rect )
+BOOL32 WINAPI GetClipCursor32( RECT32 *rect )
{
- if (rect) CopyRect32( rect, &CURSOR_ClipRect );
+ if (rect)
+ {
+ CopyRect32( rect, &CURSOR_ClipRect );
+ return TRUE;
+ }
+ return FALSE;
}
/**********************************************************************
diff --git a/windows/dialog.c b/windows/dialog.c
index 08b972f..19f3478 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -1430,14 +1430,14 @@
*/
void WINAPI SetDlgItemInt16( HWND16 hwnd, INT16 id, UINT16 value, BOOL16 fSigned )
{
- return SetDlgItemInt32( hwnd, (UINT32)(UINT16)id, value, fSigned );
+ SetDlgItemInt32( hwnd, (UINT32)(UINT16)id, value, fSigned );
}
/*******************************************************************
* SetDlgItemInt32 (USER32.477)
*/
-void WINAPI SetDlgItemInt32( HWND32 hwnd, INT32 id, UINT32 value,
+BOOL32 WINAPI SetDlgItemInt32( HWND32 hwnd, INT32 id, UINT32 value,
BOOL32 fSigned )
{
char str[20];
@@ -1445,6 +1445,7 @@
if (fSigned) sprintf( str, "%d", (INT32)value );
else sprintf( str, "%u", value );
SendDlgItemMessage32A( hwnd, id, WM_SETTEXT, 0, (LPARAM)str );
+ return TRUE;
}
@@ -1608,16 +1609,17 @@
/***********************************************************************
* MapDialogRect32 (USER32.382)
*/
-void WINAPI MapDialogRect32( HWND32 hwnd, LPRECT32 rect )
+BOOL32 WINAPI MapDialogRect32( HWND32 hwnd, LPRECT32 rect )
{
DIALOGINFO * dlgInfo;
WND * wndPtr = WIN_FindWndPtr( hwnd );
- if (!wndPtr) return;
+ if (!wndPtr) return FALSE;
dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
rect->left = (rect->left * dlgInfo->xBaseUnit) / 4;
rect->right = (rect->right * dlgInfo->xBaseUnit) / 4;
rect->top = (rect->top * dlgInfo->yBaseUnit) / 8;
rect->bottom = (rect->bottom * dlgInfo->yBaseUnit) / 8;
+ return TRUE;
}
diff --git a/windows/painting.c b/windows/painting.c
index c099835..c8c282c 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -550,9 +550,9 @@
/***********************************************************************
* InvalidateRgn32 (USER32.329)
*/
-void WINAPI InvalidateRgn32( HWND32 hwnd, HRGN32 hrgn, BOOL32 erase )
+BOOL32 WINAPI InvalidateRgn32( HWND32 hwnd, HRGN32 hrgn, BOOL32 erase )
{
- PAINT_RedrawWindow(hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
+ return PAINT_RedrawWindow(hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
}
@@ -568,10 +568,10 @@
/***********************************************************************
* InvalidateRect32 (USER32.328)
*/
-void WINAPI InvalidateRect32( HWND32 hwnd, const RECT32 *rect, BOOL32 erase )
+BOOL32 WINAPI InvalidateRect32( HWND32 hwnd, const RECT32 *rect, BOOL32 erase )
{
- PAINT_RedrawWindow( hwnd, rect, 0,
- RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
+ return PAINT_RedrawWindow( hwnd, rect, 0,
+ RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
}
diff --git a/windows/rect.c b/windows/rect.c
index e783e85..8914c88 100644
--- a/windows/rect.c
+++ b/windows/rect.c
@@ -24,13 +24,14 @@
/***********************************************************************
* SetRect32 (USER32.499)
*/
-void WINAPI SetRect32( LPRECT32 rect, INT32 left, INT32 top,
+BOOL32 WINAPI SetRect32( LPRECT32 rect, INT32 left, INT32 top,
INT32 right, INT32 bottom )
{
rect->left = left;
rect->right = right;
rect->top = top;
rect->bottom = bottom;
+ return TRUE;
}
@@ -46,9 +47,10 @@
/***********************************************************************
* SetRectEmpty32 (USER32.500)
*/
-void WINAPI SetRectEmpty32( LPRECT32 rect )
+BOOL32 WINAPI SetRectEmpty32( LPRECT32 rect )
{
rect->left = rect->right = rect->top = rect->bottom = 0;
+ return TRUE;
}
@@ -125,12 +127,13 @@
/***********************************************************************
* OffsetRect32 (USER32.406)
*/
-void WINAPI OffsetRect32( LPRECT32 rect, INT32 x, INT32 y )
+BOOL32 WINAPI OffsetRect32( LPRECT32 rect, INT32 x, INT32 y )
{
rect->left += x;
rect->right += x;
rect->top += y;
rect->bottom += y;
+ return TRUE;
}
@@ -149,12 +152,13 @@
/***********************************************************************
* InflateRect32 (USER32.321)
*/
-void WINAPI InflateRect32( LPRECT32 rect, INT32 x, INT32 y )
+BOOL32 WINAPI InflateRect32( LPRECT32 rect, INT32 x, INT32 y )
{
rect->left -= x;
rect->top -= y;
rect->right += x;
rect->bottom += y;
+ return TRUE;
}
diff --git a/windows/win.c b/windows/win.c
index 9ab0434..01b2131 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -61,16 +61,19 @@
{
WND * ptr;
- if (!hwnd || HIWORD(hwnd)) return NULL;
+ if (!hwnd || HIWORD(hwnd)) goto error;
ptr = (WND *) USER_HEAP_LIN_ADDR( hwnd );
- if (ptr->dwMagic != WND_MAGIC) return NULL;
+ if (ptr->dwMagic != WND_MAGIC) goto error;
if (ptr->hwndSelf != hwnd)
{
ERR( win, "Can't happen: hwnd %04x self pointer is %04x\n",
- hwnd, ptr->hwndSelf );
- return NULL;
+ hwnd, ptr->hwndSelf );
+ goto error;
}
return ptr;
+ error:
+ SetLastError( ERROR_INVALID_WINDOW_HANDLE );
+ return NULL;
}
diff --git a/windows/winpos.c b/windows/winpos.c
index 1f06553..892b243 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -317,16 +317,15 @@
/***********************************************************************
* GetClientRect32 (USER32.220)
*/
-void WINAPI GetClientRect32( HWND32 hwnd, LPRECT32 rect )
+BOOL32 WINAPI GetClientRect32( HWND32 hwnd, LPRECT32 rect )
{
WND * wndPtr = WIN_FindWndPtr( hwnd );
rect->left = rect->top = rect->right = rect->bottom = 0;
- if (wndPtr)
- {
- rect->right = wndPtr->rectClient.right - wndPtr->rectClient.left;
- rect->bottom = wndPtr->rectClient.bottom - wndPtr->rectClient.top;
- }
+ if (!wndPtr) return FALSE;
+ rect->right = wndPtr->rectClient.right - wndPtr->rectClient.left;
+ rect->bottom = wndPtr->rectClient.bottom - wndPtr->rectClient.top;
+ return TRUE;
}
@@ -361,9 +360,10 @@
/*******************************************************************
* ScreenToClient32 (USER32.447)
*/
-void WINAPI ScreenToClient32( HWND32 hwnd, LPPOINT32 lppnt )
+BOOL32 WINAPI ScreenToClient32( HWND32 hwnd, LPPOINT32 lppnt )
{
MapWindowPoints32( 0, hwnd, lppnt, 1 );
+ return TRUE;
}
@@ -635,7 +635,7 @@
/*******************************************************************
* MapWindowPoints32 (USER32.386)
*/
-void WINAPI MapWindowPoints32( HWND32 hwndFrom, HWND32 hwndTo,
+INT32 WINAPI MapWindowPoints32( HWND32 hwndFrom, HWND32 hwndTo,
LPPOINT32 lppt, UINT32 count )
{
POINT32 offset;
@@ -647,6 +647,7 @@
lppt->y += offset.y;
lppt++;
}
+ return MAKELONG( LOWORD(offset.x), LOWORD(offset.y) );
}