Cancel-safe queue: KeWaitForSingleObject in thread func cauing crash

Discussion in 'Windows Vista Drivers' started by Tareq, Jul 4, 2004.

  1. Tareq

    Tareq Guest

    Hi all,
    I'm trying to implement cancel-safe irp queueing in my lower filter
    driver and i'm following the cancel example of the DDK\src\general
    directory. Now, in my kernel thread function, KeWaitForSingleObject
    causes the system to crash. but the original cancel example runs
    smoothly. I understand that the cancel example is just a skeleton driver
    and my filter driver has other drivers in the device stack. do i need to
    add any other stuff here to get cancel-safe queuing work? thanks. in

    KeWaitForSingleObject(&devExt->IrpQueueSemaphore, Executive, KernelMode,

    Note: IrpQueueSemaphore is initialized in the AddDevice routine.
    Tareq, Jul 4, 2004
    1. Advertisements

  2. Why ever use the semaphore for this? At least this will make your driver
    uncallable on DISPATCH_LEVEL.

    You can use the well-known logic which is described in Walter Oney's book
    (and possibly discovered by him).
    Maxim S. Shatskih, Jul 4, 2004
    1. Advertisements

  3. please consider using the IO safe queues (iocsq) provided in the DDK. It
    implements a skeleton for cancel safe queues correctly so you don't have to
    worry about it.

    Doron Holan [MS], Jul 5, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.