Commit ef741939 authored by Alexandre Julliard's avatar Alexandre Julliard

user: Add a WIN_ISUNICODE flag instead of relying on the winproc type.

Also fix the initial value for the server is_unicode flag.
parent e9927d6f
...@@ -532,6 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND *win, WINDOWPROCTYPE type ) ...@@ -532,6 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND *win, WINDOWPROCTYPE type )
} }
win->class = class; win->class = class;
win->clsStyle = class->style; win->clsStyle = class->style;
if (WINPROC_GetProcType( win->winproc ) == WIN_PROC_32W) win->flags |= WIN_ISUNICODE;
} }
......
...@@ -122,6 +122,7 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom, ...@@ -122,6 +122,7 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
win->parent = full_parent; win->parent = full_parent;
win->owner = full_owner; win->owner = full_owner;
win->dwMagic = WND_MAGIC; win->dwMagic = WND_MAGIC;
win->flags = 0;
win->cbWndExtra = extra_bytes; win->cbWndExtra = extra_bytes;
memset( win->wExtra, 0, extra_bytes ); memset( win->wExtra, 0, extra_bytes );
CLASS_AddWindow( class, win, type ); CLASS_AddWindow( class, win, type );
...@@ -988,13 +989,13 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -988,13 +989,13 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
wndPtr->dwExStyle = cs->dwExStyle; wndPtr->dwExStyle = cs->dwExStyle;
wndPtr->wIDmenu = 0; wndPtr->wIDmenu = 0;
wndPtr->helpContext = 0; wndPtr->helpContext = 0;
wndPtr->flags = (type == WIN_PROC_16) ? 0 : WIN_ISWIN32;
wndPtr->pVScroll = NULL; wndPtr->pVScroll = NULL;
wndPtr->pHScroll = NULL; wndPtr->pHScroll = NULL;
wndPtr->userdata = 0; wndPtr->userdata = 0;
wndPtr->hIcon = 0; wndPtr->hIcon = 0;
wndPtr->hIconSmall = 0; wndPtr->hIconSmall = 0;
wndPtr->hSysMenu = 0; wndPtr->hSysMenu = 0;
if (type != WIN_PROC_16) wndPtr->flags |= WIN_ISWIN32;
if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 ); if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 );
...@@ -1032,7 +1033,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -1032,7 +1033,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
req->style = wndPtr->dwStyle; req->style = wndPtr->dwStyle;
req->ex_style = wndPtr->dwExStyle; req->ex_style = wndPtr->dwExStyle;
req->instance = (void *)wndPtr->hInstance; req->instance = (void *)wndPtr->hInstance;
req->is_unicode = (type == WIN_PROC_32W); req->is_unicode = (wndPtr->flags & WIN_ISUNICODE) != 0;
req->extra_offset = -1; req->extra_offset = -1;
wine_server_call( req ); wine_server_call( req );
} }
...@@ -1683,7 +1684,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd ) ...@@ -1683,7 +1684,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd )
if (wndPtr != WND_OTHER_PROCESS) if (wndPtr != WND_OTHER_PROCESS)
{ {
retvalue = (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W); retvalue = (wndPtr->flags & WIN_ISUNICODE) != 0;
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
} }
else else
...@@ -1990,10 +1991,12 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, ...@@ -1990,10 +1991,12 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
} }
case GWLP_WNDPROC: case GWLP_WNDPROC:
{ {
WINDOWPROCTYPE old_type = WINPROC_GetProcType( wndPtr->winproc ); UINT old_flags = wndPtr->flags;
retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, type ); retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, type );
wndPtr->winproc = WINPROC_AllocProc( (WNDPROC)newval, type ); wndPtr->winproc = WINPROC_AllocProc( (WNDPROC)newval, type );
if (old_type == type) if (WINPROC_GetProcType( wndPtr->winproc ) == WIN_PROC_32W) wndPtr->flags |= WIN_ISUNICODE;
else wndPtr->flags &= ~WIN_ISUNICODE;
if (!((old_flags ^ wndPtr->flags) & WIN_ISUNICODE))
{ {
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
return retval; return retval;
...@@ -2059,7 +2062,7 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, ...@@ -2059,7 +2062,7 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
break; break;
case GWLP_WNDPROC: case GWLP_WNDPROC:
req->flags = SET_WIN_UNICODE; req->flags = SET_WIN_UNICODE;
req->is_unicode = (type == WIN_PROC_32W); req->is_unicode = (wndPtr->flags & WIN_ISUNICODE) != 0;
break; break;
case GWLP_USERDATA: case GWLP_USERDATA:
req->flags = SET_WIN_USERDATA; req->flags = SET_WIN_USERDATA;
......
...@@ -68,7 +68,8 @@ typedef struct tagWND ...@@ -68,7 +68,8 @@ typedef struct tagWND
#define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */ #define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */
#define WIN_ISDIALOG 0x0010 /* Window is a dialog */ #define WIN_ISDIALOG 0x0010 /* Window is a dialog */
#define WIN_ISWIN32 0x0020 /* Understands Win32 messages */ #define WIN_ISWIN32 0x0020 /* Understands Win32 messages */
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0040 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ #define WIN_ISUNICODE 0x0040 /* Window is Unicode */
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
/* Window functions */ /* Window functions */
extern WND *WIN_GetPtr( HWND hwnd ); extern WND *WIN_GetPtr( HWND hwnd );
......
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