Commit 3f9de129 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Return result through NtCallbackReturn for the enum monitors callback.

parent a9e42169
......@@ -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 "wine/asm.h"
......@@ -849,14 +851,17 @@ __ASM_GLOBAL_FUNC( enum_mon_callback_wrapper,
"ret" )
#endif /* __i386__ */
BOOL WINAPI User32CallEnumDisplayMonitor( struct enum_display_monitor_params *params, ULONG size )
NTSTATUS WINAPI User32CallEnumDisplayMonitor( void *args, ULONG size )
{
struct enum_display_monitor_params *params = args;
BOOL ret;
#ifdef __i386__
return enum_mon_callback_wrapper( params->proc, params->monitor, params->hdc,
&params->rect, params->lparam );
ret = enum_mon_callback_wrapper( params->proc, params->monitor, params->hdc,
&params->rect, params->lparam );
#else
return params->proc( params->monitor, params->hdc, &params->rect, params->lparam );
ret = params->proc( params->monitor, params->hdc, &params->rect, params->lparam );
#endif
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
/***********************************************************************
......
......@@ -81,7 +81,7 @@ extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *
/* kernel callbacks */
BOOL WINAPI User32CallEnumDisplayMonitor( struct enum_display_monitor_params *params, ULONG size );
NTSTATUS WINAPI User32CallEnumDisplayMonitor( void *args, ULONG size );
BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params, ULONG size );
BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params, ULONG size );
BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size );
......
......@@ -3435,18 +3435,17 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc
params.proc = proc;
params.hdc = hdc;
params.lparam = lparam;
for (i = 0; i < count; i++)
for (i = 0; i < count && ret; i++)
{
void *ret_ptr;
ULONG ret_len;
NTSTATUS status;
params.monitor = enum_info[i].handle;
params.rect = enum_info[i].rect;
if (!KeUserModeCallback( NtUserCallEnumDisplayMonitor, &params, sizeof(params),
&ret_ptr, &ret_len ))
{
ret = FALSE;
break;
}
status = KeUserModeCallback( NtUserCallEnumDisplayMonitor, &params, sizeof(params),
&ret_ptr, &ret_len );
if (!status && ret_len == sizeof(ret)) ret = *(BOOL *)ret_ptr;
else ret = FALSE;
}
if (enum_info != enum_buf) free( enum_info );
return ret;
......
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