Some more fixes for compiling the user dll with -DSTRICT.
diff --git a/windows/defwnd.c b/windows/defwnd.c
index 03bc157..aecd5cd 100644
--- a/windows/defwnd.c
+++ b/windows/defwnd.c
@@ -488,7 +488,7 @@
{
RECT rect;
HDC hdc = (HDC)wParam;
- HBRUSH hbr = GetClassLongW( hwnd, GCL_HBRBACKGROUND );
+ HBRUSH hbr = (HBRUSH)GetClassLongW( hwnd, GCL_HBRBACKGROUND );
if (!hbr) return 0;
if (GetClassLongW( hwnd, GCL_STYLE ) & CS_PARENTDC)
@@ -622,7 +622,7 @@
UINT len;
HICON hIcon = (HICON)GetClassLongW( hwnd, GCL_HICON );
- HINSTANCE instance = GetWindowLongW( hwnd, GWL_HINSTANCE );
+ HINSTANCE instance = (HINSTANCE)GetWindowLongW( hwnd, GWL_HINSTANCE );
if (hIcon) return (LRESULT)hIcon;
for(len=1; len<64; len++)
if((hIcon = LoadIconW(instance, MAKEINTRESOURCEW(len))))
diff --git a/windows/message.c b/windows/message.c
index 6ed668f..581eed2 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -778,7 +778,7 @@
DWORD WINAPI WaitForInputIdle( HANDLE hProcess, DWORD dwTimeOut )
{
DWORD start_time, elapsed, ret;
- HANDLE idle_event = -1;
+ HANDLE idle_event = (HANDLE)-1;
SERVER_START_REQ( wait_input_idle )
{
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 1f3e765..707ebf1 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -23,6 +23,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
+#include "wownt32.h"
#include "win.h"
#include "user.h"
#include "dce.h"
@@ -30,9 +31,9 @@
#include "cursoricon.h"
#include "winpos.h"
#include "nonclient.h"
-#include "wine/debug.h"
#include "shellapi.h"
#include "bitmap.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(nonclient);
WINE_DECLARE_DEBUG_CHANNEL(shell);
@@ -873,7 +874,7 @@
/***********************************************************************
* NC_DrawMaxButton
*/
-static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down )
+static void NC_DrawMaxButton( HWND hwnd, HDC hdc, BOOL down )
{
RECT rect;
UINT flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX;
@@ -891,7 +892,7 @@
/***********************************************************************
* NC_DrawMinButton
*/
-static void NC_DrawMinButton( HWND hwnd, HDC16 hdc, BOOL down )
+static void NC_DrawMinButton( HWND hwnd, HDC hdc, BOOL down )
{
RECT rect;
UINT flags = DFCS_CAPTIONMIN;
@@ -998,7 +999,7 @@
* Draws the maximize button for Win95 style windows.
* If bGrayed is true, then draw a disabled Maximize button
*/
-static void NC_DrawMaxButton95(HWND hwnd,HDC16 hdc,BOOL down, BOOL bGrayed)
+static void NC_DrawMaxButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
{
RECT rect;
UINT flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX;
@@ -1021,7 +1022,7 @@
* Draws the minimize button for Win95 style windows.
* If bGrayed is true, then draw a disabled Minimize button
*/
-static void NC_DrawMinButton95(HWND hwnd,HDC16 hdc,BOOL down, BOOL bGrayed)
+static void NC_DrawMinButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
{
RECT rect;
UINT flags = DFCS_CAPTIONMIN;
@@ -1409,10 +1410,10 @@
TRACE("%04x %d\n", hwnd, active );
- if (!(hdc = GetDCEx( hwnd, (clip > 1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
- ((clip > 1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN): 0) ))) return;
+ if (!(hdc = GetDCEx( hwnd, (clip > (HRGN)1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
+ ((clip > (HRGN)1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN): 0) ))) return;
- if (ExcludeVisRect16( hdc, rectClient.left-rectWindow.left,
+ if (ExcludeVisRect16( HDC_16(hdc), rectClient.left-rectWindow.left,
rectClient.top-rectWindow.top,
rectClient.right-rectWindow.left,
rectClient.bottom-rectWindow.top )
@@ -1541,11 +1542,11 @@
Now, how is the "system" supposed to tell what happened?
*/
- if (!(hdc = GetDCEx( hwnd, (clip > 1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
- ((clip > 1) ?(DCX_INTERSECTRGN | DCX_KEEPCLIPRGN) : 0) ))) return;
+ if (!(hdc = GetDCEx( hwnd, (clip > (HRGN)1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
+ ((clip > (HRGN)1) ?(DCX_INTERSECTRGN | DCX_KEEPCLIPRGN) : 0) ))) return;
- if (ExcludeVisRect16( hdc, rectClient.left-rectWindow.left,
+ if (ExcludeVisRect16( HDC_16(hdc), rectClient.left-rectWindow.left,
rectClient.top-rectWindow.top,
rectClient.right-rectWindow.left,
rectClient.bottom-rectWindow.top )
@@ -1559,7 +1560,7 @@
rect.right = rectWindow.right - rectWindow.left;
rect.bottom = rectWindow.bottom - rectWindow.top;
- if( clip > 1 )
+ if( clip > (HRGN)1 )
GetRgnBox( clip, &rectClip );
else
{
@@ -1782,7 +1783,7 @@
DWORD wndStyle = GetWindowLongA( hwnd, GWL_STYLE);
HMENU hSysMenu = GetSystemMenu(hwnd, FALSE);
- void (*paintButton)(HWND, HDC16, BOOL, BOOL);
+ void (*paintButton)(HWND, HDC, BOOL, BOOL);
if (wParam == HTMINBUTTON)
{
@@ -1857,7 +1858,7 @@
MSG msg;
HDC hdc = GetWindowDC( hwnd );
BOOL pressed = TRUE;
- void (*paintButton)(HWND, HDC16, BOOL);
+ void (*paintButton)(HWND, HDC, BOOL);
SetCapture( hwnd );
@@ -2218,7 +2219,7 @@
SelectObject (hdcMask, hMaskBmp);
/* Draw the grayed bitmap using the mask */
- hOldBrush = SelectObject (hdc, RGB(128, 128, 128));
+ hOldBrush = SelectObject (hdc, (HGDIOBJ)RGB(128, 128, 128));
BitBlt (hdc, x, y, 12, 10,
hdcMask, 0, 0, 0xB8074A);
diff --git a/windows/painting.c b/windows/painting.c
index 7189a1d..f991729 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -74,7 +74,7 @@
static BOOL CALLBACK draw_state_callback( HDC hdc, LPARAM lparam, WPARAM wparam, int cx, int cy )
{
const struct draw_state_info *info = (struct draw_state_info *)lparam;
- return PAINTING_CallTo16_word_wlwww( info->proc, hdc, info->param, wparam, cx, cy );
+ return PAINTING_CallTo16_word_wlwww( info->proc, HDC_16(hdc), info->param, wparam, cx, cy );
}
@@ -212,7 +212,7 @@
if(wnd->hwndSelf == GetDesktopWindow())
{
wnd->flags &= ~WIN_NEEDS_NCPAINT;
- if( wnd->hrgnUpdate > 1 )
+ if( wnd->hrgnUpdate > (HRGN)1 )
{
if (!hRgn) hRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( hRgn, wnd->hrgnUpdate, 0, RGN_COPY );
@@ -245,7 +245,7 @@
TRACE_(nonclient)( "\tclient box (%i,%i-%i,%i), hrgnUpdate %04x\n",
r.left, r.top, r.right, r.bottom, wnd->hrgnUpdate );
- if( wnd->hrgnUpdate > 1 )
+ if( wnd->hrgnUpdate > (HRGN)1 )
{
/* Check if update rgn overlaps with nonclient area */
@@ -282,16 +282,16 @@
if(!hClip && wnd->hrgnUpdate ) goto copyrgn;
}
else
- if( wnd->hrgnUpdate == 1 )/* entire window */
+ if( wnd->hrgnUpdate == (HRGN)1 )/* entire window */
{
if( uncFlags & UNC_UPDATE ) wnd->hrgnUpdate = CreateRectRgnIndirect( &r );
- if( uncFlags & UNC_REGION ) hrgnRet = 1;
+ if( uncFlags & UNC_REGION ) hrgnRet = (HRGN)1;
uncFlags |= UNC_ENTIRE;
}
}
else /* no WM_NCPAINT unless forced */
{
- if( wnd->hrgnUpdate > 1 )
+ if( wnd->hrgnUpdate > (HRGN)1 )
{
copyrgn:
if( uncFlags & UNC_REGION )
@@ -302,29 +302,29 @@
}
}
else
- if( wnd->hrgnUpdate == 1 && (uncFlags & UNC_UPDATE) )
+ if( wnd->hrgnUpdate == (HRGN)1 && (uncFlags & UNC_UPDATE) )
{
GETCLIENTRECTW( wnd, r );
wnd->hrgnUpdate = CreateRectRgnIndirect( &r );
- if( uncFlags & UNC_REGION ) hrgnRet = 1;
+ if( uncFlags & UNC_REGION ) hrgnRet = (HRGN)1;
}
}
if(!hClip && (uncFlags & UNC_ENTIRE) )
{
/* still don't do anything if there is no nonclient area */
- hClip = (memcmp( &wnd->rectWindow, &wnd->rectClient, sizeof(RECT) ) != 0);
+ hClip = (HRGN)(memcmp( &wnd->rectWindow, &wnd->rectClient, sizeof(RECT) ) != 0);
}
if( hClip ) /* NOTE: WM_NCPAINT allows wParam to be 1 */
{
- if ( hClip == hrgnRet && hrgnRet > 1 ) {
+ if ( hClip == hrgnRet && hrgnRet > (HRGN)1 ) {
hClip = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( hClip, hrgnRet, 0, RGN_COPY );
}
- SendMessageA( wnd->hwndSelf, WM_NCPAINT, hClip, 0L );
- if( (hClip > 1) && (hClip != hRgn) && (hClip != hrgnRet) )
+ SendMessageA( wnd->hwndSelf, WM_NCPAINT, (WPARAM)hClip, 0L );
+ if( (hClip > (HRGN)1) && (hClip != hRgn) && (hClip != hrgnRet) )
DeleteObject( hClip );
/*
* Since all Window locks are suspended while processing the WM_NCPAINT
@@ -354,7 +354,7 @@
HWND parent;
HRGN hrg;
- if (wndChild->hrgnUpdate == 1 ) {
+ if (wndChild->hrgnUpdate == (HRGN)1 ) {
RECT r;
r.left = 0;
r.top = 0;
@@ -374,7 +374,7 @@
{
POINT ptOffset;
RECT rect, rectParent;
- if( wndParent->hrgnUpdate == 1 )
+ if( wndParent->hrgnUpdate == (HRGN)1 )
{
RECT r;
@@ -431,7 +431,7 @@
if( flags & RDW_INVALIDATE )
{
- if( hRgn > 1 )
+ if( hRgn > (HRGN)1 )
{
switch ((UINT)wndPtr->hrgnUpdate)
{
@@ -457,11 +457,11 @@
break;
}
}
- else if( hRgn == 1 )
+ else if( hRgn == (HRGN)1 )
{
- if( wndPtr->hrgnUpdate > 1 )
+ if( wndPtr->hrgnUpdate > (HRGN)1 )
DeleteObject( wndPtr->hrgnUpdate );
- wndPtr->hrgnUpdate = 1;
+ wndPtr->hrgnUpdate = (HRGN)1;
}
else
hRgn = wndPtr->hrgnUpdate; /* this is a trick that depends on code in PAINT_RedrawWindow() */
@@ -477,9 +477,9 @@
{
if( wndPtr->hrgnUpdate )
{
- if( hRgn > 1 )
+ if( hRgn > (HRGN)1 )
{
- if( wndPtr->hrgnUpdate == 1 )
+ if( wndPtr->hrgnUpdate == (HRGN)1 )
wndPtr->hrgnUpdate = CreateRectRgnIndirect( &r );
if( CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate, hRgn, RGN_DIFF )
@@ -491,7 +491,7 @@
}
else /* validate everything */
{
- if( wndPtr->hrgnUpdate > 1 ) DeleteObject( wndPtr->hrgnUpdate );
+ if( wndPtr->hrgnUpdate > (HRGN)1 ) DeleteObject( wndPtr->hrgnUpdate );
wndPtr->hrgnUpdate = 0;
}
@@ -517,7 +517,7 @@
if( flags & (RDW_INVALIDATE | RDW_VALIDATE) )
{
HWND *list;
- if( hRgn > 1 && bChildren && (list = WIN_ListChildren( wndPtr->hwndSelf )))
+ if( hRgn > (HRGN)1 && bChildren && (list = WIN_ListChildren( wndPtr->hwndSelf )))
{
POINT ptTotal, prevOrigin = {0,0};
POINT ptClient;
@@ -656,7 +656,7 @@
if( hrgnRet )
{
- if( hrgnRet > 1 ) hrgn = hrgnRet; else hrgnRet = 0; /* entire client */
+ if( hrgnRet > (HRGN)1 ) hrgn = hrgnRet; else hrgnRet = 0; /* entire client */
if( wndPtr->flags & WIN_NEEDS_ERASEBKGND )
{
if( bIcon ) dcx |= DCX_WINDOW;
@@ -792,8 +792,8 @@
{
if( flags & RDW_FRAME )
{
- if (wndPtr->hrgnUpdate) hRgn = 1;
- else wndPtr->hrgnUpdate = 1;
+ if (wndPtr->hrgnUpdate) hRgn = (HRGN)1;
+ else wndPtr->hrgnUpdate = (HRGN)1;
}
else
{
@@ -824,7 +824,7 @@
else /* entire window or client depending on RDW_NOFRAME */
{
if( flags & RDW_NOFRAME )
- hRgn = 1;
+ hRgn = (HRGN)1;
else
{
GETCLIENTRECTW( wndPtr, r2 );
@@ -839,10 +839,10 @@
/* Erase/update windows, from now on hRgn is a scratch region */
- hRgn = RDW_Paint( wndPtr, (hRgn == 1) ? 0 : hRgn, flags, 0 );
+ hRgn = RDW_Paint( wndPtr, (hRgn == (HRGN)1) ? 0 : hRgn, flags, 0 );
END:
- if( hRgn > 1 && (hRgn != hrgnUpdate) )
+ if( hRgn > (HRGN)1 && (hRgn != hrgnUpdate) )
DeleteObject(hRgn );
WIN_ReleaseWndPtr(wndPtr);
return TRUE;
@@ -905,7 +905,7 @@
if (rect)
{
- if (wndPtr->hrgnUpdate > 1)
+ if (wndPtr->hrgnUpdate > (HRGN)1)
{
HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
if (GetUpdateRgn( hwnd, hrgn, erase ) == ERROR)
@@ -924,7 +924,7 @@
}
}
else
- if( wndPtr->hrgnUpdate == 1 )
+ if( wndPtr->hrgnUpdate == (HRGN)1 )
{
GetClientRect( hwnd, rect );
if (erase) RedrawWindow( hwnd, NULL, 0, RDW_FRAME | RDW_ERASENOW | RDW_NOCHILDREN );
@@ -932,7 +932,7 @@
else
SetRectEmpty( rect );
}
- retvalue = (wndPtr->hrgnUpdate >= 1);
+ retvalue = (wndPtr->hrgnUpdate >= (HRGN)1);
END:
WIN_ReleaseWndPtr(wndPtr);
return retvalue;
@@ -955,7 +955,7 @@
goto END;
}
else
- if (wndPtr->hrgnUpdate == 1)
+ if (wndPtr->hrgnUpdate == (HRGN)1)
{
SetRectRgn( hrgn, 0, 0, wndPtr->rectClient.right - wndPtr->rectClient.left,
wndPtr->rectClient.bottom - wndPtr->rectClient.top );
@@ -991,7 +991,7 @@
wndPtr->rectWindow.top - wndPtr->rectClient.top,
wndPtr->rectWindow.right - wndPtr->rectClient.left,
wndPtr->rectWindow.bottom - wndPtr->rectClient.top);
- if( wndPtr->hrgnUpdate > 1 )
+ if( wndPtr->hrgnUpdate > (HRGN)1 )
{
CombineRgn(hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY);
OffsetRgn(hrgn, wndPtr->rectWindow.left - wndPtr->rectClient.left,
@@ -1026,10 +1026,10 @@
* it will be done later in the PatBlt().
*/
- if (!(prevBrush = SelectObject( hdc, hbrush ))) return 0;
- PatBlt( hdc, rect->left, rect->top,
+ if (!(prevBrush = SelectObject( HDC_32(hdc), HBRUSH_32(hbrush) ))) return 0;
+ PatBlt( HDC_32(hdc), rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
- SelectObject( hdc, prevBrush );
+ SelectObject( HDC_32(hdc), prevBrush );
return 1;
}
@@ -1058,7 +1058,7 @@
*/
void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect )
{
- PatBlt( hdc, rect->left, rect->top,
+ PatBlt( HDC_32(hdc), rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
}
@@ -1106,7 +1106,7 @@
{
RECT rect;
CONV_RECT16TO32( rect16, &rect );
- return FrameRect( hdc, &rect, hbrush );
+ return FrameRect( HDC_32(hdc), &rect, HBRUSH_32(hbrush) );
}
@@ -1117,7 +1117,7 @@
{
RECT rect32;
CONV_RECT16TO32( rc, &rect32 );
- DrawFocusRect( hdc, &rect32 );
+ DrawFocusRect( HDC_32(hdc), &rect32 );
}
@@ -1425,14 +1425,15 @@
if (!cx || !cy)
{
SIZE s;
- if (!GetTextExtentPoint32A( hdc, MapSL(ldata), wdata, &s )) return FALSE;
+ if (!GetTextExtentPoint32A( HDC_32(hdc), MapSL(ldata), wdata, &s )) return FALSE;
if (!cx) cx = s.cx;
if (!cy) cy = s.cy;
}
}
info.proc = func;
info.param = ldata;
- return DrawStateA( hdc, hbr, draw_state_callback, (LPARAM)&info, wdata, x, y, cx, cy, flags );
+ return DrawStateA( HDC_32(hdc), HBRUSH_32(hbr), draw_state_callback,
+ (LPARAM)&info, wdata, x, y, cx, cy, flags );
}
diff --git a/windows/scroll.c b/windows/scroll.c
index 1db4859..fea5c67 100644
--- a/windows/scroll.c
+++ b/windows/scroll.c
@@ -73,25 +73,6 @@
}
/*************************************************************************
- * ScrollDC (USER.221)
- */
-BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect,
- const RECT16 *cliprc, HRGN16 hrgnUpdate,
- LPRECT16 rcUpdate )
-{
- RECT rect32, clipRect32, rcUpdate32;
- BOOL16 ret;
-
- if (rect) CONV_RECT16TO32( rect, &rect32 );
- if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 );
- ret = ScrollDC( hdc, dx, dy, rect ? &rect32 : NULL,
- cliprc ? &clipRect32 : NULL, hrgnUpdate, &rcUpdate32 );
- if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
- return ret;
-}
-
-
-/*************************************************************************
* ScrollDC (USER32.@)
*
* Only the hrgnUpdate is return in device coordinate.
diff --git a/windows/sysparams.c b/windows/sysparams.c
index d1397be..fd1a30d 100644
--- a/windows/sysparams.c
+++ b/windows/sysparams.c
@@ -1585,7 +1585,7 @@
WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */
case SPI_GETDEFAULTINPUTLANG: /* 89 WINVER >= 0x400 */
- ret = GetKeyboardLayout(0);
+ ret = GetKeyboardLayout(0) ? TRUE : FALSE;
break;
WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG); /* 90 WINVER >= 0x400 */
diff --git a/windows/win.c b/windows/win.c
index b2a1353..c974455 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -1108,8 +1108,7 @@
wndPtr->pVScroll = NULL;
wndPtr->pHScroll = NULL;
wndPtr->userdata = 0;
- wndPtr->hSysMenu = (wndPtr->dwStyle & WS_SYSMENU)
- ? MENU_GetSysMenu( hwnd, 0 ) : 0;
+ wndPtr->hSysMenu = (wndPtr->dwStyle & WS_SYSMENU) ? MENU_GetSysMenu( hwnd, 0 ) : 0;
wndPtr->cbWndExtra = wndExtra;
if (wndExtra) memset( wndPtr->wExtra, 0, wndExtra);
@@ -1252,7 +1251,7 @@
cs.lpCreateParams = data;
cs.hInstance = (HINSTANCE)instance;
- cs.hMenu = (HMENU)menu;
+ cs.hMenu = HMENU_32(menu);
cs.hwndParent = WIN_Handle32( parent );
cs.style = style;
cs.lpszName = windowName;