[PATCH] Implement BindIoCompletionCallback
Andrey Turkin
andrey.turkin at gmail.com
Wed Dec 19 11:36:52 CST 2007
Alexandre Julliard wrote:
> Robert Shearman <rob at codeweavers.com> writes:
>
>
>> Andrey Turkin wrote:
>>
>>> Robert Shearman wrote:
>>>
>>>
>>>> Andrey Turkin wrote:
>>>>
>>>>
>>>>> /******************************************************************************
>>>>>
>>>>> * BindIoCompletionCallback (KERNEL32.@)
>>>>> */
>>>>> +extern NTSTATUS WINAPI
>>>>> RtlSetIoCompletionCallback(HANDLE,LPOVERLAPPED_COMPLETION_ROUTINE,ULONG);
>>>>>
>>>>>
>>>>>
>>>>>
>>>> This should go in winternl.h.
>>>>
>>>>
>>> winternl.h may not depend on winbase.h for some reason, so this would
>>> mean either changing prototype to "(HANDLE,LPVOID,ULONG)", which seems
>>> wrong, or redefining LPOVERLAPPED_COMPLETION_ROUTINE and
>>> OVERLAPPED/LPOVERLAPPED, which seems to be too much duplication.
>>>
>>>
>> I think you should guard the function with an #ifdef __WINE_WINBASE_H
>> statement, but I would wait for some other developers to chime in to get
>> a consensus before accepting this though.
>>
>
> It doesn't seem right for an ntdll function to use an OVERLAPPED
> pointer. Shouldn't it take an IO_STATUS_BLOCK instead?
>
>
It is not used in the function itself, it is only passed to
user-provided callback. So, I see several possibilities:
1) change RtlSetIoCompletionCallback to use another callback prototype,
with LPVOID or ULONG_PTR or something instead of LPOVERLAPPED
2) leave callback prototype as in BindIoCompletionCallback, and protect
RtlSetIoCompletionCallback with #ifdefs as Robert suggested
3) do not implement RtlSetIoCompletionCallback at all and move all code
in kernel32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20071219/873fcc6e/attachment.htm
More information about the wine-devel
mailing list