how to Sync Irp->AssociatedIrp.SystemBuffer when Overlapped I/O.
- From: "Vijay" <vikramuv@xxxxxxxxxxxxxxx>
- Date: Tue, 5 Apr 2005 07:53:04 -0700
Hi all
i am using buffered i/o method in my driver.
i am trying with overlapped i/o in the application. system hangs when i try
to fill
256 bytes of data into system buffer it hangs. i know its limit is 4K.
if i try to write less number of bytes into Irp->AssociatedIrp.SystemBuffer
may be 128 bytes it doesn't hang..
here is my code..
in dispatchIoControl i call mark the Irp as pending.
IoMarkIrpPending(Irp); //mark the Irp a pending, so that it will put in queue
IoStartPacket(fdo,Irp,0,PCIeCancelIrp); //Irp will queued to device queue
for serialization
return STATUS_PENDING; // since Irp is queued status must be pending
In startIO code
PCIeStartIo(IN PDEVICE_OBJECT fdo, IN PIRP Irp)
{
PDEVICE_EXTENSION dx = (PPCIE_DEVICE_EXTENSION) fdo->DeviceExtension;
PIO_STACK_LOCATION IrpStack = IoGetCurrentIrpStackLocation(Irp);
switch (IrpStack->MajorFunction)
{
case IRP_MJ_DEVICE_CONTROL:
ULONG ControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode;
switch (ControlCode)
{
case IOCTL_DUMMY:
{
ULONG InputBufLen = IrpStack->Parameters.DeviceIoControl.InputBufferLength;
PVOID buf = (PVOID)Irp->AssociatedIrp.SystemBuffer ;
for(i=0;i<inputBufLen;i++)
*((PUCHAR)buf+i)=i;
break;
}
}
break;
}
KIRQL OldIrql;
status = STATUS_SUCCESS
IoAcquireCancelSpinLock(&OldIrql);
IoSetCancelRoutine(Irp,NULL);
IoReleaseCancelSpinLock(OldIrql);
UnlockDevice(dx);
CompleteIrp(Irp,status,Info);
IoStartNextPacket(fdo,true);
}
Any idea Overlapped is appreciated.
Thanks,
--
Vijay
PIC ,Bangalore
.
- Follow-Ups:
- Re: how to Sync Irp->AssociatedIrp.SystemBuffer when Overlapped I/O.
- From: Calvin Guan
- Re: how to Sync Irp->AssociatedIrp.SystemBuffer when Overlapped I/O.
- Prev by Date: Re: sync/async NdisTransferData()
- Next by Date: Re: sync/async NdisTransferData()
- Previous by thread: 25 microseconds?
- Next by thread: Re: how to Sync Irp->AssociatedIrp.SystemBuffer when Overlapped I/O.
- Index(es):
Relevant Pages
|