Shared queue and synchronization event between two drivers

Hello Experts,

I was wondering if anyone could help me concerning the following question:
I have read here that it is possible to have a shared memory between drivers on the same computer since they all share some virtual kernel memory. I am already familiar with callback object and and registering callback routine on the pre-existing object.
Now i would like to shared queues between driver and also synchronization event.
How can I achieve it? Any sample code or link would be a good help.

Thank you

Maybe rundown locks are useful for this.
https://msdn.microsoft.com/en-us/library/windows/hardware/jj569382(v=vs.85).aspx

On Wed, Dec 30, 2015 at 9:11 PM wrote:

> Hello Experts,
>
> I was wondering if anyone could help me concerning the following question:
> I have read here that it is possible to have a shared memory between
> drivers on the same computer since they all share some virtual kernel
> memory. I am already familiar with callback object and and registering
> callback routine on the pre-existing object.
> Now i would like to shared queues between driver and also synchronization
> event.
> How can I achieve it? Any sample code or link would be a good help.
>
> Thank you
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:>

Almost ANY synchronization object will be appropriate. I’d recommend a spin lock. Easy!

Peter
OSR
@OSRDrivers

>Maybe rundown locks are useful for this
offtop, but I always was surprised by the complexity of the implementation rundown locks (if look in rundown.c or disassembly), when there is a much simpler and not less effective implementation of this logic exist (based on ObpSafeInterlockedIncrement main idea)

Create the queue and sync objects in driver A and call IoCallDriver to
driver B with data structure containing addresses of previously created
objects. Handle IRP_MJ_{INTERNAL}_DEVICE_CONTROL in driver B to receive
the call. Rinse and repeat for any other type of sharing or notification
between the two drivers.

http://www.osronline.com/article.cfm?id=177

On Thu, Dec 31, 2015 at 10:47 AM, wrote:

> >Maybe rundown locks are useful for this
> offtop, but I always was surprised by the complexity of the implementation
> rundown locks (if look in rundown.c or disassembly), when there is a much
> simpler and not less effective implementation of this logic exist (based on
> ObpSafeInterlockedIncrement main idea)
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:>

xxxxx@yahoo.fr wrote:

I was wondering if anyone could help me concerning the following question:
I have read here that it is possible to have a shared memory between drivers on the same computer since they all share some virtual kernel memory. I am already familiar with callback object and and registering callback routine on the pre-existing object.
Now i would like to shared queues between driver and also synchronization event.
How can I achieve it? Any sample code or link would be a good help.

But do remember that KMDF objects are all local to a single driver. You
cannot share them between different drivers. You can certainly use a
LINKED_LIST, but you can’t use a WDFQUEUE or WDFCOLLECTION.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you very much for your replies, it more than I expected.