Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Hooking video driver functions / communicating between driver and user mode application

Reply
Thread Tools Display Modes

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

 
 
spujia
Guest
Posts: n/a

 
      08-10-2008
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

 
Reply With Quote
 
 
 
 
Tim Roberts
Guest
Posts: n/a

 
      08-10-2008
"spujia" <> 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,
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
allenzhang
Guest
Posts: n/a

 
      08-11-2008
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" wrote:

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

 
Reply With Quote
 
spujia
Guest
Posts: n/a

 
      08-12-2008
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" <> wrote in message
news:C655AD6A-C147-4640-8A90-...
> 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" wrote:
>
>> 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
>>
>>


 
Reply With Quote
 
allenzhang
Guest
Posts: n/a

 
      10-18-2008
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.


"spujia" wrote:

> 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" <> wrote in message
> news:C655AD6A-C147-4640-8A90-...
> > 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" wrote:
> >
> >> 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
> >>
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mirror Driver - how can I use Driver with User-Mode Application Attributesoft@gmail.com Windows Vista Drivers 39 06-13-2007 08:03 PM
Handle user logoff in user mode driver and application? zxli Windows Vista Drivers 2 01-19-2007 01:34 AM
Interaction between Kernel Mode driver and user mode application ajay.sonawane@gmail.com Windows Vista Drivers 5 08-25-2006 07:40 AM
User Mode Printer Driver using GDI API functions Zhivko Tabakov Windows Vista Drivers 5 11-09-2005 06:23 AM
Re: How detect USER Mode Application is loaded in kernel mode driver William Ingle Windows Vista Drivers 5 07-02-2003 01:14 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59