Core/CrashHandler: Add a timeout to retrieving windows version from WMI

(cherry picked from commit 36a64884054f0bf34e815b62157be61c3476127a)
This commit is contained in:
Shauren authored and Ovahlord committed 2023-12-04 22:09:24 +01:00
1 parent 63f06c1157
commit 10ff84361a
1 file changed
+8 -8
@@ -489,14 +489,14 @@ BOOL WheatyExceptionReport::_GetWindowsVersionFromWMI(TCHAR* szVersion, DWORD cn
{
IWbemServices* tmp = nullptr;
HRESULT hres = loc->ConnectServer(
bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace
nullptr, // User name. NULL = current user
nullptr, // User password. NULL = current
nullptr, // Locale. NULL indicates current
0, // Security flags.
nullptr, // Authority (for example, Kerberos)
nullptr, // Context object
&tmp // pointer to IWbemServices proxy
bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace
nullptr, // User name. NULL = current user
nullptr, // User password. NULL = current
nullptr, // Locale. NULL indicates current
WBEM_FLAG_CONNECT_USE_MAX_WAIT, // Security flags.
nullptr, // Authority (for example, Kerberos)
nullptr, // Context object
&tmp // pointer to IWbemServices proxy
);
if (FAILED(hres))