From 16f2c6cc0d1e74795df781ccf09b8ed58b0ebfbc Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 15 Feb 2026 16:51:11 -0700 Subject: [PATCH] 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. --- src/common/sysinfo/win32/backend.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/sysinfo/win32/backend.c b/src/common/sysinfo/win32/backend.c index 0a80b1f8..be6df1b9 100644 --- a/src/common/sysinfo/win32/backend.c +++ b/src/common/sysinfo/win32/backend.c @@ -229,7 +229,15 @@ static char *query_wmi (QueryWmiType type) query = SysAllocString (L"SELECT Name FROM Win32_VideoController"); break; 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; default: goto release_queryLanguageName; @@ -465,7 +473,7 @@ static char *read_hdd_info (IWbemClassObject *object) 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)) { return NULL;