ntdll: Use the status to tell user APC from system APC.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-02-05 11:49:38 +01:00 committed by Alexandre Julliard
parent 6cb2336217
commit 3ffa355d2b
3 changed files with 10 additions and 11 deletions

View File

@ -115,7 +115,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o
data_size_t *ret_len ) DECLSPEC_HIDDEN; data_size_t *ret_len ) DECLSPEC_HIDDEN;
extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN;
extern int wait_select_reply( void *cookie ) DECLSPEC_HIDDEN; extern int wait_select_reply( void *cookie ) DECLSPEC_HIDDEN;
extern BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) DECLSPEC_HIDDEN; extern void invoke_apc( const apc_call_t *call, apc_result_t *result ) DECLSPEC_HIDDEN;
/* module handling */ /* module handling */
extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; extern LIST_ENTRY tls_links DECLSPEC_HIDDEN;

View File

@ -384,11 +384,11 @@ int wait_select_reply( void *cookie )
/*********************************************************************** /***********************************************************************
* invoke_apc * invoke_apc
* *
* Invoke a single APC. Return TRUE if a user APC has been run. * Invoke a single APC.
*
*/ */
BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) void invoke_apc( const apc_call_t *call, apc_result_t *result )
{ {
BOOL user_apc = FALSE;
SIZE_T size; SIZE_T size;
void *addr; void *addr;
pe_image_info_t image_info; pe_image_info_t image_info;
@ -403,7 +403,6 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
{ {
void (WINAPI *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR) = wine_server_get_ptr( call->user.func ); void (WINAPI *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR) = wine_server_get_ptr( call->user.func );
func( call->user.args[0], call->user.args[1], call->user.args[2] ); func( call->user.args[0], call->user.args[1], call->user.args[2] );
user_apc = TRUE;
break; break;
} }
case APC_TIMER: case APC_TIMER:
@ -411,7 +410,6 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
void (WINAPI *func)(void*, unsigned int, unsigned int) = wine_server_get_ptr( call->timer.func ); void (WINAPI *func)(void*, unsigned int, unsigned int) = wine_server_get_ptr( call->timer.func );
func( wine_server_get_ptr( call->timer.arg ), func( wine_server_get_ptr( call->timer.arg ),
(DWORD)call->timer.time, (DWORD)(call->timer.time >> 32) ); (DWORD)call->timer.time, (DWORD)(call->timer.time >> 32) );
user_apc = TRUE;
break; break;
} }
case APC_ASYNC_IO: case APC_ASYNC_IO:
@ -587,7 +585,6 @@ BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
server_protocol_error( "get_apc_request: bad type %d\n", call->type ); server_protocol_error( "get_apc_request: bad type %d\n", call->type );
break; break;
} }
return user_apc;
} }
@ -628,9 +625,10 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT
if (size >= sizeof(select_op->signal_and_wait) && select_op->op == SELECT_SIGNAL_AND_WAIT) if (size >= sizeof(select_op->signal_and_wait) && select_op->op == SELECT_SIGNAL_AND_WAIT)
size = offsetof( select_op_t, signal_and_wait.signal ); size = offsetof( select_op_t, signal_and_wait.signal );
if ((ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC) && if (ret == STATUS_KERNEL_APC) invoke_apc( &call, &result );
invoke_apc( &call, &result )) if (ret == STATUS_USER_APC)
{ {
invoke_apc( &call, &result );
/* if we ran a user apc we have to check once more if additional apcs are queued, /* if we ran a user apc we have to check once more if additional apcs are queued,
* but we don't want to wait */ * but we don't want to wait */
abs_timeout = 0; abs_timeout = 0;

View File

@ -2496,9 +2496,10 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size
RtlLeaveCriticalSection( &addr_section ); RtlLeaveCriticalSection( &addr_section );
if ((ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC) && if (ret == STATUS_KERNEL_APC) invoke_apc( &call, &result );
invoke_apc( &call, &result )) if (ret == STATUS_USER_APC)
{ {
invoke_apc( &call, &result );
/* if we ran a user apc we have to check once more if additional apcs are queued, /* if we ran a user apc we have to check once more if additional apcs are queued,
* but we don't want to wait */ * but we don't want to wait */
abs_timeout = 0; abs_timeout = 0;