Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
577fbb0f
Commit
577fbb0f
authored
Aug 18, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Move dialog proc getting implementation from win32u.
parent
e2a72562
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
52 deletions
+61
-52
user_private.h
dlls/user32/user_private.h
+2
-0
win.c
dlls/user32/win.c
+25
-2
winproc.c
dlls/user32/winproc.c
+21
-10
class.c
dlls/win32u/class.c
+3
-19
ntuser_private.h
dlls/win32u/ntuser_private.h
+1
-1
sysparams.c
dlls/win32u/sysparams.c
+3
-0
window.c
dlls/win32u/window.c
+0
-7
ntuser.h
include/ntuser.h
+6
-13
No files found.
dlls/user32/user_private.h
View file @
577fbb0f
...
...
@@ -33,6 +33,8 @@
#define GET_DWORD(ptr) (*(const DWORD *)(ptr))
#define GET_LONG(ptr) (*(const LONG *)(ptr))
#define WINPROC_PROC16 ((void *)1)
/* placeholder for 16-bit window procs */
/* data to store state for A/W mappings of WM_CHAR */
struct
wm_char_mapping_data
{
...
...
dlls/user32/win.c
View file @
577fbb0f
...
...
@@ -626,6 +626,17 @@ DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd )
}
static
LONG_PTR
get_window_long_ptr
(
HWND
hwnd
,
int
offset
,
LONG_PTR
ret
,
BOOL
ansi
)
{
if
(
offset
==
DWLP_DLGPROC
&&
NtUserGetDialogInfo
(
hwnd
))
{
DLGPROC
proc
=
NtUserGetDialogProc
(
(
DLGPROC
)
ret
,
ansi
);
if
(
proc
&&
proc
!=
WINPROC_PROC16
)
return
(
LONG_PTR
)
proc
;
}
return
ret
;
}
/***********************************************************************
* GetDpiForWindow (USER32.@)
*/
...
...
@@ -660,6 +671,11 @@ LONG WINAPI GetWindowLongA( HWND hwnd, INT offset )
return
0
;
#endif
default:
if
(
sizeof
(
void
*
)
==
sizeof
(
LONG
))
{
LONG_PTR
ret
=
NtUserGetWindowLongA
(
hwnd
,
offset
);
return
get_window_long_ptr
(
hwnd
,
offset
,
ret
,
TRUE
);
}
return
NtUserGetWindowLongA
(
hwnd
,
offset
);
}
}
...
...
@@ -681,6 +697,11 @@ LONG WINAPI GetWindowLongW( HWND hwnd, INT offset )
return
0
;
#endif
default:
if
(
sizeof
(
void
*
)
==
sizeof
(
LONG
))
{
LONG_PTR
ret
=
NtUserGetWindowLongW
(
hwnd
,
offset
);
return
get_window_long_ptr
(
hwnd
,
offset
,
ret
,
FALSE
);
}
return
NtUserGetWindowLongW
(
hwnd
,
offset
);
}
}
...
...
@@ -1411,7 +1432,8 @@ BOOL WINAPI SetProcessDefaultLayout( DWORD layout )
*/
LONG_PTR
WINAPI
GetWindowLongPtrW
(
HWND
hwnd
,
INT
offset
)
{
return
NtUserGetWindowLongPtrW
(
hwnd
,
offset
);
LONG_PTR
ret
=
NtUserGetWindowLongPtrW
(
hwnd
,
offset
);
return
get_window_long_ptr
(
hwnd
,
offset
,
ret
,
FALSE
);
}
/*****************************************************************************
...
...
@@ -1419,7 +1441,8 @@ LONG_PTR WINAPI GetWindowLongPtrW( HWND hwnd, INT offset )
*/
LONG_PTR
WINAPI
GetWindowLongPtrA
(
HWND
hwnd
,
INT
offset
)
{
return
NtUserGetWindowLongPtrA
(
hwnd
,
offset
);
LONG_PTR
ret
=
NtUserGetWindowLongPtrA
(
hwnd
,
offset
);
return
get_window_long_ptr
(
hwnd
,
offset
,
ret
,
TRUE
);
}
/*****************************************************************************
...
...
dlls/user32/winproc.c
View file @
577fbb0f
...
...
@@ -37,8 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msg
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
#define WINPROC_PROC16 ((void *)1)
/* placeholder for 16-bit window procs */
union
packed_structs
{
struct
packed_CREATESTRUCTW
cs
;
...
...
@@ -1286,16 +1284,22 @@ LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam
*/
INT_PTR
WINPROC_CallDlgProcA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DLGPROC
func
,
proc
;
LRESULT
result
;
DLGPROC
func
;
if
(
!
(
func
=
NtUserGetDialogProc
(
hwnd
,
DLGPROC_ANSI
)))
return
0
;
#ifdef _WIN64
proc
=
(
DLGPROC
)
NtUserGetWindowLongPtrA
(
hwnd
,
DWLP_DLGPROC
);
#else
proc
=
(
DLGPROC
)
NtUserGetWindowLongA
(
hwnd
,
DWLP_DLGPROC
);
#endif
if
(
!
proc
)
return
0
;
if
(
!
(
func
=
NtUserGetDialogProc
(
proc
,
TRUE
))
&&
!
(
func
=
NtUserGetDialogProc
(
proc
,
FALSE
)))
return
0
;
if
(
func
==
WINPROC_PROC16
)
{
INT_PTR
ret
;
if
(
!
(
func
=
NtUserGetDialogProc
(
hwnd
,
DLGPROC_WIN16
)))
return
0
;
ret
=
wow_handlers
.
call_dialog_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
&
result
,
func
);
ret
=
wow_handlers
.
call_dialog_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
&
result
,
proc
);
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
result
);
return
ret
;
}
...
...
@@ -1309,16 +1313,23 @@ INT_PTR WINPROC_CallDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
*/
INT_PTR
WINPROC_CallDlgProcW
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DLGPROC
func
,
proc
;
LRESULT
result
;
DLGPROC
func
;
if
(
!
(
func
=
NtUserGetDialogProc
(
hwnd
,
DLGPROC_UNICODE
)))
return
0
;
#ifdef _WIN64
proc
=
(
DLGPROC
)
NtUserGetWindowLongPtrW
(
hwnd
,
DWLP_DLGPROC
);
#else
proc
=
(
DLGPROC
)
NtUserGetWindowLongW
(
hwnd
,
DWLP_DLGPROC
);
#endif
if
(
!
proc
)
return
0
;
if
(
!
(
func
=
NtUserGetDialogProc
(
proc
,
FALSE
))
&&
!
(
func
=
NtUserGetDialogProc
(
proc
,
TRUE
)))
return
0
;
if
(
func
==
WINPROC_PROC16
)
{
INT_PTR
ret
;
if
(
!
(
func
=
NtUserGetDialogProc
(
hwnd
,
DLGPROC_WIN16
)))
return
0
;
ret
=
WINPROC_CallProcWtoA
(
wow_handlers
.
call_dialog_proc
,
hwnd
,
msg
,
wParam
,
lParam
,
&
result
,
fun
c
);
ret
=
WINPROC_CallProcWtoA
(
wow_handlers
.
call_dialog_proc
,
hwnd
,
msg
,
wParam
,
lParam
,
&
result
,
pro
c
);
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
result
);
return
ret
;
}
...
...
dlls/win32u/class.c
View file @
577fbb0f
...
...
@@ -237,29 +237,13 @@ void get_winproc_params( struct win_proc_params *params, BOOL fixup_ansi_dst )
if
(
!
params
->
procW
)
params
->
procW
=
params
->
func
;
}
DLGPROC
get_dialog_proc
(
HWND
hwnd
,
enum
dialog_proc_type
type
)
DLGPROC
get_dialog_proc
(
DLGPROC
ret
,
BOOL
ansi
)
{
WINDOWPROC
*
proc
;
DLGPROC
ret
;
WND
*
win
;
if
(
!
(
win
=
get_win_ptr
(
hwnd
)))
return
NULL
;
if
(
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
{
ERR
(
"cannot get dlg proc %p from other process
\n
"
,
hwnd
);
return
0
;
}
ret
=
*
(
DLGPROC
*
)((
char
*
)
win
->
wExtra
+
DWLP_DLGPROC
);
release_win_ptr
(
win
);
if
(
type
==
DLGPROC_WIN16
||
!
(
proc
=
get_winproc_ptr
(
ret
)))
return
ret
;
if
(
!
(
proc
=
get_winproc_ptr
(
ret
)))
return
ret
;
if
(
proc
==
WINPROC_PROC16
)
return
WINPROC_PROC16
;
if
(
type
==
DLGPROC_ANSI
)
ret
=
proc
->
procA
?
proc
->
procA
:
proc
->
procW
;
else
ret
=
proc
->
procW
?
proc
->
procW
:
proc
->
procA
;
return
ret
;
return
ansi
?
proc
->
procA
:
proc
->
procW
;
}
/***********************************************************************
...
...
dlls/win32u/ntuser_private.h
View file @
577fbb0f
...
...
@@ -223,7 +223,7 @@ DWORD get_class_long( HWND hwnd, INT offset, BOOL ansi ) DECLSPEC_HIDDEN;
WNDPROC
get_class_winproc
(
struct
tagCLASS
*
class
)
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
;
DLGPROC
get_dialog_proc
(
HWND
hwnd
,
enum
dialog_proc_type
type
)
DECLSPEC_HIDDEN
;
DLGPROC
get_dialog_proc
(
DLGPROC
proc
,
BOOL
ansi
)
DECLSPEC_HIDDEN
;
ATOM
get_int_atom_value
(
UNICODE_STRING
*
name
)
DECLSPEC_HIDDEN
;
WNDPROC
get_winproc
(
WNDPROC
proc
,
BOOL
ansi
)
DECLSPEC_HIDDEN
;
void
get_winproc_params
(
struct
win_proc_params
*
params
,
BOOL
fixup_ansi_dst
)
DECLSPEC_HIDDEN
;
...
...
dlls/win32u/sysparams.c
View file @
577fbb0f
...
...
@@ -5054,6 +5054,9 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
{
switch
(
code
)
{
case
NtUserCallTwoParam_GetDialogProc
:
return
(
ULONG_PTR
)
get_dialog_proc
(
(
DLGPROC
)
arg1
,
arg2
);
case
NtUserCallTwoParam_GetMenuInfo
:
return
get_menu_info
(
UlongToHandle
(
arg1
),
(
MENUINFO
*
)
arg2
);
...
...
dlls/win32u/window.c
View file @
577fbb0f
...
...
@@ -1056,10 +1056,6 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans
return
0
;
}
retval
=
get_win_data
(
(
char
*
)
win
->
wExtra
+
offset
,
size
);
/* Special case for dialog window procedure */
if
((
offset
==
DWLP_DLGPROC
)
&&
(
size
==
sizeof
(
LONG_PTR
))
&&
win
->
dlgInfo
)
retval
=
(
LONG_PTR
)
get_winproc
(
(
WNDPROC
)
retval
,
ansi
);
release_win_ptr
(
win
);
return
retval
;
}
...
...
@@ -5481,9 +5477,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
case
NtUserCallHwndParam_GetClientRect
:
return
get_client_rect
(
hwnd
,
(
RECT
*
)
param
);
case
NtUserCallHwndParam_GetDialogProc
:
return
(
ULONG_PTR
)
get_dialog_proc
(
hwnd
,
param
);
case
NtUserCallHwndParam_GetScrollInfo
:
{
struct
get_scroll_info_params
*
params
=
(
void
*
)
param
;
...
...
include/ntuser.h
View file @
577fbb0f
...
...
@@ -1066,6 +1066,7 @@ static inline UINT NtUserSetProcessDefaultLayout( DWORD layout )
/* NtUserCallTwoParam codes, not compatible with Windows */
enum
{
NtUserCallTwoParam_GetDialogProc
,
NtUserCallTwoParam_GetMenuInfo
,
NtUserCallTwoParam_GetMonitorInfo
,
NtUserCallTwoParam_GetSystemMetricsForDpi
,
...
...
@@ -1077,6 +1078,11 @@ enum
NtUserAllocWinProc
,
};
static
inline
DLGPROC
NtUserGetDialogProc
(
DLGPROC
proc
,
BOOL
ansi
)
{
return
(
DLGPROC
)
NtUserCallTwoParam
(
(
UINT_PTR
)
proc
,
ansi
,
NtUserCallTwoParam_GetDialogProc
);
}
static
inline
BOOL
NtUserGetMenuInfo
(
HMENU
menu
,
MENUINFO
*
info
)
{
return
NtUserCallTwoParam
(
HandleToUlong
(
menu
),
(
ULONG_PTR
)
info
,
...
...
@@ -1239,7 +1245,6 @@ enum
NtUserCallHwndParam_GetClassLongPtrW
,
NtUserCallHwndParam_GetClassWord
,
NtUserCallHwndParam_GetClientRect
,
NtUserCallHwndParam_GetDialogProc
,
NtUserCallHwndParam_GetScrollInfo
,
NtUserCallHwndParam_GetWindowInfo
,
NtUserCallHwndParam_GetWindowLongA
,
...
...
@@ -1310,18 +1315,6 @@ static inline BOOL NtUserGetClientRect( HWND hwnd, RECT *rect )
return
NtUserCallHwndParam
(
hwnd
,
(
UINT_PTR
)
rect
,
NtUserCallHwndParam_GetClientRect
);
}
enum
dialog_proc_type
{
DLGPROC_ANSI
,
DLGPROC_UNICODE
,
DLGPROC_WIN16
,
};
static
inline
DLGPROC
NtUserGetDialogProc
(
HWND
hwnd
,
enum
dialog_proc_type
type
)
{
return
(
DLGPROC
)
NtUserCallHwndParam
(
hwnd
,
type
,
NtUserCallHwndParam_GetDialogProc
);
}
struct
get_scroll_info_params
{
int
bar
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment