Sharing data between ISR level and passive level

Dear colleagues,
I have to share data between code working on DIRQL and passive level.
I’m calling KeAquireSpinLock, but it seems like it doesn’t work. I mean
interrupts are being handled while I execute code between KeAquireSpinLock
& KeReleaseSpinLock.
What should I do to prevent ISR handling routine call?

Akorolev wrote:

I have to share data between code working on DIRQL and passive level.
I’m calling KeAquireSpinLock, but it seems like it doesn’t work. I mean
interrupts are being handled while I execute code between KeAquireSpinLock
& KeReleaseSpinLock.
What should I do to prevent ISR handling routine call?

There are several ways to synchronize activities between your ISR and
other parts of your driver.

You can call KeSynchronizeExecution from the “other parts”. That routine
raises the IRQL to DIRQL, claims your interrupt spin lock, and calls a
callback function.

Starting in XP, you can call KeAcquireInterruptSpinLock. This is less
cumbersome that KeSynchronizeExecution because you don’t need to use the
baroque method of filling in some parameter structure to tell the “sync
critical section routine” what to do.

You can use ExInterlockedXxxList functions to manipulate linked lists.
These functions are callable at any IRQL.

You can use InterlockedXxx functions to modify LONG variables. These are
also callable at any IRQL.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

Use KeSynchronizeExecution or XP-only function
KeAcquireInterruptSpinLock.

Max

----- Original Message -----
From: “Akorolev”
To: “NT Developers Interest List”
Sent: Tuesday, November 19, 2002 10:46 AM
Subject: [ntdev] Sharing data between ISR level and passive level

> Dear colleagues,
> I have to share data between code working on DIRQL and passive
level.
> I’m calling KeAquireSpinLock, but it seems like it doesn’t work. I
mean
> interrupts are being handled while I execute code between
KeAquireSpinLock
> & KeReleaseSpinLock.
> What should I do to prevent ISR handling routine call?
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Unless you are acquiring the interrupt object spinlock, you are literally
spitting into the wind. The recommended way of doing this for 2000 and below
is the good old KeSynchronizeExecution function. For XP and above there is
KeAcquire/ReleaseInterruptSpinlock. A normal spinlock is only acquired and
released at no higher than DISPATCH_LEVEL.


Gary G. Little
Have Computer, Will Travel …
909-698-3191
909-551-2105

“Akorolev” wrote in message news:xxxxx@ntdev…
>
> Dear colleagues,
> I have to share data between code working on DIRQL and passive level.
> I’m calling KeAquireSpinLock, but it seems like it doesn’t work. I mean
> interrupts are being handled while I execute code between KeAquireSpinLock
> & KeReleaseSpinLock.
> What should I do to prevent ISR handling routine call?
>
>

Hi,

To synchronize shared data access between DIRQL & Passive Level, u need
to use “KeSynchronizeExecution( )” and NOT KeAcquireSpinLock which
always raises to DISPATCH_LEVEL.

Hope this should work ?
-----Original Message-----
From: Akorolev [mailto:xxxxx@mail.ru]
Sent: Tuesday, November 19, 2002 1:17 PM
Subject: Sharing data between ISR level and passive level

Dear colleagues,
I have to share data between code working on DIRQL and passive level.
I’m calling KeAquireSpinLock, but it seems like it doesn’t work. I mean
interrupts are being handled while I execute code between
KeAquireSpinLock
& KeReleaseSpinLock.
What should I do to prevent ISR handling routine call?