Commit 730b47e5 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Return STATUS_PENDING from NtReadFile() for async read with regular file.

parent fb5bf0ec
......@@ -1013,7 +1013,7 @@ err:
if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL );
}
ret_status = async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS
ret_status = async_read && type == FD_TYPE_FILE && status == STATUS_SUCCESS
? STATUS_PENDING : status;
if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, ret_status == STATUS_PENDING );
......
......@@ -635,7 +635,7 @@ static void read_file_test(void)
offset.QuadPart = 0;
ResetEvent( event );
status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, strlen(text) + 10, &offset, NULL );
todo_wine ok(status == STATUS_PENDING
ok(status == STATUS_PENDING
|| broken(status == STATUS_SUCCESS) /* before Vista */,
"wrong status %x.\n", status);
if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 );
......@@ -4450,7 +4450,7 @@ static void test_read_write(void)
bytes = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadFile(hfile, buf, 0, &bytes, &ovl);
todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
"Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
ret = GetLastError();
ok(bytes == 0, "bytes %u\n", bytes);
......@@ -4479,7 +4479,7 @@ static void test_read_write(void)
bytes = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadFile(hfile, NULL, 0, &bytes, &ovl);
todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
"Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
ret = GetLastError();
ok(bytes == 0, "bytes %u\n", bytes);
......@@ -4524,7 +4524,7 @@ static void test_read_write(void)
iob.Information = -1;
offset.QuadPart = sizeof(contents);
status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL);
todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
"expected STATUS_PENDING, got %#x.\n", status);
if (status == STATUS_PENDING)
{
......@@ -4550,7 +4550,7 @@ static void test_read_write(void)
bytes = 0;
SetLastError(0xdeadbeef);
ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl);
todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
"Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
if (!ret)
ok(bytes == 0, "bytes %u\n", bytes);
......@@ -4598,7 +4598,7 @@ static void test_read_write(void)
iob.Information = -1;
offset.QuadPart = 0;
status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL);
todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
"expected STATUS_PENDING, got %#x.\n", status);
if (status == STATUS_PENDING)
{
......@@ -4658,7 +4658,7 @@ static void test_read_write(void)
bytes = 0;
SetLastError(0xdeadbeef);
ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl);
todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
"Unexpected result %#x, GetLastError() %u.\n", ret, GetLastError());
if (!ret)
{
......
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