mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 14:48:37 +00:00
- Check for the current irql, if there is a call to IoStartNextPacket.
If it is necessary, raise the irql to DISPATCH_LEVEL. svn path=/trunk/; revision=6487
This commit is contained in:
parent
7e110a9faa
commit
49a370ce14
|
@ -708,10 +708,21 @@ VOID STDCALL KbdStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
|
|
||||||
if (KeSynchronizeExecution(KbdInterrupt, KbdSynchronizeRoutine, Irp))
|
if (KeSynchronizeExecution(KbdInterrupt, KbdSynchronizeRoutine, Irp))
|
||||||
{
|
{
|
||||||
|
KIRQL oldIrql;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
IoStartNextPacket(DeviceObject, FALSE);
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("stk->Parameters.Read.Length %d\n",stk->Parameters.Read.Length);
|
DPRINT("stk->Parameters.Read.Length %d\n",stk->Parameters.Read.Length);
|
||||||
|
|
|
@ -248,6 +248,7 @@ VOID MouseClassStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
|
|
||||||
if(DeviceExtension->InputCount>0)
|
if(DeviceExtension->InputCount>0)
|
||||||
{
|
{
|
||||||
|
KIRQL oldIrql;
|
||||||
// FIXME: We should not send too much input data.. depends on the max buffer size of the win32k
|
// FIXME: We should not send too much input data.. depends on the max buffer size of the win32k
|
||||||
ReadSize = DeviceExtension->InputCount * sizeof(MOUSE_INPUT_DATA);
|
ReadSize = DeviceExtension->InputCount * sizeof(MOUSE_INPUT_DATA);
|
||||||
|
|
||||||
|
@ -263,9 +264,18 @@ VOID MouseClassStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
|
|
||||||
Irp->IoStatus.Information = ReadSize;
|
Irp->IoStatus.Information = ReadSize;
|
||||||
Stack->Parameters.Read.Length = ReadSize;
|
Stack->Parameters.Read.Length = ReadSize;
|
||||||
|
|
||||||
IoStartNextPacket(DeviceObject, FALSE);
|
|
||||||
IoCompleteRequest(Irp, IO_MOUSE_INCREMENT);
|
IoCompleteRequest(Irp, IO_MOUSE_INCREMENT);
|
||||||
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DeviceExtension->ReadIsPending = TRUE;
|
DeviceExtension->ReadIsPending = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,21 @@ PS2MouseStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
|
|
||||||
if (KeSynchronizeExecution(DeviceExtension->MouseInterrupt, MouseSynchronizeRoutine, Irp))
|
if (KeSynchronizeExecution(DeviceExtension->MouseInterrupt, MouseSynchronizeRoutine, Irp))
|
||||||
{
|
{
|
||||||
|
KIRQL oldIrql;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
IoStartNextPacket(DeviceObject, FALSE);
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,10 +254,21 @@ SerialMouseStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
|
|
||||||
if (KeSynchronizeExecution(DeviceExtension->MouseInterrupt, MouseSynchronizeRoutine, Irp))
|
if (KeSynchronizeExecution(DeviceExtension->MouseInterrupt, MouseSynchronizeRoutine, Irp))
|
||||||
{
|
{
|
||||||
|
KIRQL oldIrql;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
IoStartNextPacket(DeviceObject, FALSE);
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class2.c,v 1.41 2003/10/15 22:16:44 vizzini Exp $
|
/* $Id: class2.c,v 1.42 2003/11/01 10:42:32 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1269,8 +1269,18 @@ ScsiClassIoComplete(IN PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
if (IrpStack->MajorFunction != IRP_MJ_DEVICE_CONTROL)
|
if (IrpStack->MajorFunction != IRP_MJ_DEVICE_CONTROL)
|
||||||
{
|
{
|
||||||
IoStartNextPacket(DeviceObject,
|
KIRQL oldIrql;
|
||||||
FALSE);
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1372,8 +1382,18 @@ ScsiClassIoCompleteAssociated(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
if (DeviceExtension->ClassStartIo)
|
if (DeviceExtension->ClassStartIo)
|
||||||
{
|
{
|
||||||
IoStartNextPacket(DeviceObject,
|
KIRQL oldIrql;
|
||||||
FALSE);
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: scsiport.c,v 1.42 2003/10/19 10:43:10 robd Exp $
|
/* $Id: scsiport.c,v 1.43 2003/11/01 10:42:32 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1553,6 +1553,8 @@ ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
DPRINT("DeviceExtension %p\n", DeviceExtension);
|
DPRINT("DeviceExtension %p\n", DeviceExtension);
|
||||||
|
|
||||||
|
oldIrql = KeGetCurrentIrql();
|
||||||
|
|
||||||
if (IrpStack->MajorFunction != IRP_MJ_SCSI)
|
if (IrpStack->MajorFunction != IRP_MJ_SCSI)
|
||||||
{
|
{
|
||||||
DPRINT("No IRP_MJ_SCSI!\n");
|
DPRINT("No IRP_MJ_SCSI!\n");
|
||||||
|
@ -1560,8 +1562,19 @@ ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest (Irp,
|
IoCompleteRequest (Irp,
|
||||||
IO_NO_INCREMENT);
|
IO_NO_INCREMENT);
|
||||||
IoStartNextPacket (DeviceObject,
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
FALSE);
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL,
|
||||||
|
&oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1578,8 +1591,19 @@ ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest (Irp,
|
IoCompleteRequest (Irp,
|
||||||
IO_NO_INCREMENT);
|
IO_NO_INCREMENT);
|
||||||
IoStartNextPacket (DeviceObject,
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
FALSE);
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL,
|
||||||
|
&oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,8 +1643,19 @@ ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(Irp,
|
IoCompleteRequest(Irp,
|
||||||
IO_NO_INCREMENT);
|
IO_NO_INCREMENT);
|
||||||
IoStartNextPacket(DeviceObject,
|
if (oldIrql < DISPATCH_LEVEL)
|
||||||
FALSE);
|
{
|
||||||
|
KeRaiseIrql (DISPATCH_LEVEL,
|
||||||
|
&oldIrql);
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStartNextPacket (DeviceObject,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KeAcquireSpinLock(&DeviceExtension->IrpLock, &oldIrql);
|
KeAcquireSpinLock(&DeviceExtension->IrpLock, &oldIrql);
|
||||||
|
@ -1634,9 +1669,10 @@ ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
if (DeviceExtension->IrpFlags & IRP_FLAG_NEXT)
|
if (DeviceExtension->IrpFlags & IRP_FLAG_NEXT)
|
||||||
{
|
{
|
||||||
DeviceExtension->IrpFlags &= ~IRP_FLAG_NEXT;
|
DeviceExtension->IrpFlags &= ~IRP_FLAG_NEXT;
|
||||||
KeReleaseSpinLock(&DeviceExtension->IrpLock, oldIrql);
|
KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock);
|
||||||
IoStartNextPacket(DeviceObject,
|
IoStartNextPacket(DeviceObject,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
KeLowerIrql(oldIrql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2015,14 +2051,13 @@ ScsiPortDpcForIsr(IN PKDPC Dpc,
|
||||||
PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
|
PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
PIO_STACK_LOCATION IrpStack;
|
PIO_STACK_LOCATION IrpStack;
|
||||||
PSCSI_REQUEST_BLOCK Srb;
|
PSCSI_REQUEST_BLOCK Srb;
|
||||||
KIRQL oldIrql;
|
|
||||||
|
|
||||||
DPRINT("ScsiPortDpcForIsr(Dpc %p DpcDeviceObject %p DpcIrp %p DpcContext %p)\n",
|
DPRINT("ScsiPortDpcForIsr(Dpc %p DpcDeviceObject %p DpcIrp %p DpcContext %p)\n",
|
||||||
Dpc, DpcDeviceObject, DpcIrp, DpcContext);
|
Dpc, DpcDeviceObject, DpcIrp, DpcContext);
|
||||||
|
|
||||||
DeviceExtension = (PSCSI_PORT_DEVICE_EXTENSION)DpcContext;
|
DeviceExtension = (PSCSI_PORT_DEVICE_EXTENSION)DpcContext;
|
||||||
|
|
||||||
KeAcquireSpinLock(&DeviceExtension->IrpLock, &oldIrql);
|
KeAcquireSpinLockAtDpcLevel(&DeviceExtension->IrpLock);
|
||||||
if (DeviceExtension->IrpFlags)
|
if (DeviceExtension->IrpFlags)
|
||||||
{
|
{
|
||||||
IrpStack = IoGetCurrentIrpStackLocation(DeviceExtension->CurrentIrp);
|
IrpStack = IoGetCurrentIrpStackLocation(DeviceExtension->CurrentIrp);
|
||||||
|
@ -2068,7 +2103,7 @@ ScsiPortDpcForIsr(IN PKDPC Dpc,
|
||||||
DeviceExtension->OriginalSrb = Srb;
|
DeviceExtension->OriginalSrb = Srb;
|
||||||
IrpStack->Parameters.Scsi.Srb = ScsiPortInitSenseRequestSrb(DeviceExtension,
|
IrpStack->Parameters.Scsi.Srb = ScsiPortInitSenseRequestSrb(DeviceExtension,
|
||||||
Srb);
|
Srb);
|
||||||
KeReleaseSpinLock(&DeviceExtension->IrpLock, oldIrql);
|
KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock);
|
||||||
if (!KeSynchronizeExecution(DeviceExtension->Interrupt,
|
if (!KeSynchronizeExecution(DeviceExtension->Interrupt,
|
||||||
ScsiPortStartPacket,
|
ScsiPortStartPacket,
|
||||||
DeviceExtension))
|
DeviceExtension))
|
||||||
|
@ -2100,17 +2135,17 @@ ScsiPortDpcForIsr(IN PKDPC Dpc,
|
||||||
if (DeviceExtension->IrpFlags & IRP_FLAG_NEXT)
|
if (DeviceExtension->IrpFlags & IRP_FLAG_NEXT)
|
||||||
{
|
{
|
||||||
DeviceExtension->IrpFlags &= ~IRP_FLAG_NEXT;
|
DeviceExtension->IrpFlags &= ~IRP_FLAG_NEXT;
|
||||||
KeReleaseSpinLock(&DeviceExtension->IrpLock, oldIrql);
|
KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock);
|
||||||
IoStartNextPacket(DpcDeviceObject, FALSE);
|
IoStartNextPacket(DpcDeviceObject, FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&DeviceExtension->IrpLock, oldIrql);
|
KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&DeviceExtension->IrpLock, oldIrql);
|
KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("ScsiPortDpcForIsr() done\n");
|
DPRINT("ScsiPortDpcForIsr() done\n");
|
||||||
|
|
Loading…
Reference in a new issue