Commit 6b16ead6 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll: The async handle passed to set_async_direct_result() cannot be NULL.

parent da8defe5
...@@ -2533,21 +2533,22 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG ...@@ -2533,21 +2533,22 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
/* Notify direct completion of async and close the wait handle if it is no longer needed. /* Notify direct completion of async and close the wait handle if it is no longer needed.
* This function is a no-op (returns status as-is) if the supplied handle is NULL. * This function is a no-op (returns status as-is) if the supplied handle is NULL.
*/ */
void set_async_direct_result( HANDLE *optional_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ) void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending )
{ {
NTSTATUS ret; NTSTATUS ret;
if (!*optional_handle) return; /* if we got STATUS_ALERTED, we must have a valid async handle */
assert( *async_handle );
SERVER_START_REQ( set_async_direct_result ) SERVER_START_REQ( set_async_direct_result )
{ {
req->handle = wine_server_obj_handle( *optional_handle ); req->handle = wine_server_obj_handle( *async_handle );
req->status = status; req->status = status;
req->information = information; req->information = information;
req->mark_pending = mark_pending; req->mark_pending = mark_pending;
ret = wine_server_call( req ); ret = wine_server_call( req );
if (ret == STATUS_SUCCESS) if (ret == STATUS_SUCCESS)
*optional_handle = wine_server_ptr_handle( reply->handle ); *async_handle = wine_server_ptr_handle( reply->handle );
} }
SERVER_END_REQ; SERVER_END_REQ;
......
...@@ -278,7 +278,7 @@ extern NTSTATUS get_device_info( int fd, struct _FILE_FS_DEVICE_INFORMATION *inf ...@@ -278,7 +278,7 @@ extern NTSTATUS get_device_info( int fd, struct _FILE_FS_DEVICE_INFORMATION *inf
extern void init_files(void) DECLSPEC_HIDDEN; extern void init_files(void) DECLSPEC_HIDDEN;
extern void init_cpu_info(void) DECLSPEC_HIDDEN; extern void init_cpu_info(void) DECLSPEC_HIDDEN;
extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULONG info, BOOL async ) DECLSPEC_HIDDEN; extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULONG info, BOOL async ) DECLSPEC_HIDDEN;
extern void set_async_direct_result( HANDLE *optional_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ); extern void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ) DECLSPEC_HIDDEN;
extern void dbg_init(void) DECLSPEC_HIDDEN; extern void dbg_init(void) DECLSPEC_HIDDEN;
......
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