Hi,
Iam new to driver development and am just experiencing the excitement. Can someone tell me if this will be sufficient to maintain and service a Custom irp queue, with Insert, Remove and Cleanup routines provided and corresponding StartIo, StartNextPacket routines customized.
typedef void (*IRP_CANCEL_ROUTINE)
(IN PDEVICE_OBJECT pDeviceObject,
IN PIRP pIrp);
typedef void (*IRP_PROCESSING_ROUTINE)
(IN PDEVICE_OBJECT pDeviceObject,
IN PIRP pIrp);
typedef void (*START_NEXT_IRP_ROUTINE)
(IN PIRP_QUEUE pIrpQueue);
typedef struct __IRP_QUEUE_ENTRY
{
PIRP pThisIrp;
PIRP_QUEUE_ENTRY pNextEntry;
} IRP_QUEUE_ENTRY, *PIRP_QUEUE_ENTRY,
typedef struct __IRP_QUEUE
{
PDEVICE_OBJECT pDeviceObject;
KSPIN_LOCK ListLock;
// Linked list
PIRP_QUEUE_ENTRY HeadEntry;
// processing routine
IRP_PROCESSING_ROUTINE ProcessingRoutine;
// cancelling routine
PDRIVER_CANCEL CancelRoutine;
// To start next irp, called by Processing routine
START_NEXT_IRP_ROUTINE StartNextRoutine;
} IRP_QUEUE, *PIRP_QUEUE;
> Seshagiri Babu K V wrote:
Iam new to driver development and am just experiencing the
excitement. Can someone tell me if this will be sufficient to maintain
and service a Custom irp queue, with Insert, Remove and Cleanup
routines provided and corresponding StartIo, StartNextPacket routines
customized.
I strongly recommend not trying to implement your own IRP queuing
routines. This is a problem that has already been solved many times. Try
using the cancel-safe-queue routines in the XP DDK or the DEVQUEUE
package described in my WDM book and included in the sample code (as
modified by the online service packs).
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com
>
I strongly recommend not trying to implement your own IRP queuing
routines. This is a problem that has already been solved many times. Try
using the cancel-safe-queue routines in the XP DDK or the DEVQUEUE
package described in my WDM book and included in the sample code (as
modified by the online service packs).
I’ll second Walter’s advice, from first-hand experience. I needed to
queue some IRPs, but didn’t know about the cancel-safe queues. Wrote
my own, and found that my driver wouldn’t uninstall. Life is too short
to deal with stuff like this, there is always one more special case
you’d
need to deal with.
By the way, Walter… that was the “something wrong” you mentioned.
schedule at http://www.oneysoft.com