Semaphore locking in DPC Irql Level......

Hi all!
There is a requirement for me to acquire locking in the DPC level.
Is there any provision to acquire non zero time lock in DPC level.
When i check my driver using ‘Driver Verifier’ it is crashing.

—>Is there any provision where i can use the semaphore locking for non
zero time in DPC level???
Your help is highly appreciated.

Thanks,
Raghu.

You can try to acquire the lock with a zero timeout (e.g. Not NULL) and deal with it failing. Better yet, just use a spinlock. Or queue a work item and acquire the semaphore at passive.

In the end, your requirement is flawed. What created this requirement?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Raghu
Sent: Thursday, May 28, 2009 10:04 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Semaphore locking in DPC Irql Level…

Hi all!
There is a requirement for me to acquire locking in the DPC level.
Is there any provision to acquire non zero time lock in DPC level.
When i check my driver using ‘Driver Verifier’ it is crashing.

—>Is there any provision where i can use the semaphore locking for non
zero time in DPC level???
Your help is highly appreciated.

Thanks,
Raghu.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks for your response Doron.
Actually , My driver is SDIO miniport driver which acts as wireless
interface.
There are two contexts,

  1. Interrupt context
  2. OID context.
    There are shared variables between these two contexts which need locking
    to ensure mutual exclusion.

One more doubt Doron, Do you have idea about NDIS.
If so , Can NDIS work simultaneously in two contexts???
I was trying to find answers for my different question but i didn’t find
the exact place where
i can get my ansers. :slight_smile:

Thanks,
Raghu.

Doron Holan wrote:

You can try to acquire the lock with a zero timeout (e.g. Not NULL) and deal with it failing. Better yet, just use a spinlock. Or queue a work item and acquire the semaphore at passive.

In the end, your requirement is flawed. What created this requirement?

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Raghu
> Sent: Thursday, May 28, 2009 10:04 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Semaphore locking in DPC Irql Level…
>
>
> Hi all!
> There is a requirement for me to acquire locking in the DPC level.
> Is there any provision to acquire non zero time lock in DPC level.
> When i check my driver using ‘Driver Verifier’ it is crashing.
>
> —>Is there any provision where i can use the semaphore locking for non
> zero time in DPC level???
> Your help is highly appreciated.
>
> Thanks,
> Raghu.
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
>

What do you mean by
Can NDIS work simultaneously in two contexts?

Ndis certianly can handle multiple packets in flight, both sending and receiving.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Raghu
Sent: Thursday, May 28, 2009 10:56 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Semaphore locking in DPC Irql Level…

Thanks for your response Doron.
Actually , My driver is SDIO miniport driver which acts as wireless
interface.
There are two contexts,
1) Interrupt context
2) OID context.
There are shared variables between these two contexts which need locking
to ensure mutual exclusion.

One more doubt Doron, Do you have idea about NDIS.
If so , Can NDIS work simultaneously in two contexts???
I was trying to find answers for my different question but i didn’t find
the exact place where
i can get my ansers. :slight_smile:

Thanks,
Raghu.

Doron Holan wrote:
> You can try to acquire the lock with a zero timeout (e.g. Not NULL) and deal with it failing. Better yet, just use a spinlock. Or queue a work item and acquire the semaphore at passive.
>
> In the end, your requirement is flawed. What created this requirement?
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: Raghu
> Sent: Thursday, May 28, 2009 10:04 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Semaphore locking in DPC Irql Level…
>
>
> Hi all!
> There is a requirement for me to acquire locking in the DPC level.
> Is there any provision to acquire non zero time lock in DPC level.
> When i check my driver using ‘Driver Verifier’ it is crashing.
>
> —>Is there any provision where i can use the semaphore locking for non
> zero time in DPC level???
> Your help is highly appreciated.
>
> Thanks,
> Raghu.
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> There is a requirement for me to acquire locking in the DPC level.

Spinlock only.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks for your response Doron.

Doron Holan wrote:

What do you mean by
Can NDIS work simultaneously in two contexts?

Ndis certianly can handle multiple packets in flight, both sending and receiving.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Raghu
> Sent: Thursday, May 28, 2009 10:56 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Semaphore locking in DPC Irql Level…
>
>
> Thanks for your response Doron.
> Actually , My driver is SDIO miniport driver which acts as wireless
> interface.
> There are two contexts,
> 1) Interrupt context
> 2) OID context.
> There are shared variables between these two contexts which need locking
> to ensure mutual exclusion.
>
> One more doubt Doron, Do you have idea about NDIS.
> If so , Can NDIS work simultaneously in two contexts???
> I was trying to find answers for my different question but i didn’t find
> the exact place where
> i can get my ansers. :slight_smile:
>
> Thanks,
> Raghu.
>
> Doron Holan wrote:
>
>> You can try to acquire the lock with a zero timeout (e.g. Not NULL) and deal with it failing. Better yet, just use a spinlock. Or queue a work item and acquire the semaphore at passive.
>>
>> In the end, your requirement is flawed. What created this requirement?
>>
>> d
>>
>> Sent from my phone with no t9, all spilling mistakes are not intentional.
>>
>> -----Original Message-----
>> From: Raghu
>> Sent: Thursday, May 28, 2009 10:04 PM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Semaphore locking in DPC Irql Level…
>>
>>
>> Hi all!
>> There is a requirement for me to acquire locking in the DPC level.
>> Is there any provision to acquire non zero time lock in DPC level.
>> When i check my driver using ‘Driver Verifier’ it is crashing.
>>
>> —>Is there any provision where i can use the semaphore locking for non
>> zero time in DPC level???
>> Your help is highly appreciated.
>>
>> Thanks,
>> Raghu.
>>
>>
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>
>>
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
>