Warning C28107
Resource must be held when calling function
A resource that the program must acquire before calling the function wasn't acquired when the function was called. As a result, the function call will fail. This warning is reported only when resources are acquired and released in the same function.
Example
The following code example generates this warning:
ExAcquireResourceLite(resource, true);
ExReleaseResourceLite(resource);
The following code example avoids this warning:
KeEnterCriticalRegion();
ExAcquireResourceLite(resource, true);
ExReleaseResourceLite(resource);
KeLeaveCriticalRegion();
KeEnterCriticalRegion();
ExAcquireResourceLite(resource, true);
ExReleaseResourceLite(resource);
KeLeaveCriticalRegion();
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for