Commit cdf7b1bb authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Return result through NtCallbackReturn for the thunk lock callback.

parent 85e351ab
......@@ -22,6 +22,8 @@
#include <stdarg.h>
#include <string.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "wine/winuser16.h"
#include "wownt32.h"
#include "winerror.h"
......@@ -2587,16 +2589,17 @@ static void WINAPI User16CallFreeIcon( ULONG *param, ULONG size )
}
static DWORD WINAPI User16ThunkLock( DWORD *param, ULONG size )
static NTSTATUS WINAPI User16ThunkLock( void *args, ULONG size )
{
DWORD *param = args;
if (size != sizeof(DWORD))
{
DWORD lock;
ReleaseThunkLock( &lock );
return lock;
return NtCallbackReturn( &lock, sizeof(lock), STATUS_SUCCESS );
}
RestoreThunkLock( *param );
return 0;
return STATUS_SUCCESS;
}
......
......@@ -3007,12 +3007,15 @@ static inline LARGE_INTEGER *get_nt_timeout( LARGE_INTEGER *time, DWORD timeout
static DWORD wait_message( DWORD count, const HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags )
{
LARGE_INTEGER time;
DWORD ret, lock;
DWORD ret, lock = 0;
void *ret_ptr;
ULONG ret_len;
if (enable_thunk_lock)
lock = KeUserModeCallback( NtUserThunkLock, NULL, 0, &ret_ptr, &ret_len );
{
if (!KeUserModeCallback( NtUserThunkLock, NULL, 0, &ret_ptr, &ret_len ) && ret_len == sizeof(lock))
lock = *(DWORD *)ret_ptr;
}
if (user_driver->pProcessEvents( mask )) ret = count ? count - 1 : 0;
else if (count)
......
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