Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index a00a159d24..59c58d552d 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -1351,7 +1351,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE port, FILE_IO_COMPLETION_INFORMAT
for (;;) { - for (;;) + while (i < count) { SERVER_START_REQ( remove_completion ) { @@ -1368,7 +1368,7 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE port, FILE_IO_COMPLETION_INFORMAT
if (ret != STATUS_SUCCESS) break;
- if (i++ >= count) break; + ++i; }
if (i && ret == STATUS_PENDING)
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45948 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/sync.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 59c58d552d..0c373a4c88 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -1371,9 +1371,10 @@ NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE port, FILE_IO_COMPLETION_INFORMAT ++i; }
- if (i && ret == STATUS_PENDING) + if (i || ret != STATUS_PENDING) { - ret = STATUS_SUCCESS; + if (ret == STATUS_PENDING) + ret = STATUS_SUCCESS; break; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/tests/file.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 56a438b973..dcea45e27b 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -955,6 +955,32 @@ static void test_set_io_completion(void) info[1].IoStatusBlock.Information ); ok( U(info[1].IoStatusBlock).Status == 56, "wrong status %#x\n", U(info[1].IoStatusBlock).Status);
+ res = pNtSetIoCompletion( h, 123, 456, 789, size ); + ok( res == STATUS_SUCCESS, "NtSetIoCompletion failed: %#x\n", res ); + + res = pNtSetIoCompletion( h, 12, 34, 56, size ); + ok( res == STATUS_SUCCESS, "NtSetIoCompletion failed: %#x\n", res ); + + count = 0xdeadbeef; + res = pNtRemoveIoCompletionEx( h, info, 1, &count, NULL, FALSE ); + ok( res == STATUS_SUCCESS, "NtRemoveIoCompletionEx failed: %#x\n", res ); + ok( count == 1, "wrong count %u\n", count ); + ok( info[0].CompletionKey == 123, "wrong key %#lx\n", info[0].CompletionKey ); + ok( info[0].CompletionValue == 456, "wrong value %#lx\n", info[0].CompletionValue ); + ok( info[0].IoStatusBlock.Information == size, "wrong information %#lx\n", + info[0].IoStatusBlock.Information ); + ok( U(info[0].IoStatusBlock).Status == 789, "wrong status %#x\n", U(info[0].IoStatusBlock).Status); + + count = 0xdeadbeef; + res = pNtRemoveIoCompletionEx( h, info, 1, &count, NULL, FALSE ); + ok( res == STATUS_SUCCESS, "NtRemoveIoCompletionEx failed: %#x\n", res ); + ok( count == 1, "wrong count %u\n", count ); + ok( info[0].CompletionKey == 12, "wrong key %#lx\n", info[0].CompletionKey ); + ok( info[0].CompletionValue == 34, "wrong value %#lx\n", info[0].CompletionValue ); + ok( info[0].IoStatusBlock.Information == size, "wrong information %#lx\n", + info[0].IoStatusBlock.Information ); + ok( U(info[0].IoStatusBlock).Status == 56, "wrong status %#x\n", U(info[0].IoStatusBlock).Status); + apc_count = 0; QueueUserAPC( user_apc_proc, GetCurrentThread(), (ULONG_PTR)&apc_count );
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44522
Your paranoid android.
=== debian9 (32 bit report) ===
ntdll: file.c:945: Test failed: NtRemoveIoCompletionEx failed: 0x102
=== debian9 (64 bit WoW report) ===
ntdll: file.c:945: Test failed: NtRemoveIoCompletionEx failed: 0x102