[NTOS] Fix kmtest

svn path=/trunk/; revision=69399
This commit is contained in:
Stefan Ginsberg 2015-09-28 12:48:14 +00:00
parent 3ee5af9d50
commit f543c860f7

View file

@ -79,12 +79,12 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
return STATUS_INVALID_PARAMETER_3;
}
/* Enter SEH for user mode */
PreviousMode = ExGetPreviousMode();
if (PreviousMode != KernelMode)
{
/* Enter SEH */
PreviousMode = ExGetPreviousMode();
_SEH2_TRY
{
/* Probe for user mode */
if (PreviousMode != KernelMode)
{
/* Check if we have a timeout */
if (TimeOut)
@ -98,6 +98,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
ProbeForRead(HandleArray,
ObjectCount * sizeof(HANDLE),
sizeof(HANDLE));
}
/*
* Make a copy so we don't have to guard with SEH later and keep
@ -108,20 +109,19 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
HandleArray,
ObjectCount * sizeof(HANDLE));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) //ExSystemExceptionFilter()
{
/* Cover up for kernel mode */
if (PreviousMode == KernelMode)
{
/* But don't fail silently */
DbgPrint("Mon dieu! Covering up for BAD driver passing invalid pointer (0x%p)! Hon hon hon!\n", HandleArray);
}
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
}
else
{
/* This is kernel mode, no need to wrap in SEH */
RtlCopyMemory(Handles,
HandleArray,
ObjectCount * sizeof(HANDLE));
}
/* Check if we can use the internal Wait Array */
if (ObjectCount > THREAD_WAIT_OBJECTS)