[NTDEV][WIN2K][WINXP] Synchronization with the ISR ...

Windows XP, 2000
Dual processor, 128 meg ram

We have talked about this on this group before, and I believe the general
consensus was that my technique for synchronizing to DIRQL was proper, how
be it that it was not the NORMAL way of doing things. However, I am
beginning to doubt that.

Normally to synchronize to DIRQL, you pass KeSynchronizeExecution the
interrupt object you acquired in your call to IoConnectInterrupt. Because of
the constraints of an external API that I must use to access the fibre
channel hardware that my driver controls, I opted to pass IoConnectInterrupt
a pointer to an initialized spin lock and then use that spin lock to sync
with DIRQL. The API that I must use, has separate calls to lock and release
critical sections of code, so I had a choice of NO-OP’ng those calls and
using KeSynchronizeExecution, or ignoring KeSynchronizeExecution and using
those calls to acquire and release the interrupt at DIRQL. I tend to hate
dead code, and object to calling a function that does nothing but return.
What I have attempted to do is to provide the functionality of
KeAcquireSpinLock and KeReleaseSpinlock, but at DIRQL.

This has seemed to work for months, but I am now facing a synchronization
bug that I can only explain by the failure of this method to really
synchronize with the interrupt service calls at DIRQL. I see the spin lock
released when it should not be, and changes made to volatile data AFTER the
sync’d code has acquired it. It is like the interrupt service functions
ignore my “illegal” use of DIRQL and the spin lock. Like SCSIPPORT, is there
a “context” flag or flags used when acquiring the interrupt spin lock for
synchronization at DIRQL?

I do note that the interrupt object I received from IoConnectInterrupt is
not always equal to the interrupt object received by my ISR routine. Can
this have bearing on the issue. The content of this “bogus” interrupt object
appears to contain the proper spin lock and IRQL, but not everything within
those structures is equal. Could this explain the loss of synchronization at
DIRQL?

Gary


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com