NdisSend() pesudocode

Discussion in 'Windows Vista Drivers' started by Tierrie, Sep 21, 2005.

  1. Tierrie

    Tierrie Guest

    Now I have crafted a nice little pMyPacket and I sent it out but its
    causing an error in ProtocolSendComplete handler (in passthru it is
    causing an error at ADAPT_DECR_PENDING_SENDS(pAdapt); )

    So I'd like to make sure I properly understand the way NdisSend works
    especially with regards to make a whole new packet. These are the steps
    I took, taking care to check for Status errors where possible.

    NdisAllocatePacket(); // off the SendPacketPoolHandle

    NdisAllocateMemory( pVirtualMemory );
    Turn that block of Virtual Memory into a packet structure (in my base,
    eth:tcp:icmp:data for ping)
    NdisAllocateBuffer(); // off a BufferPoolHandle pointing at the VM

    It appears to have sent alright since its calling ProtocolSendComplete.
    Bugcheck confirms that the line in the code that has an error
    correspond to a line in ProtocolSendComplete.

    Help help!
    Tierrie, Sep 21, 2005
    1. Advertisements

  2. Tierrie

    Tierrie Guest

    Further debugging showed me that the BugCheck is 0xd1 which is
    DRIVER_IRQL_IS_NOT_LESS_OR_EQUAL which I'm taking to mean that I'm
    calling a function at a wrong IRQL. Since the overall packet creation
    and packet send is taking place in ProtocolReceivePacket I am running
    in DISPATCH_LEVEL. NdisSend should be run at <= DISPATCH_LEVEL so I
    should be able to do this.
    Tierrie, Sep 21, 2005
    1. Advertisements

  3. Tierrie

    Don Burn Guest

    This can be calling at wrong IRQL, bad pointer, referencing pageable memory,
    etc. DRIVER_IRQL_IS_NOT_LESS_OR_EQUAL is basically "you did something
    wrong" now debug it. This is not a complaint on Microsoft, but just the
    fact that a lot of things fall into this bugcheck by their nature.
    Don Burn, Sep 21, 2005
    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.