mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 10:40:19 +00:00
Updated Windows sysinfo HDD querying to use Win32_LogicalDisk filtered to local fixed drives (DriveType = 3) instead of Win32_Volume, with an inline comment explaining this avoids provider/RPC probe failures (such as Plan9/WSL-backed providers) seen in debugger sessions.
Updated the HDD size property read from WMI from Capacity to Size so it matches the new Win32_LogicalDisk query schema.
This commit is contained in:
@@ -229,7 +229,15 @@ static char *query_wmi (QueryWmiType type)
|
|||||||
query = SysAllocString (L"SELECT Name FROM Win32_VideoController");
|
query = SysAllocString (L"SELECT Name FROM Win32_VideoController");
|
||||||
break;
|
break;
|
||||||
case QUERY_WMI_HDD:
|
case QUERY_WMI_HDD:
|
||||||
query = SysAllocString (L"SELECT Name, Capacity, FreeSpace FROM Win32_Volume");
|
/*
|
||||||
|
* Query local fixed logical disks only.
|
||||||
|
*
|
||||||
|
* Win32_Volume can cause Windows to probe additional network-backed
|
||||||
|
* providers (for example Plan9/WSL providers), which may trigger RPC
|
||||||
|
* failures in debugger sessions. Restricting this to fixed logical disks
|
||||||
|
* avoids those probes while still providing useful local disk stats.
|
||||||
|
*/
|
||||||
|
query = SysAllocString (L"SELECT Name, Size, FreeSpace FROM Win32_LogicalDisk WHERE DriveType = 3");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
goto release_queryLanguageName;
|
goto release_queryLanguageName;
|
||||||
@@ -465,7 +473,7 @@ static char *read_hdd_info (IWbemClassObject *object)
|
|||||||
|
|
||||||
VariantClear (&name_variant);
|
VariantClear (&name_variant);
|
||||||
|
|
||||||
hr = object->lpVtbl->Get (object, L"Capacity", 0, &capacity_variant, NULL, NULL);
|
hr = object->lpVtbl->Get (object, L"Size", 0, &capacity_variant, NULL, NULL);
|
||||||
if (FAILED (hr))
|
if (FAILED (hr))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user