Hooking video driver functions / communicating between driver and user mode application

Discussion in 'Windows Vista Drivers' started by spujia, Aug 10, 2008.

  1. spujia

    spujia Guest


    I am using the WDK mirror driver sample as a base. The driver is attached
    to the desktop. My goal is to intercept basic graphics functions through
    the use of the mirror driver and access them in a user-mode application. Is
    there a way to directly hook the GDI functions that are implemented in the
    driver (DrvTextOut , DrvBitBlit, etc) from my user-mode application? I
    have seen a couple examples of other ways to communicate beween driver and
    user-mode apps, one that uses shared memory and one that uses io and is
    implemented as a simple comm driver
    (DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL], etc). I tried to
    splice the comm driver stuff into the video driver, but was unable to do so
    because I could not include miniport.h and Ntddk.h in the same file. OK, I
    quess I have two questions....

    Any help is much appreciated.

    Best regards,

    spujia, Aug 10, 2008
    1. Advertisements

  2. spujia

    Tim Roberts Guest

    "Hook" for what purpose? I don't really think that's what you meant.
    Display drivers use a very different scheme -- they aren't WDM at all. You
    can use the ExtEscape function to send arbitrary requests to the display
    Tim Roberts, Aug 10, 2008
    1. Advertisements

  3. spujia

    allenzhang Guest

    Tim Roberts is correct, display driver isn't WDM, But you can do it by a
    filter driver, of course, It is different beteen display driver fiter and the
    other fitlers.

    I can't sure that it is okay or not in Vista, I have been write a drver to
    direct hook the Drv... Function of the real display driver in several years
    ago, It is working correct in XPDM(only test it in Win2K/WinXP),
    I think you should hook dxg... module in WDDM.

    allenzhang, Aug 11, 2008
  4. spujia

    spujia Guest

    Hi guys,

    Thanks for the responses. Are you implying that I should write my own
    filter driver? More importantly, how did you hook the Drv... functions in
    the real driver? If I could do that, I would not need the mirror driver.
    Please clarify "I think you should hook dxg... module in WDDM".


    spujia, Aug 12, 2008
  5. spujia

    allenzhang Guest

    If you want to communicating between driver only,
    One of the follow method you can select.
    1,You can implement it by ExtEscape in Ring3 and DrvEscape in DDI module.
    2, EngLoadModule,EngLoadModuleForWrite or EngMapFile in DDI module
    call CreateFileMapping,MapViewOfFileEx... in Ring3
    3, Call ZwCreateSection in DDI module, Call
    CreateFileMapping,MapViewOfFileEx... in Ring3.

    I have an mistake about your question, I understand that you want to
    implement it in WDDM and want to use DirectX accelerate when your driver is

    Yes, You don't use mirror if you use display filter driver.

    allenzhang, Oct 18, 2008
    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.