To lock, or not to lock, pages...

Discussion in 'Windows Vista Drivers' started by Ed Averill, Sep 1, 2005.

  1. Ed Averill

    Ed Averill Guest

    Ok, I inherited a basic Windows USB driver that handles pushing data across a
    couple of bulk pipes. This driver works fine under Win2K, but eventually
    crashes XP/SP2 with a page fault error...

    Now, this driver takes a large user buffer and chops it up into nice
    USB-able sized blocks. It allocates a MDL and then re-uses it over and over
    again, freeing it once the entire transfer has been shoved across the bulk
    pipe. Never does it try to MmProbeAndLockPages(), which I found odd.. but it
    works under Win2K..

    So my question is: should I put in MmProbeAndLockPages() for the user
    buffer? And if so, before or after IoBuildPartialMdl() (I think before since
    the user buffer needs to be resident, right)?

    I'm somewhat clueless, so apologies if this is a dim question. I'm reading
    all the docs I can get my hands on!
     
    Ed Averill, Sep 1, 2005
    #1
    1. Advertisements

  2. So my question is: should I put in MmProbeAndLockPages() for the user
    They are mutually exclusive.

    MmProbeAndLockPages means - MDL is based on pageable buffer. IoBuildPartialMdl
    means - MDL is based on another MDL.

    Sorry, these things are mutually exclusive. The third variant is MDL based on
    nonpaged buffer - MmBuildMdlForNonPagedPool. Note that this also works for
    memory-mapped devices like video framebuffers.
     
    Maxim S. Shatskih, Sep 1, 2005
    #2
    1. Advertisements

  3. you might be running out of PTEs. look at MmPrepareMdlForReuse and see if
    that applies. the bulkusb sample demonstrates how to use it.

    d
     
    Doron Holan [MS], Sep 2, 2005
    #3
  4. Edward!!!! How the heck are ya!! We are in Minnesota now, where are you?

    Gary

     
    Gary G. Little, Sep 2, 2005
    #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.