Vote count:
0
I'm getting this code analysis error:
myheader.h(50): error C6102: Using 'requiredByteSize' from failed function call at line '39'.
The function being called is RegQueryValueExW, and the documentation says that requiredByteSize (the last parameter) will be set and the function will return ERROR_MORE_DATA. So, I believe the annotation on RegQueryValueExW must be incorrect and this is a false positive.
I want to suppress this by placing something like the following line within the function that calls RegQueryValueExW. I presume that will suppress the warning for the entire function?
CA_SUPPRESS_MESSAGE("What Goes Here", "CA6102", MessageId="RegistryReadStringRequiredByteSizeIsValidWhenErrorMoreData")
How do I find the category of CA6102 to put in the What Goes Here? I've searched for the code analysis error, but don't see any references that say what its category name is.
asked 2 mins ago
How to suppress code analysis warning for RegQueryValueExW returning ERROR_MORE_DATA
Aucun commentaire:
Enregistrer un commentaire