Commit 1b847dff authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUsetSetWindowLong implementation from user32.

parent 895ef97b
......@@ -95,10 +95,6 @@ static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
{
}
static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
{
}
static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
{
}
......@@ -190,7 +186,7 @@ static struct user_driver_funcs lazy_load_driver =
NULL,
NULL,
nulldrv_SetWindowIcon,
nulldrv_SetWindowStyle,
NULL,
nulldrv_SetWindowText,
nulldrv_ShowWindow,
nulldrv_SysCommand,
......@@ -230,7 +226,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(SetWindowIcon);
SET_USER_FUNC(SetWindowStyle);
SET_USER_FUNC(SetWindowText);
SET_USER_FUNC(ShowWindow);
SET_USER_FUNC(SysCommand);
......
......@@ -1864,8 +1864,6 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
case WM_WINE_SHOWWINDOW:
if (is_desktop_window( hwnd )) return 0;
return ShowWindow( hwnd, wparam );
case WM_WINE_SETWINDOWLONG:
return WIN_SetWindowLong( hwnd, (short)LOWORD(wparam), HIWORD(wparam), lparam, TRUE );
default:
{
MSG m;
......
......@@ -730,7 +730,7 @@
@ stdcall SetWindowStationUser(long long)
@ stdcall SetWindowTextA(long str)
@ stdcall SetWindowTextW(long wstr)
@ stdcall SetWindowWord(long long long)
@ stdcall SetWindowWord(long long long) NtUserSetWindowWord
@ stdcall SetWindowsHookA(long ptr)
@ stdcall SetWindowsHookExA(long long long long)
@ stdcall SetWindowsHookExW(long long long long)
......
......@@ -50,7 +50,6 @@ extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
extern HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, BOOL unicode ) DECLSPEC_HIDDEN;
extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ) DECLSPEC_HIDDEN;
extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN;
extern LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL unicode ) DECLSPEC_HIDDEN;
extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id ) DECLSPEC_HIDDEN;
extern HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access ) DECLSPEC_HIDDEN;
......
......@@ -152,6 +152,17 @@ WNDPROC get_winproc( WNDPROC proc, BOOL ansi )
}
}
/* Return the window procedure type, or the default value if not a winproc handle. */
BOOL is_winproc_unicode( WNDPROC proc, BOOL def_val )
{
WINDOWPROC *ptr = get_winproc_ptr( proc );
if (!ptr) return def_val;
if (ptr == WINPROC_PROC16) return FALSE; /* 16-bit is always A */
if (ptr->procA && ptr->procW) return def_val; /* can be both */
return ptr->procW != NULL;
}
/***********************************************************************
* NtUserInitializeClientPfnArrays (win32u.@)
*/
......
......@@ -1203,8 +1203,11 @@ static struct unix_funcs unix_funcs =
NtUserSetLayeredWindowAttributes,
NtUserSetParent,
NtUserSetSysColors,
NtUserSetWindowLong,
NtUserSetWindowLongPtr,
NtUserSetWindowPos,
NtUserSetWindowRgn,
NtUserSetWindowWord,
NtUserShowCursor,
NtUserSystemParametersInfo,
NtUserSystemParametersInfoForDpi,
......
......@@ -47,6 +47,8 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
case WM_WINE_SETPARENT:
if (is_desktop_window( hwnd )) return 0;
return HandleToUlong( NtUserSetParent( hwnd, UlongToHandle(wparam) ));
case WM_WINE_SETWINDOWLONG:
return set_window_long( hwnd, (short)LOWORD(wparam), HIWORD(wparam), lparam, FALSE );
case WM_WINE_SETSTYLE:
if (is_desktop_window( hwnd )) return 0;
return set_window_style( hwnd, wparam, lparam );
......
......@@ -245,6 +245,7 @@ typedef struct tagCLASS
/* class.c */
WNDPROC alloc_winproc( WNDPROC func, BOOL ansi ) DECLSPEC_HIDDEN;
WINDOWPROC *get_winproc_ptr( WNDPROC handle ) DECLSPEC_HIDDEN;
BOOL is_winproc_unicode( WNDPROC proc, BOOL def_val ) DECLSPEC_HIDDEN;
DWORD get_class_long( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN;
ULONG_PTR get_class_long_ptr( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN;
WORD get_class_word( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
......
......@@ -1246,15 +1246,15 @@
@ stub NtUserSetWindowFNID
@ stub NtUserSetWindowFeedbackSetting
@ stub NtUserSetWindowGroup
@ stub NtUserSetWindowLong
@ stub NtUserSetWindowLongPtr
@ stdcall NtUserSetWindowLong(long long long long)
@ stdcall NtUserSetWindowLongPtr(long long long long)
@ stub NtUserSetWindowPlacement
@ stdcall NtUserSetWindowPos(long long long long long long long)
@ stdcall NtUserSetWindowRgn(long long long)
@ stub NtUserSetWindowRgnEx
@ stub NtUserSetWindowShowState
@ stub NtUserSetWindowStationUser
@ stub NtUserSetWindowWord
@ stdcall NtUserSetWindowWord(long long long)
@ stub NtUserSetWindowsHookAW
@ stdcall -syscall NtUserSetWindowsHookEx(ptr ptr long long ptr long)
@ stub NtUserShowCaret
......
......@@ -251,8 +251,11 @@ struct unix_funcs
BOOL (WINAPI *pNtUserSetLayeredWindowAttributes)( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags );
HWND (WINAPI *pNtUserSetParent)( HWND hwnd, HWND parent );
BOOL (WINAPI *pNtUserSetSysColors)( INT count, const INT *colors, const COLORREF *values );
LONG (WINAPI *pNtUserSetWindowLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
LONG_PTR (WINAPI *pNtUserSetWindowLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
BOOL (WINAPI *pNtUserSetWindowPos)( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
int (WINAPI *pNtUserSetWindowRgn)( HWND hwnd, HRGN hrgn, BOOL redraw );
WORD (WINAPI *pNtUserSetWindowWord)( HWND hwnd, INT offset, WORD newval );
INT (WINAPI *pNtUserShowCursor)( BOOL show );
BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini );
BOOL (WINAPI *pNtUserSystemParametersInfoForDpi)( UINT action, UINT val, PVOID ptr,
......@@ -360,6 +363,8 @@ extern HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *cla
extern int map_window_points( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count,
UINT dpi ) DECLSPEC_HIDDEN;
extern void map_window_region( HWND from, HWND to, HRGN hrgn ) DECLSPEC_HIDDEN;
extern LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval,
BOOL ansi ) DECLSPEC_HIDDEN;
extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) DECLSPEC_HIDDEN;
extern ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
......
......@@ -1033,6 +1033,18 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va
return unix_funcs->pNtUserSetSysColors( count, colors, values );
}
LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetWindowLong( hwnd, offset, newval, ansi );
}
LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetWindowLongPtr( hwnd, offset, newval, ansi );
}
BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags )
{
if (!unix_funcs) return 0;
......@@ -1045,6 +1057,12 @@ int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
return unix_funcs->pNtUserSetWindowRgn( hwnd, hrgn, redraw );
}
WORD WINAPI NtUserSetWindowWord( HWND hwnd, INT offset, WORD newval )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetWindowWord( hwnd, offset, newval );
}
INT WINAPI NtUserShowCursor( BOOL show )
{
if (!unix_funcs) return 0;
......
......@@ -402,8 +402,11 @@ BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values );
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi );
LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw );
WORD WINAPI NtUserSetWindowWord( HWND hwnd, INT offset, WORD newval );
HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWORD tid, INT id,
HOOKPROC proc, BOOL ansi );
HWINEVENTHOOK WINAPI NtUserSetWinEventHook( DWORD event_min, DWORD event_max, HMODULE inst,
......
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