Problem in uninstallation of multifunction device

Hi All,

I am developing a driver for a PCI multifunction
device (Test card)in Windows 2003.

I am having a problem while uninstalling the device.

When I am trying to uninstall the driver from the
device manager,
My driver receives the MN_REMOVE IRP. I am doing all
clean up there as follows. Please see the snap shot of
the code.

In the remove routine, I am doing the flowing
operation
1.Waiting for the pending IRPs to be completed by
calling KeWaitForSingleObject
2.Disable the device & Freed up the resources
3.Delete the device object using IoDeleteDevice
4.Then passing the IRP down
IoSkipCurrentIrpStackLocation (Irp);
decrement_irp_count (Device_object);
Irp->IoStatus.Status = STATUS_SUCCESS;
status = IoCallDriver (dev_extension->below_us, Irp);

But the system hung, once I come out from the remove
routine.

Is there any thing else I have to do while processing
the remove IRP for multifunction device.

Can any body tell me how I can resolve this problem,

Thanks,
Sundar


Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover