mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:32:57 +00:00
- Wrap MmProbeAndLockPages invocations into SEH.
See issue #2121 for more details. svn path=/trunk/; revision=32054
This commit is contained in:
parent
07c489c7d2
commit
fca1165c23
1 changed files with 44 additions and 9 deletions
|
@ -1554,11 +1554,22 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
|||
IRP_INPUT_OPERATION);
|
||||
}
|
||||
else if (DeviceObject->Flags & DO_DIRECT_IO)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
/* Allocate an MDL */
|
||||
Mdl = IoAllocateMdl(FileInformation, Length, FALSE, TRUE, Irp);
|
||||
MmProbeAndLockPages(Mdl, PreviousMode, IoWriteAccess);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
/* Allocating failed, clean up */
|
||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||
Status = _SEH_GetExceptionCode();
|
||||
_SEH_YIELD(return Status);
|
||||
}
|
||||
_SEH_END;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No allocation flags, and use the buffer directly */
|
||||
|
@ -2118,11 +2129,23 @@ NtReadFile(IN HANDLE FileHandle,
|
|||
{
|
||||
/* Check if we have a buffer length */
|
||||
if (Length)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
/* Allocate an MDL */
|
||||
Mdl = IoAllocateMdl(Buffer, Length, FALSE, TRUE, Irp);
|
||||
MmProbeAndLockPages(Mdl, PreviousMode, IoWriteAccess);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
/* Allocating failed, clean up */
|
||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||
Status = _SEH_GetExceptionCode();
|
||||
_SEH_YIELD(return Status);
|
||||
}
|
||||
_SEH_END;
|
||||
|
||||
}
|
||||
|
||||
/* No allocation flags */
|
||||
Irp->Flags = 0;
|
||||
|
@ -2950,6 +2973,7 @@ NtWriteFile(IN HANDLE FileHandle,
|
|||
/* Allocating failed, clean up */
|
||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||
Status = _SEH_GetExceptionCode();
|
||||
_SEH_YIELD(return Status);
|
||||
}
|
||||
_SEH_END;
|
||||
|
||||
|
@ -2966,11 +2990,22 @@ NtWriteFile(IN HANDLE FileHandle,
|
|||
{
|
||||
/* Check if we have a buffer length */
|
||||
if (Length)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
/* Allocate an MDL */
|
||||
Mdl = IoAllocateMdl(Buffer, Length, FALSE, TRUE, Irp);
|
||||
MmProbeAndLockPages(Mdl, PreviousMode, IoReadAccess);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
/* Allocating failed, clean up */
|
||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||
Status = _SEH_GetExceptionCode();
|
||||
_SEH_YIELD(return Status);
|
||||
}
|
||||
_SEH_END;
|
||||
}
|
||||
|
||||
/* No allocation flags */
|
||||
Irp->Flags = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue