Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

C28103

warning C28103: Leaking resource

The specified object contains a resource that has not been freed. A function being called has been annotated with __drv_acquiresResource or __drv_acquiresResourceGlobal and this warning indicates that the resource named in the annotation was not freed.

The following code example generates this warning:

res = KeSaveFloatingPointState(buffer);

The following code example avoids this warning:

res = KeSaveFloatingPointState(buffer);
if (NT_SUCCESS(res))
{
    res = KeRestoreFloatingPointState(buffer);
}

If this warning is reported as a false positive, the most likely cause is that the function that releases the resource is not annotated with __drv_releasesResource or __drv_releasesResourceGlobal. Note that if you are using wrapper functions for system functions, the wrapper functions should use the same annotations that the system functions do. Currently, many system functions are annotated in the model file, so the annotations are not visible in the header files.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.