看起來像SAL錯誤。代碼:代碼分析不理解_In_opt_參數註釋?
PAAFILEFILTER_PROTECTED_FILE curFile = NULL;
try
{
status = GetProtectedFile(FileIdInfo, instanceContext, &curFile);
if(!NT_SUCCESS(status))
{
TraceError("Can't GetProtectedFile with status: %!STATUS!\n", status);
leave;
}
...
finally
{
if(NT_SUCCESS(status))
{
LogMessage(AAFILEFILTER_FILE_UNPROTECTED, NULL, NULL, NULL, 0, (PUCHAR)FileIdInfo, sizeof(AAFILE_ID_INFORMATION));
}
else
{
TraceProtectedFile(curFile);
}
}
和代碼觀給我C6102 - Using variable from failed function call
在行TraceProtectedFile(curFile)
;但TraceProtectedFile有原型
_In_opt_ PAAFILEFILTER_PROTECTED_FILE protectedFile
_In_opt_意味着"_In_opt_ is the same as _In_, except that the input parameter is allowed to be NULL and, therefore, the function should check for this."
..如果CA不能處理這樣簡單的事情不那麼已瞭解什麼可以:(
同意你的看法......這是更清潔。但仍然這是CA錯誤:) C6102絕不能爲_In_opt_參數恕我直言。 –