mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:40:59 +00:00
kernel32: Add support for completion routine invocation in ReadDirectoryChangesW.
This commit is contained in:
parent
f5d96d1701
commit
45b65d0fb6
|
@ -134,6 +134,12 @@ BOOL WINAPI FindCloseChangeNotification( HANDLE handle )
|
|||
return CloseHandle( handle );
|
||||
}
|
||||
|
||||
static void WINAPI invoke_completion(LPVOID ctx, IO_STATUS_BLOCK *ios, ULONG res)
|
||||
{
|
||||
LPOVERLAPPED_COMPLETION_ROUTINE completion = ctx;
|
||||
completion(ios->u.Status, ios->Information, (LPOVERLAPPED)ios);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* ReadDirectoryChangesW (KERNEL32.@)
|
||||
*
|
||||
|
@ -169,14 +175,16 @@ BOOL WINAPI ReadDirectoryChangesW( HANDLE handle, LPVOID buffer, DWORD len, BOOL
|
|||
else
|
||||
{
|
||||
pov = overlapped;
|
||||
if (!completion && ((ULONG_PTR)overlapped->hEvent & 1) == 0) cvalue = overlapped;
|
||||
if(completion) cvalue = completion;
|
||||
else if (((ULONG_PTR)overlapped->hEvent & 1) == 0) cvalue = overlapped;
|
||||
}
|
||||
|
||||
ios = (PIO_STATUS_BLOCK) pov;
|
||||
ios->u.Status = STATUS_PENDING;
|
||||
|
||||
status = NtNotifyChangeDirectoryFile( handle, pov->hEvent, NULL, cvalue,
|
||||
ios, buffer, len, filter, subtree );
|
||||
status = NtNotifyChangeDirectoryFile( handle, completion && overlapped ? NULL : pov->hEvent,
|
||||
completion && overlapped ? invoke_completion : NULL,
|
||||
cvalue, ios, buffer, len, filter, subtree );
|
||||
if (status == STATUS_PENDING)
|
||||
{
|
||||
if (overlapped)
|
||||
|
|
Loading…
Reference in a new issue