From: "Erich E. Hoover" Subject: [PATCH 2/3] server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete (try 2). Message-Id: Date: Mon, 14 May 2012 16:13:29 -0600 Real Name: Erich Hoover Description: Several MSDN articles indicate that kernel drivers can respond with STATUS_MORE_PROCESSING_REQUIRED to indicate that an IRP is incomplete and that a completion should not be processed. Handling the return value of our async operations in this way permits us to handle completions for closed AcceptEx socket handles (part 3). I realize that my previous attempt at this (using STATUS_ALERTED) was considered to be hackish, but I now have some evidence to support this method and I have added a variety of tests that establish that AcceptEx needs to work this way. Since there isn't enough room to add the completion port and the completion key to apc_call_t and it would be unacceptable to use the handle to the APC to send the completion, I can't see any other way to solve this issue except to have the callback return a value that means "I'm not done yet." Changelog: server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete. From 44442aada83546eb64a35f35105565d2ed4c1c31 Mon Sep 17 00:00:00 2001 From: Erich Hoover Date: Mon, 14 May 2012 15:41:19 -0600 Subject: server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete. --- server/async.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/server/async.c b/server/async.c index 01d1ca1..0e6fe05 100644 --- a/server/async.c +++ b/server/async.c @@ -259,7 +259,9 @@ void async_set_result( struct object *obj, unsigned int status, unsigned int tot if (async->timeout) remove_timeout_user( async->timeout ); async->timeout = NULL; async->status = status; - if (async->completion && async->data.cvalue) + if (status == STATUS_MORE_PROCESSING_REQUIRED) + async->status = STATUS_PENDING; + else if (async->completion && async->data.cvalue) add_completion( async->completion, async->comp_key, async->data.cvalue, status, total ); if (apc) { -- 1.7.5.4