Protect access to the result pointer from KeUserModeCallback with SEH. Fixes a possible kernel mode crash.
svn path=/trunk/; revision=48437
if (NT_SUCCESS(Status))
{
/* Simulate old behaviour: copy into our local buffer */
if (NT_SUCCESS(Status))
{
/* Simulate old behaviour: copy into our local buffer */
- Result = *(LRESULT*)ResultPointer;
+ _SEH2_TRY
+ {
+ ProbeForRead(ResultPointer, sizeof(LRESULT), 1);
+ Result = *(LRESULT*)ResultPointer;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Result = 0;
+ }
+ _SEH2_END