I'm not sure if this is correct (to return STATUS_USER_APC). Also, i see
you try to comment on code you write, and so do I, so i would rather see
you replied on comments instead of deleting them.
- /* Nebbets book says nothing about NtRemoveIoCompletion returning
STATUS_USER_APC,
- and the umode equivalent GetQueuedCompletionStatus says nothing about this
either,
- so my guess it we should restart the operation. Need further investigation.
-Gunnar
- */
+ /* If we got a timeout or user_apc back, return the status */
+ if ((NTSTATUS)ListEntry == STATUS_TIMEOUT || (NTSTATUS)ListEntry ==
STATUS_USER_APC) {
+
+ Status = (NTSTATUS)ListEntry;
+
+ } else {
+
+ /* Get the Packet Data */
+ Packet = CONTAINING_RECORD(ListEntry, IO_COMPLETION_PACKET, ListEntry);
+
+ _SEH_TRY {
- } while((NTSTATUS)ListEntry == STATUS_USER_APC);
+ /* Return it */
+ *CompletionKey = Packet->Key;
+ *CompletionContext = Packet->Context;
+ *IoStatusBlock = Packet->IoStatus;
+
+ } _SEH_HANDLE {