8300052: PdhDll::PdhCollectQueryData and PdhLookupPerfNameByIndex will never be NULL

Reviewed-by: dholmes
This commit is contained in:
Julian Waters 2023-01-16 06:07:38 +00:00
parent 7bcd5f418c
commit 12edd6f922

@ -111,9 +111,9 @@ bool PdhDll::PdhAttach(void) {
}
while (InterlockedCompareExchange(&_critical_section, 0, 1) == 0);
return (_PdhAddCounter != NULL && _PdhOpenQuery != NULL
&& _PdhCloseQuery != NULL && PdhCollectQueryData != NULL
&& _PdhCloseQuery != NULL && _PdhCollectQueryData != NULL
&& _PdhGetFormattedCounterValue != NULL && _PdhEnumObjectItems != NULL
&& _PdhRemoveCounter != NULL && PdhLookupPerfNameByIndex != NULL
&& _PdhRemoveCounter != NULL && _PdhLookupPerfNameByIndex != NULL
&& _PdhMakeCounterPath != NULL && _PdhExpandWildCardPath != NULL);
}
@ -166,7 +166,7 @@ PDH_STATUS PdhDll::PdhMakeCounterPath(PDH_COUNTER_PATH_ELEMENTS* pCounterPathEle
}
PDH_STATUS PdhDll::PdhExpandWildCardPath(LPCSTR szDataSource, LPCSTR szWildCardPath, PZZSTR mszExpandedPathList, LPDWORD pcchPathListLength, DWORD dwFlags) {
assert(_initialized && PdhExpandWildCardPath != NULL, "PdhAvailable() not yet called");
assert(_initialized && _PdhExpandWildCardPath != NULL, "PdhAvailable() not yet called");
return _PdhExpandWildCardPath(szDataSource, szWildCardPath, mszExpandedPathList, pcchPathListLength, dwFlags);
}