how to Sync Irp->AssociatedIrp.SystemBuffer when Overlapped I/O.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: XP hangs at Mup.sys
    ... Yes I did google for "XP hangs at MUP.Sys" I tried ... another desktop running XP... ... Windows Desktop Experience ... The system hangs at MUP.sys regardless of which option selected... ...
    (microsoft.public.windowsxp.general)
  • Re: FC4, named & system hang
    ... I am experiencing occasional hangs on an FC4 web server that is ... These messages go on for about 15-18 minutes and then the system hangs. ... I believe it's in the Extras repository, and you can configure it to deny access to sshd from any IP address that repeatedly fails logins (brute force attacks). ...
    (Fedora)
  • 6.2-pre: g_vfs_done():ad4s1d[READ(offset=-8573723385966362624, length=16384)]error=5
    ... Then I start mc and go to dir on this hdd - system hangs with subject. ... PS Maybe ali controller doesnt support 320-gb hdd drives or near that and it ...
    (freebsd-stable)
  • Re: The update is a downgrade!
    ... IE hangs. ... Cannot navigate her hard drive from Save As in any Office product or ... during an Insert File operation in Outlook. ... System hangs ...
    (microsoft.public.windowsxp.general)
  • Internet Explorer System HAN when loading too much stuff! Help!
    ... I have been encountering random system hangs when using IE. ... preloads about 200+ referral images, ... tried this on another PC with http connection limit at 1k and it worked ...
    (microsoft.public.windowsxp.help_and_support)