Register a function with another driver

Hi,
U can create a intermidiate Kernel mode dll and register the functions in that dll. Then write appropriate wrapper functions for each driver in DLL.
Then link both drivers to the same dll and call exported functions

The other way is register the function poiters of Driver A in Driver B with some pre defined IRP. then call the driver with IoCallDriver
U can get the device object by using symbolic link.
Use the reference from NT device drivers from Viscarola and Mason
Regards
Shekhar
---------- Original Message ----------------------------------
From: Li Dong
Reply-To: “Windows System Software Developers Interest List”
Date: Mon, 28 Jul 2003 16:14:02 +0800

>Hi all,
>
>I am busy with two drivers and want these two drivers call talk to each other.
>
>Say, We got A and B two drivers, and there is a function Bfun( ) in driver B. Is it possible to register Bfun() function dynamically with Driver A. Driver A, therefore, can call Bfun() when needed.
>
>Can I just simply use IoCallDriver() to send an IRP, in which contains a pointer to Bfun( ). If this way works, how can get DeviceObject, which is required as first parameter by IoCallDriver().
>
>Thanks and regards
>Elton
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@oas.co.in
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Use IRP_MN_QUERY_INTERFACE IRP, which will allow you to return the method table for a given GUID.

Max

----- Original Message -----
From: Li Dong
To: Windows System Software Developers Interest List
Sent: Monday, July 28, 2003 12:14 PM
Subject: [ntdev] Register a function with another driver

Hi all,

I am busy with two drivers and want these two drivers call talk to each other.

Say, We got A and B two drivers, and there is a function Bfun( ) in driver B. Is it possible to register Bfun() function dynamically with Driver A. Driver A, therefore, can call Bfun() when needed.

Can I just simply use IoCallDriver() to send an IRP, in which contains a pointer to Bfun( ). If this way works, how can get DeviceObject, which is required as first parameter by IoCallDriver().

Thanks and regards
Elton


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

than you, Shekhar, Max. I got so many answers.

Sorry for my question. Actually, I got peter’s book for long. I however
didn’t read it at all. If it not Shekhar’s remind, I even forgot this book.

Now, I solve this problem like this.

  1. export a function NotifierRegister() in driver A.
  2. In driver B, just call this register function, whenever you want to
    register a function with Driver A.
  3. In NotifierRegister() function, just keep the pointer to function for
    furture use in Driver A.

Hope it helps other people, who may have the same problem.

Thanks and regards
Elton

----- Original Message -----
From: “shekhar divekar”
To: “Windows System Software Developers Interest List”
Sent: Monday, July 28, 2003 5:05 PM
Subject: [ntdev] Re: Register a function with another driver

> Hi,
> U can create a intermidiate Kernel mode dll and register the functions in
that dll. Then write appropriate wrapper functions for each driver in DLL.
> Then link both drivers to the same dll and call exported functions
>
> The other way is register the function poiters of Driver A in Driver B
with some pre defined IRP. then call the driver with IoCallDriver
> U can get the device object by using symbolic link.
> Use the reference from NT device drivers from Viscarola and Mason
> Regards
> Shekhar
> ---------- Original Message ----------------------------------
> From: Li Dong
> Reply-To: “Windows System Software Developers Interest List”

> Date: Mon, 28 Jul 2003 16:14:02 +0800
>
> >Hi all,
> >
> >I am busy with two drivers and want these two drivers call talk to each
other.
> >
> >Say, We got A and B two drivers, and there is a function Bfun( ) in
driver B. Is it possible to register Bfun() function dynamically with Driver
A. Driver A, therefore, can call Bfun() when needed.
> >
> >Can I just simply use IoCallDriver() to send an IRP, in which contains a
pointer to Bfun( ). If this way works, how can get DeviceObject, which is
required as first parameter by IoCallDriver().
> >
> >Thanks and regards
> >Elton
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@oas.co.in
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@i2r.a-star.edu.sg
> To unsubscribe send a blank email to xxxxx@lists.osr.com