RE: Prefast warning 28167 - WdfSpinLockAcquire....WdfSpinLockRelease

This is an issue with the 6000 version of PFD and fixed in 6001. You can use the 6001 version of PFD on your 6000 source code though, so there is a feasible workaround.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David Voeller
Sent: Monday, December 03, 2007 2:25 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Prefast warning 28167 - WdfSpinLockAcquire…WdfSpinLockRelease

I’m building a USB driver for XP and up using WDF 6000. In the read
completion routine I make the calls shown below and prefast is producing the
warning

28167 - This function changes the IRQL and does not restore the
IRQL before it exits. It should be annotated to reflect the change or the
IRQL should be restored.

The WDF 6000 documentation says WdfSpinLockRelease(…) should return the
IRQL back to what it was prior to the WdfSpinLockAcquire(…) call so I’m
wondering if this is a Prefast bug.

WdfSpinLockAcquire(pDC->m_hASRSpinLock);
nASRPacketCnt = WdfCollectionGetCount(pDC->m_hASRCollection);
WdfSpinLockRelease(pDC->m_hASRSpinLock);


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, I’ll give it a try.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
This is an issue with the 6000 version of PFD and fixed in 6001. You can
use the 6001 version of PFD on your 6000 source code though, so there is a
feasible workaround.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Voeller
Sent: Monday, December 03, 2007 2:25 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Prefast warning 28167 -
WdfSpinLockAcquire…WdfSpinLockRelease

I’m building a USB driver for XP and up using WDF 6000. In the read
completion routine I make the calls shown below and prefast is producing the
warning

28167 - This function changes the IRQL and does not restore the
IRQL before it exits. It should be annotated to reflect the change or the
IRQL should be restored.

The WDF 6000 documentation says WdfSpinLockRelease(…) should return the
IRQL back to what it was prior to the WdfSpinLockAcquire(…) call so I’m
wondering if this is a Prefast bug.

WdfSpinLockAcquire(pDC->m_hASRSpinLock);
nASRPacketCnt = WdfCollectionGetCount(pDC->m_hASRCollection);
WdfSpinLockRelease(pDC->m_hASRSpinLock);


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