Преглед изворни кода

[Windows] Fix GCC MinGW warnings.

bruvzg пре 2 година
родитељ
комит
ad4cc8682b
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      platform/windows/os_windows.cpp

+ 3 - 1
platform/windows/os_windows.cpp

@@ -331,8 +331,10 @@ Vector<String> OS_Windows::get_video_adapter_driver_info() const {
 	if (hr != S_OK) {
 		return Vector<String>();
 	}
+	BSTR resource_name = SysAllocString(L"root\\CIMV2");
+	hr = wbemLocator->ConnectServer(resource_name, NULL, NULL, NULL, 0, NULL, NULL, &wbemServices);
+	SysFreeString(resource_name);
 
-	hr = wbemLocator->ConnectServer(L"root\\CIMV2", NULL, NULL, 0, NULL, 0, 0, &wbemServices);
 	SAFE_RELEASE(wbemLocator) // from now on, use `wbemServices`
 	if (hr != S_OK) {
 		SAFE_RELEASE(wbemServices)