mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:23:01 +00:00
[AFD]
- Only access stack parameters when we're sure that the major function is correct svn path=/trunk/; revision=57173
This commit is contained in:
parent
ee2934ab01
commit
18c4b99d08
1 changed files with 23 additions and 8 deletions
|
@ -1046,23 +1046,38 @@ CleanupPendingIrp(PAFD_FCB FCB, PIRP Irp, PIO_STACK_LOCATION IrpSp, PAFD_ACTIVE_
|
||||||
PAFD_SEND_INFO SendReq;
|
PAFD_SEND_INFO SendReq;
|
||||||
PAFD_POLL_INFO PollReq;
|
PAFD_POLL_INFO PollReq;
|
||||||
|
|
||||||
if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_RECV ||
|
if (IrpSp->MajorFunction == IRP_MJ_READ)
|
||||||
IrpSp->MajorFunction == IRP_MJ_READ)
|
|
||||||
{
|
{
|
||||||
RecvReq = GetLockedData(Irp, IrpSp);
|
RecvReq = GetLockedData(Irp, IrpSp);
|
||||||
UnlockBuffers(RecvReq->BufferArray, RecvReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
UnlockBuffers(RecvReq->BufferArray, RecvReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
||||||
}
|
}
|
||||||
else if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_SEND ||
|
else if (IrpSp->MajorFunction == IRP_MJ_WRITE)
|
||||||
IrpSp->MajorFunction == IRP_MJ_WRITE)
|
|
||||||
{
|
{
|
||||||
SendReq = GetLockedData(Irp, IrpSp);
|
SendReq = GetLockedData(Irp, IrpSp);
|
||||||
UnlockBuffers(SendReq->BufferArray, SendReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
UnlockBuffers(SendReq->BufferArray, SendReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
||||||
}
|
}
|
||||||
else if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_SELECT)
|
else
|
||||||
{
|
{
|
||||||
PollReq = Irp->AssociatedIrp.SystemBuffer;
|
ASSERT(IrpSp->MajorFunction == IRP_MJ_DEVICE_CONTROL);
|
||||||
ZeroEvents(PollReq->Handles, PollReq->HandleCount);
|
|
||||||
SignalSocket(Poll, NULL, PollReq, STATUS_CANCELLED);
|
if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_RECV)
|
||||||
|
{
|
||||||
|
RecvReq = GetLockedData(Irp, IrpSp);
|
||||||
|
UnlockBuffers(RecvReq->BufferArray, RecvReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
||||||
|
}
|
||||||
|
else if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_SEND)
|
||||||
|
{
|
||||||
|
SendReq = GetLockedData(Irp, IrpSp);
|
||||||
|
UnlockBuffers(SendReq->BufferArray, SendReq->BufferCount, CheckUnlockExtraBuffers(FCB, IrpSp));
|
||||||
|
}
|
||||||
|
else if (IrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_AFD_SELECT)
|
||||||
|
{
|
||||||
|
ASSERT(Poll);
|
||||||
|
|
||||||
|
PollReq = Irp->AssociatedIrp.SystemBuffer;
|
||||||
|
ZeroEvents(PollReq->Handles, PollReq->HandleCount);
|
||||||
|
SignalSocket(Poll, NULL, PollReq, STATUS_CANCELLED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue