Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
336f0332
Commit
336f0332
authored
May 19, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move desktop window proc implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a15df248
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
22 deletions
+46
-22
desktop.c
dlls/user32/desktop.c
+5
-22
defwnd.c
dlls/win32u/defwnd.c
+37
-0
message.c
dlls/win32u/message.c
+2
-0
win32u_private.h
dlls/win32u/win32u_private.h
+1
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/desktop.c
View file @
336f0332
...
...
@@ -95,30 +95,13 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
switch
(
message
)
{
case
WM_NCCREATE
:
{
CREATESTRUCTW
*
cs
=
(
CREATESTRUCTW
*
)
lParam
;
const
GUID
*
guid
=
cs
->
lpCreateParams
;
if
(
guid
)
{
ATOM
atom
;
WCHAR
buffer
[
37
];
if
(
NtUserGetAncestor
(
hwnd
,
GA_PARENT
))
return
FALSE
;
/* refuse to create non-desktop window */
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
atom
=
GlobalAddAtomW
(
buffer
);
SetPropW
(
hwnd
,
L"__wine_display_device_guid"
,
ULongToHandle
(
atom
)
);
}
return
TRUE
;
}
case
WM_NCCALCSIZE
:
return
0
;
return
NtUserMessageCall
(
hwnd
,
message
,
wParam
,
lParam
,
0
,
NtUserDesktopWindowProc
,
FALSE
);
default:
return
DefWindowProcW
(
hwnd
,
message
,
wParam
,
lParam
);
if
(
message
<
WM_USER
)
return
DefWindowProcW
(
hwnd
,
message
,
wParam
,
lParam
);
return
NtUserMessageCall
(
hwnd
,
message
,
wParam
,
lParam
,
0
,
NtUserDesktopWindowProc
,
FALSE
);
}
}
...
...
dlls/win32u/defwnd.c
View file @
336f0332
...
...
@@ -384,3 +384,40 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
return
result
;
}
LRESULT
desktop_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
static
const
WCHAR
wine_display_device_guidW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
'_'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'_'
,
'g'
,
'u'
,
'i'
,
'd'
,
0
};
switch
(
msg
)
{
case
WM_NCCREATE
:
{
CREATESTRUCTW
*
cs
=
(
CREATESTRUCTW
*
)
lparam
;
const
GUID
*
guid
=
cs
->
lpCreateParams
;
if
(
guid
)
{
ATOM
atom
=
0
;
char
buffer
[
37
];
WCHAR
bufferW
[
37
];
if
(
NtUserGetAncestor
(
hwnd
,
GA_PARENT
))
return
FALSE
;
/* refuse to create non-desktop window */
sprintf
(
buffer
,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
,
(
unsigned
int
)
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
NtAddAtom
(
bufferW
,
asciiz_to_unicode
(
bufferW
,
buffer
)
-
sizeof
(
WCHAR
),
&
atom
);
NtUserSetProp
(
hwnd
,
wine_display_device_guidW
,
ULongToHandle
(
atom
)
);
}
return
TRUE
;
}
case
WM_NCCALCSIZE
:
return
0
;
}
return
default_window_proc
(
hwnd
,
msg
,
wparam
,
lparam
,
FALSE
);
}
dlls/win32u/message.c
View file @
336f0332
...
...
@@ -2890,6 +2890,8 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
{
switch
(
type
)
{
case
NtUserDesktopWindowProc
:
return
desktop_window_proc
(
hwnd
,
msg
,
wparam
,
lparam
);
case
NtUserDefWindowProc
:
return
default_window_proc
(
hwnd
,
msg
,
wparam
,
lparam
,
ansi
);
case
NtUserCallWindowProc
:
...
...
dlls/win32u/win32u_private.h
View file @
336f0332
...
...
@@ -360,6 +360,7 @@ extern void register_window_surface( struct window_surface *old,
/* defwnd.c */
extern
LRESULT
default_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
)
DECLSPEC_HIDDEN
;
extern
LRESULT
desktop_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
extern
void
fill_rect
(
HDC
dc
,
const
RECT
*
rect
,
HBRUSH
hbrush
)
DECLSPEC_HIDDEN
;
/* hook.c */
...
...
include/ntuser.h
View file @
336f0332
...
...
@@ -181,6 +181,7 @@ struct render_synthesized_format_params
/* NtUserMessageCall codes */
enum
{
NtUserDesktopWindowProc
=
0x029d
,
NtUserDefWindowProc
=
0x029e
,
NtUserCallWindowProc
=
0x02ab
,
NtUserSendMessage
=
0x02b1
,
...
...
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