Author: tfaber
Date: Tue Nov 24 15:51:32 2015
New Revision: 70097
URL:
http://svn.reactos.org/svn/reactos?rev=70097&view=rev
Log:
[RTL]
- Implement RtlSetIoCompletionCallback. Patch by Samuel Serapión.
CORE-10570 #resolve
Modified:
trunk/reactos/lib/rtl/workitem.c
Modified: trunk/reactos/lib/rtl/workitem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/workitem.c?rev=700…
==============================================================================
--- trunk/reactos/lib/rtl/workitem.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/workitem.c [iso-8859-1] Tue Nov 24 15:51:32 2015
@@ -912,8 +912,30 @@
IN PIO_APC_ROUTINE Callback,
IN ULONG Flags)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ IO_STATUS_BLOCK IoStatusBlock;
+ FILE_COMPLETION_INFORMATION FileCompletionInfo;
+ NTSTATUS Status;
+
+ DPRINT("RtlSetIoCompletionCallback(0x%p, 0x%p, 0x%x)\n", FileHandle,
Callback, Flags);
+
+ /* Initialize the thread pool if not already initialized */
+ if (!IsThreadPoolInitialized())
+ {
+ Status = RtlpInitializeThreadPool();
+ if (!NT_SUCCESS(Status))
+ return Status;
+ }
+
+ FileCompletionInfo.Port = ThreadPoolCompletionPort;
+ FileCompletionInfo.Key = (PVOID)Callback;
+
+ Status = NtSetInformationFile(FileHandle,
+ &IoStatusBlock,
+ &FileCompletionInfo,
+ sizeof(FileCompletionInfo),
+ FileCompletionInformation);
+
+ return Status;
}
/*