mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
implemeted waiting on file handles/file objects
svn path=/trunk/; revision=4527
This commit is contained in:
parent
7b5e0bebdf
commit
0871ebf88b
1 changed files with 18 additions and 4 deletions
|
@ -409,6 +409,20 @@ KeWaitForSingleObject(PVOID Object,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
PVOID
|
||||||
|
KiGetWaitableObjectFromObject(PVOID Object)
|
||||||
|
{
|
||||||
|
//special case when waiting on file objects
|
||||||
|
if ( ((PDISPATCHER_HEADER)Object)->Type == InternalFileType)
|
||||||
|
{
|
||||||
|
return &((PFILE_OBJECT)Object)->Event;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
KeWaitForMultipleObjects(ULONG Count,
|
KeWaitForMultipleObjects(ULONG Count,
|
||||||
PVOID Object[],
|
PVOID Object[],
|
||||||
|
@ -485,7 +499,7 @@ KeWaitForMultipleObjects(ULONG Count,
|
||||||
Abandoned = FALSE;
|
Abandoned = FALSE;
|
||||||
for (i = 0; i < Count; i++)
|
for (i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
hdr = (DISPATCHER_HEADER *) Object[i];
|
hdr = (DISPATCHER_HEADER *) KiGetWaitableObjectFromObject(Object[i]);
|
||||||
|
|
||||||
if (KiIsObjectSignalled(hdr, CurrentThread))
|
if (KiIsObjectSignalled(hdr, CurrentThread))
|
||||||
{
|
{
|
||||||
|
@ -518,7 +532,7 @@ KeWaitForMultipleObjects(ULONG Count,
|
||||||
{
|
{
|
||||||
for (i = 0; i < Count; i++)
|
for (i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
hdr = (DISPATCHER_HEADER *) Object[i];
|
hdr = (DISPATCHER_HEADER *) KiGetWaitableObjectFromObject(Object[i]);
|
||||||
Abandoned = KiSideEffectsBeforeWake(hdr, CurrentThread) ? TRUE : Abandoned;
|
Abandoned = KiSideEffectsBeforeWake(hdr, CurrentThread) ? TRUE : Abandoned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,9 +580,9 @@ KeWaitForMultipleObjects(ULONG Count,
|
||||||
|
|
||||||
for (i = 0; i < Count; i++)
|
for (i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
hdr = (DISPATCHER_HEADER *) Object[i];
|
hdr = (DISPATCHER_HEADER *) KiGetWaitableObjectFromObject(Object[i]);
|
||||||
|
|
||||||
blk->Object = Object[i];
|
blk->Object = KiGetWaitableObjectFromObject(Object[i]);
|
||||||
blk->Thread = CurrentThread;
|
blk->Thread = CurrentThread;
|
||||||
blk->WaitKey = STATUS_WAIT_0 + i;
|
blk->WaitKey = STATUS_WAIT_0 + i;
|
||||||
blk->WaitType = WaitType;
|
blk->WaitType = WaitType;
|
||||||
|
|
Loading…
Reference in a new issue