Commit 3ffa355d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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

parent 6cb23362
......@@ -115,7 +115,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o
data_size_t *ret_len ) DECLSPEC_HIDDEN;
extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) 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 */
extern LIST_ENTRY tls_links DECLSPEC_HIDDEN;
......
......@@ -384,11 +384,11 @@ int wait_select_reply( void *cookie )
/***********************************************************************
* 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;
void *addr;
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 );
func( call->user.args[0], call->user.args[1], call->user.args[2] );
user_apc = TRUE;
break;
}
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 );
func( wine_server_get_ptr( call->timer.arg ),
(DWORD)call->timer.time, (DWORD)(call->timer.time >> 32) );
user_apc = TRUE;
break;
}
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 );
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)
size = offsetof( select_op_t, signal_and_wait.signal );
if ((ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC) &&
invoke_apc( &call, &result ))
if (ret == STATUS_KERNEL_APC) 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,
* but we don't want to wait */
abs_timeout = 0;
......
......@@ -2496,9 +2496,10 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size
RtlLeaveCriticalSection( &addr_section );
if ((ret == STATUS_USER_APC || ret == STATUS_KERNEL_APC) &&
invoke_apc( &call, &result ))
if (ret == STATUS_KERNEL_APC) 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,
* but we don't want to wait */
abs_timeout = 0;
......
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