Asynchronous read/write tests in ntdll/tests/file.c

Thomas Faber thfabba at
Wed Sep 18 07:54:04 CDT 2013

On 2013-09-18 11:31, Dmitry Timoshkov wrote:
> Thomas Faber <thfabba at> wrote:
>> status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL);
>> ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* see below */, "expected STATUS_PENDING, got %#x\n", status);
>> ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
>> ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information);
>> ...
>> ret = WaitForSingleObject(hfile, 3000);
>> Technically, the IO_STATUS_BLOCK (hence also the OVERLAPPED) structure
>> is only filled once the I/O Manager completes the read/write IRP --
>> meaning its contents should only be read _after_ the wait.
> Contents of IO_STATUS_BLOCK/OVERLAPPED are tested only in the cases
> known to not contain STATUS_PENDING of a being executed operation,
> which means that the operation has already finished and waiting would
> return immediately and therefore is not necessary and redundant.

Hmm maybe I'm misunderstanding what you're saying, sorry... but I
thought the snippet above was a counter-example. It's a pretty
straightforward write that's expected to succeed (asynchronously), and
it verifies that STATUS_PENDING is returned, but then immediately reads

It's from line 2213ff. The ones at 2364 and 2381 look similar, there
might be more.

Am I missing some aspect of the test that makes it different from
"simple async write should always return pending"?


More information about the wine-devel mailing list