Re: WDK 6001: PREfast bug



On Mar 14, 7:58 am, "Maxim S. Shatskih" <ma...@xxxxxxxxxxxxxxxx>
wrote:
    Here is it. KeReleaseSpinLock was added temporarily to try to get rid of
PREfast warning. Unfortunately, this does not help, and a valid sequence of 2
MS's functions causes a warning:

// !!!
713    KeReleaseSpinLock(&(Disk->SpinLock), Irql);
714            IoCompleteRequest(Irp, IO_NO_INCREMENT);

            vsnap.c(714) : warning 28192: No resource of the class 'SpinLock'
can be held when this function is called. 'Disk->SpinLock' is currently held.


If you know that the PREfast warning is false positive, why do you add
code that actually effects execution?

I would think that using a Nonmemory Resource Annotation is
preferrable in such case. For example, can you use
__drv_releasesResource or __drv_releasesResourceGlobal here?

http://msdn2.microsoft.com/en-us/library/cc264096.aspx

Unless, of course, I misunderstood what you wrote.

Don
.