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
85e351ab
Commit
85e351ab
authored
Jan 18, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Return result through NtCallbackReturn for the DDE message callback.
parent
386e9fef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
33 deletions
+26
-33
user_main.c
dlls/user32/user_main.c
+6
-5
message.c
dlls/win32u/message.c
+9
-9
user.c
dlls/wow64win/user.c
+6
-12
ntuser.h
include/ntuser.h
+5
-7
No files found.
dlls/user32/user_main.c
View file @
85e351ab
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "user_private.h"
#include "controls.h"
#include "imm.h"
...
...
@@ -179,18 +181,17 @@ static BOOL WINAPI User32LoadDriver( const WCHAR *path, ULONG size )
return
LoadLibraryW
(
path
)
!=
NULL
;
}
static
NTSTATUS
WINAPI
User32UnpackDDEMessage
(
const
struct
unpack_dde_message_params
*
param
s
,
ULONG
size
)
static
NTSTATUS
WINAPI
User32UnpackDDEMessage
(
void
*
arg
s
,
ULONG
size
)
{
const
struct
unpack_dde_message_params
*
params
=
args
;
struct
unpack_dde_message_result
result
=
{
.
wparam
=
params
->
wparam
,
.
lparam
=
params
->
lparam
};
size
-=
FIELD_OFFSET
(
struct
unpack_dde_message_params
,
data
);
if
(
!
unpack_dde_message
(
params
->
hwnd
,
params
->
message
,
&
result
.
wparam
,
&
result
.
lparam
,
params
->
data
,
size
))
return
FALSE
;
return
STATUS_NO_MEMORY
;
if
(
params
->
result
)
*
params
->
result
=
result
;
else
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
TRUE
);
return
TRUE
;
return
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
STATUS_SUCCESS
);
}
static
const
void
*
kernel_callback_table
[
NtUserCallCount
]
=
...
...
dlls/win32u/message.c
View file @
85e351ab
...
...
@@ -2894,27 +2894,27 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags,
}
if
(
info
.
msg
.
message
>=
WM_DDE_FIRST
&&
info
.
msg
.
message
<=
WM_DDE_LAST
)
{
struct
unpack_dde_message_result
result
;
struct
unpack_dde_message_result
*
result
;
struct
unpack_dde_message_params
*
params
;
void
*
ret_ptr
;
NTSTATUS
status
;
ULONG
len
;
BOOL
ret
;
len
=
FIELD_OFFSET
(
struct
unpack_dde_message_params
,
data
[
size
]
);
if
(
!
(
params
=
malloc
(
len
)))
continue
;
params
->
result
=
&
result
;
params
->
hwnd
=
info
.
msg
.
hwnd
;
params
->
message
=
info
.
msg
.
message
;
params
->
wparam
=
info
.
msg
.
wParam
;
params
->
lparam
=
info
.
msg
.
lParam
;
if
(
size
)
memcpy
(
params
->
data
,
buffer
,
size
);
ret
=
KeUserModeCallback
(
NtUserUnpackDDEMessage
,
params
,
len
,
&
ret_ptr
,
&
len
);
if
(
len
==
sizeof
(
result
))
result
=
*
(
struct
unpack_dde_message_result
*
)
ret_ptr
;
status
=
KeUserModeCallback
(
NtUserUnpackDDEMessage
,
params
,
len
,
(
void
**
)
&
result
,
&
len
);
free
(
params
);
if
(
!
ret
)
continue
;
/* ignore it */
info
.
msg
.
wParam
=
result
.
wparam
;
info
.
msg
.
lParam
=
result
.
lparam
;
if
(
status
)
continue
;
/* ignore it */
if
(
len
==
sizeof
(
*
result
))
{
info
.
msg
.
wParam
=
result
->
wparam
;
info
.
msg
.
lParam
=
result
->
lparam
;
}
}
*
msg
=
info
.
msg
;
msg
->
pt
=
point_phys_to_win_dpi
(
info
.
msg
.
hwnd
,
info
.
msg
.
pt
);
...
...
dlls/wow64win/user.c
View file @
85e351ab
...
...
@@ -399,7 +399,6 @@ struct draw_text_params32
struct
unpack_dde_message_params32
{
ULONG
result
;
ULONG
hwnd
;
UINT
message
;
LONG
wparam
;
...
...
@@ -1395,14 +1394,13 @@ static NTSTATUS WINAPI wow64_NtUserUnpackDDEMessage( void *arg, ULONG size )
LONG
wparam
;
LONG
lparam
;
}
*
result32
;
void
*
ret_ptr
;
ULONG
ret_len
;
NTSTATUS
status
;
size
-=
FIELD_OFFSET
(
struct
unpack_dde_message_params
,
data
);
if
(
!
(
params32
=
Wow64AllocateTemp
(
FIELD_OFFSET
(
struct
unpack_dde_message_params32
,
data
[
size
]
))))
return
0
;
return
STATUS_NO_MEMORY
;
params32
->
result
=
0
;
params32
->
hwnd
=
HandleToUlong
(
params
->
hwnd
);
params32
->
message
=
params
->
message
;
params32
->
wparam
=
params
->
wparam
;
...
...
@@ -1410,18 +1408,14 @@ static NTSTATUS WINAPI wow64_NtUserUnpackDDEMessage( void *arg, ULONG size )
if
(
size
)
memcpy
(
params32
->
data
,
params
->
data
,
size
);
size
=
FIELD_OFFSET
(
struct
unpack_dde_message_params32
,
data
[
size
]
);
if
(
!
Wow64KiUserCallbackDispatcher
(
NtUserUnpackDDEMessage
,
params32
,
size
,
&
ret_ptr
,
&
ret_len
))
return
FALSE
;
if
(
ret_len
==
sizeof
(
*
result32
))
status
=
Wow64KiUserCallbackDispatcher
(
NtUserUnpackDDEMessage
,
params32
,
size
,
(
void
**
)
&
result32
,
&
ret_len
);
if
(
!
status
&&
ret_len
==
sizeof
(
*
result32
))
{
result32
=
ret_ptr
;
result
.
wparam
=
result32
->
wparam
;
result
.
lparam
=
result32
->
lparam
;
return
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
status
);
}
if
(
!
params
->
result
)
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
TRUE
);
*
params
->
result
=
result
;
return
TRUE
;
return
status
;
}
static
NTSTATUS
WINAPI
wow64_NtUserCallFreeIcon
(
void
*
arg
,
ULONG
size
)
...
...
include/ntuser.h
View file @
85e351ab
...
...
@@ -262,21 +262,19 @@ struct render_synthesized_format_params
};
/* NtUserUnpackDDEMessage params */
struct
unpack_dde_message_result
{
WPARAM
wparam
;
LPARAM
lparam
;
};
struct
unpack_dde_message_params
{
struct
unpack_dde_message_result
*
result
;
/* FIXME: Use NtCallbackReturn instead */
HWND
hwnd
;
UINT
message
;
WPARAM
wparam
;
LPARAM
lparam
;
char
data
[
1
];
};
struct
unpack_dde_message_result
{
WPARAM
wparam
;
LPARAM
lparam
;
};
/* process DPI awareness contexts */
#define NTUSER_DPI_UNAWARE 0x00006010
...
...
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