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
b26d1278
Commit
b26d1278
authored
Jan 19, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Return a proper NTSTATUS in all user callbacks.
parent
621bcd0d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
31 deletions
+44
-31
message.c
dlls/user.exe16/message.c
+3
-1
class.c
dlls/user32/class.c
+4
-2
hook.c
dlls/user32/hook.c
+5
-3
user_main.c
dlls/user32/user_main.c
+14
-9
user_private.h
dlls/user32/user_private.h
+4
-4
winproc.c
dlls/user32/winproc.c
+9
-5
defwnd.c
dlls/win32u/defwnd.c
+2
-3
imm.c
dlls/win32u/imm.c
+2
-3
win32u_private.h
dlls/win32u/win32u_private.h
+1
-1
No files found.
dlls/user.exe16/message.c
View file @
b26d1278
...
...
@@ -2583,9 +2583,11 @@ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance,
}
static
void
WINAPI
User16CallFreeIcon
(
ULONG
*
param
,
ULONG
size
)
static
NTSTATUS
WINAPI
User16CallFreeIcon
(
void
*
args
,
ULONG
size
)
{
ULONG
*
param
=
args
;
GlobalFree16
(
LOWORD
(
*
param
)
);
return
STATUS_SUCCESS
;
}
...
...
dlls/user32/class.c
View file @
b26d1278
...
...
@@ -19,6 +19,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 "wine/debug.h"
...
...
@@ -268,7 +270,7 @@ static void load_uxtheme(void)
/***********************************************************************
* User32InitBuiltinClasses
*/
BOOL
WINAPI
User32InitBuiltinClasses
(
const
struct
win_hook_params
*
param
s
,
ULONG
size
)
NTSTATUS
WINAPI
User32InitBuiltinClasses
(
void
*
arg
s
,
ULONG
size
)
{
DWORD
layout
;
...
...
@@ -276,7 +278,7 @@ BOOL WINAPI User32InitBuiltinClasses( const struct win_hook_params *params, ULON
/* Load uxtheme.dll so that standard scrollbars and dialogs are hooked for theming support */
load_uxtheme
();
return
TRUE
;
return
STATUS_SUCCESS
;
}
...
...
dlls/user32/hook.c
View file @
b26d1278
...
...
@@ -432,12 +432,14 @@ HWINEVENTHOOK WINAPI SetWinEventHook(DWORD event_min, DWORD event_max,
return
NtUserSetWinEventHook
(
event_min
,
event_max
,
inst
,
&
str
,
proc
,
pid
,
tid
,
flags
);
}
BOOL
WINAPI
User32CallWinEventHook
(
const
struct
win_event_hook_params
*
param
s
,
ULONG
size
)
NTSTATUS
WINAPI
User32CallWinEventHook
(
void
*
arg
s
,
ULONG
size
)
{
const
struct
win_event_hook_params
*
params
=
args
;
WINEVENTPROC
proc
=
params
->
proc
;
HMODULE
free_module
=
0
;
if
(
params
->
module
[
0
]
&&
!
(
proc
=
get_hook_proc
(
proc
,
params
->
module
,
&
free_module
)))
return
FALSE
;
if
(
params
->
module
[
0
]
&&
!
(
proc
=
get_hook_proc
(
proc
,
params
->
module
,
&
free_module
)))
return
STATUS_INVALID_PARAMETER
;
TRACE_
(
relay
)(
"
\1
Call winevent hook proc %p (hhook=%p,event=%lx,hwnd=%p,object_id=%lx,child_id=%lx,tid=%04lx,time=%lx)
\n
"
,
proc
,
params
->
handle
,
params
->
event
,
params
->
hwnd
,
params
->
object_id
,
...
...
@@ -451,7 +453,7 @@ BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params,
params
->
child_id
,
params
->
tid
,
params
->
time
);
if
(
free_module
)
FreeLibrary
(
free_module
);
return
TRUE
;
return
STATUS_SUCCESS
;
}
NTSTATUS
WINAPI
User32CallWindowsHook
(
void
*
args
,
ULONG
size
)
...
...
dlls/user32/user_main.c
View file @
b26d1278
...
...
@@ -112,7 +112,7 @@ static NTSTATUS WINAPI User32DrawNonClientButton( const struct draw_non_client_b
{
user_api
->
pNonClientButtonDraw
(
params
->
hwnd
,
params
->
hdc
,
params
->
type
,
params
->
rect
,
params
->
down
,
params
->
grayed
);
return
0
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
WINAPI
User32DrawScrollBar
(
const
struct
draw_scroll_bar_params
*
params
,
ULONG
size
)
...
...
@@ -122,7 +122,7 @@ static NTSTATUS WINAPI User32DrawScrollBar( const struct draw_scroll_bar_params
&
params
->
tracking_info
,
params
->
arrows
,
params
->
interior
,
&
rect
,
params
->
enable_flags
,
params
->
arrow_size
,
params
->
thumb_pos
,
params
->
thumb_size
,
params
->
vertical
);
return
0
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
WINAPI
User32DrawText
(
void
*
args
,
ULONG
size
)
...
...
@@ -136,15 +136,20 @@ static NTSTATUS WINAPI User32DrawText( void *args, ULONG size )
return
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
STATUS_SUCCESS
);
}
static
NTSTATUS
WINAPI
User32ImmProcessKey
(
const
struct
imm_process_key_params
*
param
s
,
ULONG
size
)
static
NTSTATUS
WINAPI
User32ImmProcessKey
(
void
*
arg
s
,
ULONG
size
)
{
return
ImmProcessKey
(
params
->
hwnd
,
params
->
hkl
,
params
->
vkey
,
params
->
key_data
,
0
);
const
struct
imm_process_key_params
*
params
=
args
;
if
(
ImmProcessKey
(
params
->
hwnd
,
params
->
hkl
,
params
->
vkey
,
params
->
key_data
,
0
))
return
STATUS_SUCCESS
;
return
STATUS_INVALID_PARAMETER
;
}
static
NTSTATUS
WINAPI
User32ImmTranslateMessage
(
const
struct
imm_translate_message_params
*
params
,
ULONG
size
)
static
NTSTATUS
WINAPI
User32ImmTranslateMessage
(
void
*
args
,
ULONG
size
)
{
return
ImmTranslateMessage
(
params
->
hwnd
,
params
->
msg
,
params
->
wparam
,
params
->
key_data
);
const
struct
imm_translate_message_params
*
params
=
args
;
if
(
ImmTranslateMessage
(
params
->
hwnd
,
params
->
msg
,
params
->
wparam
,
params
->
key_data
))
return
STATUS_SUCCESS
;
return
STATUS_INVALID_PARAMETER
;
}
static
NTSTATUS
WINAPI
User32LoadImage
(
void
*
args
,
ULONG
size
)
...
...
@@ -168,7 +173,7 @@ static NTSTATUS WINAPI User32FreeCachedClipboardData( const struct free_cached_d
ULONG
size
)
{
free_cached_data
(
params
->
format
,
params
->
handle
);
return
0
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
WINAPI
User32PostDDEMessage
(
const
struct
post_dde_message_params
*
params
,
ULONG
size
)
...
...
@@ -181,7 +186,7 @@ static NTSTATUS WINAPI User32RenderSsynthesizedFormat( const struct render_synth
ULONG
size
)
{
render_synthesized_format
(
params
->
format
,
params
->
from
);
return
0
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
WINAPI
User32LoadDriver
(
void
*
args
,
ULONG
size
)
...
...
dlls/user32/user_private.h
View file @
b26d1278
...
...
@@ -82,11 +82,11 @@ extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *
/* kernel callbacks */
NTSTATUS
WINAPI
User32CallEnumDisplayMonitor
(
void
*
args
,
ULONG
size
);
BOOL
WINAPI
User32CallSendAsyncCallback
(
const
struct
send_async_params
*
param
s
,
ULONG
size
);
BOOL
WINAPI
User32CallWinEventHook
(
const
struct
win_event_hook_params
*
param
s
,
ULONG
size
);
BOOL
WINAPI
User32CallWindowProc
(
struct
win_proc_params
*
param
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32CallSendAsyncCallback
(
void
*
arg
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32CallWinEventHook
(
void
*
arg
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32CallWindowProc
(
void
*
arg
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32CallWindowsHook
(
void
*
args
,
ULONG
size
);
BOOL
WINAPI
User32InitBuiltinClasses
(
const
struct
win_hook_params
*
param
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32InitBuiltinClasses
(
void
*
arg
s
,
ULONG
size
);
/* message spy definitions */
...
...
dlls/user32/winproc.c
View file @
b26d1278
...
...
@@ -19,6 +19,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 "dbt.h"
...
...
@@ -802,8 +804,9 @@ void unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, vo
*
lparam
=
(
LPARAM
)
buffer
;
}
BOOL
WINAPI
User32CallWindowProc
(
struct
win_proc_params
*
param
s
,
ULONG
size
)
NTSTATUS
WINAPI
User32CallWindowProc
(
void
*
arg
s
,
ULONG
size
)
{
struct
win_proc_params
*
params
=
args
;
size_t
packed_size
=
0
;
void
*
buffer
=
NULL
;
LRESULT
result
;
...
...
@@ -824,15 +827,16 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
{
LRESULT
*
result_ptr
=
(
LRESULT
*
)
buffer
-
1
;
*
result_ptr
=
result
;
return
NtCallbackReturn
(
result_ptr
,
sizeof
(
*
result_ptr
)
+
packed_size
,
TRUE
);
return
NtCallbackReturn
(
result_ptr
,
sizeof
(
*
result_ptr
)
+
packed_size
,
STATUS_SUCCESS
);
}
return
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
TRUE
);
return
NtCallbackReturn
(
&
result
,
sizeof
(
result
),
STATUS_SUCCESS
);
}
BOOL
WINAPI
User32CallSendAsyncCallback
(
const
struct
send_async_params
*
param
s
,
ULONG
size
)
NTSTATUS
WINAPI
User32CallSendAsyncCallback
(
void
*
arg
s
,
ULONG
size
)
{
const
struct
send_async_params
*
params
=
args
;
params
->
callback
(
params
->
hwnd
,
params
->
msg
,
params
->
data
,
params
->
result
);
return
TRUE
;
return
STATUS_SUCCESS
;
}
/**********************************************************************
...
...
dlls/win32u/defwnd.c
View file @
b26d1278
...
...
@@ -1362,8 +1362,7 @@ static BOOL draw_frame_caption( HDC dc, RECT *r, UINT flags )
return
TRUE
;
}
BOOL
draw_menu_button
(
HWND
hwnd
,
HDC
dc
,
RECT
*
r
,
enum
NONCLIENT_BUTTON_TYPE
type
,
BOOL
down
,
BOOL
grayed
)
void
draw_menu_button
(
HWND
hwnd
,
HDC
dc
,
RECT
*
r
,
enum
NONCLIENT_BUTTON_TYPE
type
,
BOOL
down
,
BOOL
grayed
)
{
struct
draw_non_client_button_params
params
;
void
*
ret_ptr
;
...
...
@@ -1375,7 +1374,7 @@ BOOL draw_menu_button( HWND hwnd, HDC dc, RECT *r, enum NONCLIENT_BUTTON_TYPE ty
params
.
rect
=
*
r
;
params
.
down
=
down
;
params
.
grayed
=
grayed
;
return
KeUserModeCallback
(
NtUserDrawNonClientButton
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
KeUserModeCallback
(
NtUserDrawNonClientButton
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
BOOL
draw_frame_menu
(
HDC
dc
,
RECT
*
r
,
UINT
flags
)
...
...
dlls/win32u/imm.c
View file @
b26d1278
...
...
@@ -614,7 +614,7 @@ BOOL WINAPI ImmProcessKey( HWND hwnd, HKL hkl, UINT vkey, LPARAM key_data, DWORD
{
.
hwnd
=
hwnd
,
.
hkl
=
hkl
,
.
vkey
=
vkey
,
.
key_data
=
key_data
};
void
*
ret_ptr
;
ULONG
ret_len
;
return
KeUserModeCallback
(
NtUserImmProcessKey
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
return
!
KeUserModeCallback
(
NtUserImmProcessKey
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
BOOL
WINAPI
ImmTranslateMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
key_data
)
...
...
@@ -623,6 +623,5 @@ BOOL WINAPI ImmTranslateMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM key_
{
.
hwnd
=
hwnd
,
.
msg
=
msg
,
.
wparam
=
wparam
,
.
key_data
=
key_data
};
void
*
ret_ptr
;
ULONG
ret_len
;
return
KeUserModeCallback
(
NtUserImmTranslateMessage
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
return
!
KeUserModeCallback
(
NtUserImmTranslateMessage
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
dlls/win32u/win32u_private.h
View file @
b26d1278
...
...
@@ -63,7 +63,7 @@ extern void register_window_surface( struct window_surface *old,
extern
LRESULT
default_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
);
extern
LRESULT
desktop_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
extern
BOOL
draw_menu_button
(
HWND
hwnd
,
HDC
dc
,
RECT
*
r
,
enum
NONCLIENT_BUTTON_TYPE
,
BOOL
down
,
BOOL
grayed
);
extern
void
draw_menu_button
(
HWND
hwnd
,
HDC
dc
,
RECT
*
r
,
enum
NONCLIENT_BUTTON_TYPE
,
BOOL
down
,
BOOL
grayed
);
extern
BOOL
draw_frame_menu
(
HDC
dc
,
RECT
*
r
,
UINT
flags
);
extern
BOOL
draw_nc_sys_button
(
HWND
hwnd
,
HDC
hdc
,
BOOL
down
);
extern
BOOL
draw_rect_edge
(
HDC
hdc
,
RECT
*
rc
,
UINT
uType
,
UINT
uFlags
,
UINT
width
);
...
...
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