Author: janderwald
Date: Fri Oct 29 00:41:06 2010
New Revision: 49336
URL:
http://svn.reactos.org/svn/reactos?rev=49336&view=rev
Log:
- Fix mdl probe access rights
Modified:
trunk/reactos/drivers/ksfilter/ks/irp.c
Modified: trunk/reactos/drivers/ksfilter/ks/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Fri Oct 29 00:41:06 2010
@@ -724,7 +724,16 @@
Mdl = Irp->MdlAddress;
/* determine operation */
- Operation = (ProbeFlags & KSPROBE_STREAMWRITE) ?
IoWriteAccess : IoReadAccess;
+ if (!(ProbeFlags & KSPROBE_STREAMWRITE) || (ProbeFlags &
KSPROBE_MODIFY))
+ {
+ /* operation is read / modify stream, need write access */
+ Operation = IoWriteAccess;
+ }
+ else
+ {
+ /* operation is write to device, so we need read access */
+ Operation = IoReadAccess;
+ }
do
{
@@ -859,7 +868,8 @@
if (StreamHeader->FrameExtent)
{
/* allocate an mdl */
- Mdl = IoAllocateMdl(StreamHeader->Data,
StreamHeader->FrameExtent, Irp->MdlAddress != NULL, TRUE, Irp);
+ ASSERT(Irp->MdlAddress == NULL);
+ Mdl = IoAllocateMdl(StreamHeader->Data,
StreamHeader->FrameExtent, FALSE, TRUE, Irp);
if (!Mdl)
{
/* not enough memory */
@@ -880,10 +890,10 @@
/* now probe the allocated mdl's */
if (!NT_SUCCESS(Status))
- {
+ {
DPRINT("Status %x\n", Status);
return Status;
- }
+ }
else
goto ProbeMdl;
}