Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

47 views
Skip to first unread message

spujia

unread,
Aug 10, 2008, 5:02:28 AM8/10/08
to
Hello,

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,

Steve

Tim Roberts

unread,
Aug 10, 2008, 6:27:06 PM8/10/08
to
"spujia" <steve...@oculislabs.com> wrote:
>
>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?

"Hook" for what purpose? I don't really think that's what you meant.

>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....

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
driver.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

allenzhang

unread,
Aug 10, 2008, 9:06:01 PM8/10/08
to
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.

B.R.
AllenZhang

spujia

unread,
Aug 12, 2008, 12:55:14 AM8/12/08
to
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".

Thanks!

"allenzhang" <allen...@discussions.microsoft.com> wrote in message
news:C655AD6A-C147-4640...@microsoft.com...

allenzhang

unread,
Oct 18, 2008, 3:03:01 AM10/18/08
to
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
actived.

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

0 new messages