Passing MSVAD buffer to user space

Discussion in 'Windows Vista Drivers' started by liquidl, May 24, 2005.

  1. liquidl

    liquidl Guest

    Hi All,

    I am working with the MSVAD from the Win XP DDK. What I'd like to do
    is to share the buffer "m_pDataBuffer" (non-paged pool) with the
    user-space because I'd like to do some further processing on the
    captured data in user space. I have done some research and there's a
    few ways:

    1) Use DeviceIoControl and use METHOD_IN_DIRECT or METHOD_OUT_DIRECT.
    2) Mapping kernel memory to user memory.
    3) Use Shared Memory Object Method (memory-mapped file backed by the
    paging file)

    In case of MSVAD, I just don't see how I can use method 1 because this
    is a "passive" driver and I see no code to handle IOCTLs.

    Method 2 is ok but you have to call MmMapLockedPagesSpecifyCache() from
    the context of the process that will be using the mapping. I am not
    sure that this will work for MSVAD because the app will be run after
    the driver is loaded and the context will be arbitrary.

    Method 3 is not recommended by MS because "the scope of the address is
    limited to the process in which the object is mapped, and it cannot be
    accessed in a DPC or ISR."
    I am not sure if Method 3 effects the MSVAD driver. Can anyone explain
    how to use this method to give user-space access?

    Does anyone know how else I can map "m_pDataBuffer" to user-space, with
    MSVAD in particular??

    The stuff I have read references real device drivers and things get
    muddy when you are using MSVAD because it is a virtual device driver.
    Any help appreciated.


    liquidl, May 24, 2005
    1. Advertisements

  2. liquidl

    liquidl Guest


    The code for allocation of the buffer is:

    m_pDataBuffer = (PBYTE)

    I'd like to share this memory with the user-space. Can I use a named
    section object created by the driver using zwCreateSection() ? Or is
    there a better way to do this? This particular driver doesn't have an
    IOCTL interface that I know of, no device name, and no read function
    implmentation. As such it is a "passive" sort of driver (from how I
    understand it). What's a way to share memory with a user app with this
    sort of driver??

    Any tips are appreciated.


    liquidl, May 25, 2005
    1. Advertisements

  3. liquidl

    Tulup Guest

    sorry for misunderstanding, but why you simple can't build capture graph
    (user mode), play it and receive this buffer in (user mode) dshow filter ?
    Tulup, May 25, 2005
  4. I'd like to share this memory with the user-space.

    Shared memory is a bad idea due to several reasons (synchronizing access to it
    and security). Why not use some better data transfer mechanism like the IOCTL
    Maxim S. Shatskih, May 25, 2005
  5. liquidl

    liquidl Guest


    Can you expand on this method please? According to my research, MSVAD
    is the way to go in order to capture audio data going out to the sound


    liquidl, May 25, 2005
  6. liquidl

    liquidl Guest


    This is a WDM miniport driver inside an adapter driver. As such, it
    has no IOCTL handling code nor direct read method implementation. I
    only wish it were a "normal" driver so I could apply the IOCTL flow


    liquidl, May 25, 2005
  7. liquidl

    Tulup Guest

    Look. I can fill m_pDataBuffer with silence in CopyTo method call, create
    user mode graph with msvad capture filter play it and hear silence. Isn't it
    sharing m_pDataBuffer with user mode ?
    Tulup, May 30, 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.