Zebediah Figura : ntdll: Implement NtRemoveIoCompletionEx().
Alexandre Julliard
julliard at winehq.org
Mon Oct 1 21:19:05 CDT 2018
Module: wine
Branch: master
Commit: ef2471ec0f817b1bb57d4888ed2f5fdf78022e75
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ef2471ec0f817b1bb57d4888ed2f5fdf78022e75
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sun Sep 30 16:59:47 2018 -0500
ntdll: Implement NtRemoveIoCompletionEx().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/ntdll.spec | 2 ++
dlls/ntdll/sync.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 5e7c463..b7cbff3 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -308,6 +308,7 @@
@ stub NtReleaseProcessMutant
@ stdcall NtReleaseSemaphore(long long ptr)
@ stdcall NtRemoveIoCompletion(ptr ptr ptr ptr ptr)
+@ stdcall NtRemoveIoCompletionEx(ptr ptr long ptr ptr long)
# @ stub NtRemoveProcessDebug
@ stdcall NtRenameKey(long ptr)
@ stdcall NtReplaceKey(ptr long ptr)
@@ -1243,6 +1244,7 @@
@ stub ZwReleaseProcessMutant
@ stdcall -private ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore
@ stdcall -private ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion
+@ stdcall -private ZwRemoveIoCompletionEx(ptr ptr long ptr ptr long) NtRemoveIoCompletionEx
# @ stub ZwRemoveProcessDebug
@ stdcall -private ZwRenameKey(long ptr) NtRenameKey
@ stdcall -private ZwReplaceKey(ptr long ptr) NtReplaceKey
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index bb462f2..4ae8e36 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -1334,6 +1334,54 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE CompletionPort, PULONG_PTR Completi
}
/******************************************************************
+ * NtRemoveIoCompletionEx (NTDLL.@)
+ * ZwRemoveIoCompletionEx (NTDLL.@)
+ */
+NTSTATUS WINAPI NtRemoveIoCompletionEx( HANDLE port, FILE_IO_COMPLETION_INFORMATION *info, ULONG count,
+ ULONG *written, LARGE_INTEGER *timeout, BOOLEAN alertable )
+{
+ NTSTATUS ret;
+ ULONG i = 0;
+
+ TRACE("%p %p %u %p %p %u\n", port, info, count, written, timeout, alertable);
+
+ for (;;)
+ {
+ for (;;)
+ {
+ SERVER_START_REQ( remove_completion )
+ {
+ req->handle = wine_server_obj_handle( port );
+ if (!(ret = wine_server_call( req )))
+ {
+ info[i].CompletionKey = reply->ckey;
+ info[i].CompletionValue = reply->cvalue;
+ info[i].IoStatusBlock.Information = reply->information;
+ info[i].IoStatusBlock.u.Status = reply->status;
+ }
+ }
+ SERVER_END_REQ;
+
+ if (ret != STATUS_SUCCESS) break;
+
+ if (i++ >= count) break;
+ }
+
+ if (i && ret == STATUS_PENDING)
+ {
+ ret = STATUS_SUCCESS;
+ break;
+ }
+
+ ret = NtWaitForSingleObject( port, alertable, timeout );
+ if (ret != WAIT_OBJECT_0) break;
+ }
+
+ *written = i ? i : 1;
+ return ret;
+}
+
+/******************************************************************
* NtOpenIoCompletion (NTDLL.@)
* ZwOpenIoCompletion (NTDLL.@)
*
More information about the wine-cvs
mailing list