I have some needs to share the memory between two drivers. So I implemented it in a simple way using the Non-Paged memory pool. Also the communication is done by using CallBack object.
Question is that one driver should initialize the memory ( using ExAllocatePool() ) and notify this to the other driver. In case of driver is loaded in such an order it seems OK, but in case of loading the driver in the other way it scrudes up the memory init.
I know that we can’t control PnP WDM driver loading. Then what is best way to init the shared memory and notify it to the other driver.
Thank you in advance.
Look at IoRegisterDeviceInterface and IoRegisterPlugPlayNotification. Have
the initializing driver register the device interface, and the other driver
get the notification.
BUT BEFORE YOU DO THIS. What problem are you really trying to solve? I
have heard this request a ton of times, but most of the “needs” are bogus.
Even if it is valid, you have more than just sharing memory here, you need
to provide synchronization in access of the memory, etc. So tell the group
what you are trying to achieve and there may be a better way.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
>I have some needs to share the memory between two drivers. So I
>implemented it in a simple way using the Non-Paged memory pool. Also the
>communication is done by using CallBack object.
>
> Question is that one driver should initialize the memory ( using
> ExAllocatePool() ) and notify this to the other driver. In case of driver
> is loaded in such an order it seems OK, but in case of loading the driver
> in the other way it scrudes up the memory init.
>
> I know that we can’t control PnP WDM driver loading. Then what is best
> way to init the shared memory and notify it to the other driver.
>
> Thank you in advance.
>
Thank you Don,
What I am trying to do is that I want to do some speech enhancement such as echo cancellation between two audio devices. One is set only to playing out and the other is recording. Thing is that for the echo cancellation I need speaker side data for a certain amount while the recording side data is being processed. So the question was then that what is THE best way to do this?
Thank you again.
Ok, I can see this is valid. I think I would create a device interface in
the speaker side, that would provide access functions for the recording
side. Note: do not just share the memory, but have functions that allow
access to the memory or the calculation that you need to do.
The toaster sample has an example of device interface stuff, that can
probably help you getting going.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
> Thank you Don,
>
> What I am trying to do is that I want to do some speech enhancement such
> as echo cancellation between two audio devices. One is set only to
> playing out and the other is recording. Thing is that for the echo
> cancellation I need speaker side data for a certain amount while the
> recording side data is being processed. So the question was then that
> what is THE best way to do this?
>
> Thank you again.
>