mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTOS] Fix kmtest
svn path=/trunk/; revision=69399
This commit is contained in:
parent
3ee5af9d50
commit
f543c860f7
1 changed files with 24 additions and 24 deletions
|
@ -79,12 +79,12 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
|
||||||
return STATUS_INVALID_PARAMETER_3;
|
return STATUS_INVALID_PARAMETER_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enter SEH for user mode */
|
/* Enter SEH */
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
if (PreviousMode != KernelMode)
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* Enter SEH */
|
/* Probe for user mode */
|
||||||
_SEH2_TRY
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
/* Check if we have a timeout */
|
/* Check if we have a timeout */
|
||||||
if (TimeOut)
|
if (TimeOut)
|
||||||
|
@ -94,34 +94,34 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
|
||||||
TimeOut = &SafeTimeOut;
|
TimeOut = &SafeTimeOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Probe all the handles */
|
/* Probe all the handles */
|
||||||
ProbeForRead(HandleArray,
|
ProbeForRead(HandleArray,
|
||||||
ObjectCount * sizeof(HANDLE),
|
ObjectCount * sizeof(HANDLE),
|
||||||
sizeof(HANDLE));
|
sizeof(HANDLE));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make a copy so we don't have to guard with SEH later and keep
|
* Make a copy so we don't have to guard with SEH later and keep
|
||||||
* track of what objects we referenced if dereferencing pointers
|
* track of what objects we referenced if dereferencing pointers
|
||||||
* suddenly fails
|
* suddenly fails
|
||||||
*/
|
*/
|
||||||
RtlCopyMemory(Handles,
|
|
||||||
HandleArray,
|
|
||||||
ObjectCount * sizeof(HANDLE));
|
|
||||||
}
|
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
|
||||||
{
|
|
||||||
/* Return the exception code */
|
|
||||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
|
||||||
}
|
|
||||||
_SEH2_END;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* This is kernel mode, no need to wrap in SEH */
|
|
||||||
RtlCopyMemory(Handles,
|
RtlCopyMemory(Handles,
|
||||||
HandleArray,
|
HandleArray,
|
||||||
ObjectCount * sizeof(HANDLE));
|
ObjectCount * sizeof(HANDLE));
|
||||||
}
|
}
|
||||||
|
_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;
|
||||||
|
|
||||||
/* Check if we can use the internal Wait Array */
|
/* Check if we can use the internal Wait Array */
|
||||||
if (ObjectCount > THREAD_WAIT_OBJECTS)
|
if (ObjectCount > THREAD_WAIT_OBJECTS)
|
||||||
|
|
Loading…
Reference in a new issue