From: "Erich E. Hoover" Subject: [PATCH 3/4] server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete (try 3). Message-Id: Date: Fri, 25 May 2012 14:48:46 -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" or drastically restructure how the APC data is passed between the client and the server. This version of the patch has been rebased against an updated patch 2. Changelog: server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete. From 2369968a73602137630e7a7e481372f870db7ec8 Mon Sep 17 00:00:00 2001 From: Erich Hoover Date: Fri, 25 May 2012 14:31:28 -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 15d5a9d..37f745c 100644 --- a/server/async.c +++ b/server/async.c @@ -265,7 +265,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->queue->completion && async->data.cvalue) + if (status == STATUS_MORE_PROCESSING_REQUIRED) + async->status = STATUS_PENDING; + else if (async->queue->completion && async->data.cvalue) add_completion( async->queue->completion, async->queue->comp_key, async->data.cvalue, status, total ); if (apc) { -- 1.7.5.4