mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #666: Added Try+Except block for ProbeForRead
This commit is contained in:
commit
2c9093b8eb
@ -634,18 +634,25 @@ NTSTATUS NeoNdisDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp)
|
||||
{
|
||||
MmProbeAndLockPages(mdl, KernelMode, IoReadAccess);
|
||||
}
|
||||
|
||||
ProbeForRead(buf, NEO_EXCHANGE_BUFFER_SIZE, 1);
|
||||
|
||||
// Write
|
||||
NeoWrite(buf);
|
||||
Irp->IoStatus.Information = stack->Parameters.Write.Length;
|
||||
ok = true;
|
||||
|
||||
if (mdl != NULL)
|
||||
__try
|
||||
{
|
||||
ProbeForRead(buf, NEO_EXCHANGE_BUFFER_SIZE, 1);
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
check_ok = false;
|
||||
}
|
||||
if (check_ok) {
|
||||
// Write
|
||||
NeoWrite(buf);
|
||||
Irp->IoStatus.Information = stack->Parameters.Write.Length;
|
||||
ok = true;
|
||||
|
||||
if (mdl != NULL)
|
||||
{
|
||||
MmUnlockPages(mdl);
|
||||
IoFreeMdl(mdl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user