Hello,
I develop usb driver. My problem appears when I try to reinstall the driver. The system falls when I start the device again in IRP_MN_START_DEVICE plug and play dispatch routine, just when I call IoCallDriver to pass the IRP down the stack.
Reinstalation is unsuccesfull only when I open handle to the device (IRP_MJ_CREATE is called) before reinstallation.
Possibly I don’t cancel my usb interrupt irp properly???
How do I handle interrupt IRP:
-
I allocate resources for this IRP in IRP_MN_START_DEVICE routine.
-
I start sending Irp to the device repeatly when IRP_MJ_CREATE is called (user opens handle to the device)
-
I stop sending Irp (cancel the Irp) when IRP_MJ_CLOSE
-
I deallocate resources for the IRP in IRP_MN_STOP_DEVICE routine. Might this is the problem. Do I have to deallocate resources in IRP_MJ_REMOVE routine insted of IRP_MN_STOP_DEVICE?
Thanks for reply.
Jan