Necessary to pend IRP_MN_QUERY_CAPABILITIES?

Discussion in 'Windows Vista Drivers' started by BubbaGump, Nov 16, 2006.

  1. BubbaGump

    BubbaGump Guest

    IRP_MN_QUERY_CAPABILITIES is documented as being sent in an "arbitrary
    thread context", and I thought the rule was never to block in an
    arbitrary thread context, but the DDK toaster bus sample looks like it
    does a KeWaitForSingleObject in its handler for the IRP. Did I
    misunderstand the rule?
     
    BubbaGump, Nov 16, 2006
    #1
    1. Advertisements

  2. BubbaGump

    soviet_bloke Guest

    The term "arbitrary thread context" means that some particular event
    may be processed in context of any thread, i.e. context is not
    pre-defined. For some certain events context is pre-defined, and for
    some it is not. For example, DriverEntry() always gets called in
    context of the system thread, and interrupt may get processed in
    context of any thread.
    The same story with IRPs - for some certain events context is
    pre-defined (for example, IRP_MJ_CREATE always gets sent in context of
    the thread that calls CreateFile()), and for some it is not. Therefore,
    the only thing MSDN says is that IRP_MN_QUERY_CAPABILITIES may get sent
    in context of any thread. It has nothing to do with waiting - the
    possibility of waiting is defined by IRQL, rather than thread context


    Anton Bassov
     
    soviet_bloke, Nov 17, 2006
    #2
    1. Advertisements

  3. BubbaGump

    BubbaGump Guest

    I thought thread context was related to waiting but differently from
    the way IRQL is. I thought thread context was concerned with
    politeness, while IRQL was concerned with stability. Isn't waiting in
    a thread context unrelated to what the driver is currently doing
    impolite because it will steal that other thread's CPU time? (while
    waiting at an IRQL that is too high could cause some sort of deadlock)
     
    BubbaGump, Nov 21, 2006
    #3
  4. BubbaGump

    BubbaGump Guest

    By the way, I'm taking this conclusion partly from the "Passive in
    arbitrary context?" thread from a while ago. I am curious to know
    whether this is valid and how much it applies to
    IRP_MN_QUERY_CAPABILITIES.
     
    BubbaGump, Nov 22, 2006
    #4
    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.