Verifier Bugcheck 0xC9: "The driver attempted to free an IRP thatis still associated with a thread."

Discussion in 'Windows Vista Drivers' started by h.wulff, Apr 29, 2007.

  1. h.wulff

    h.wulff Guest

    Hi!

    If I call IoFreeIrp() with Driver Verifier enabled, I get "The driver
    attempted to free an IRP that is still associated with a thread." This
    happens in a recover from error situation (after
    TdiBuildInternalDeviceControlIrp() but before TdiBuildReceive() ) but
    outside a finally block.

    Can I just remove the thread from the IRPs linked list or is there more
    to do? (Call special function for example)

    Thanks for you help.
     
    h.wulff, Apr 29, 2007
    #1
    1. Advertisements

  2. TdiBuildInternalDeviceControlIrp really creates a "threaded" IRP, this is a
    long ago-known issue with this function. And then, as usually, IoFreeIrp on a
    "threaded" IRP is a crash.

    Look at it (it is a macro), and write your own based on IoAllocateIrp. This
    works very fine (pre-Vista at least). I once wrote a kernel sockets library
    based on this approach.
     
    Maxim S. Shatskih, Apr 29, 2007
    #2
    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.