From: Louis Lenders xerox.xerox2000x@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56291 --- dlls/wbemprox/builtin.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 38e6893792b..a770c081216 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -301,6 +301,7 @@ static const struct column col_physicalmemory[] = static const struct column col_pnpentity[] = { { L"Caption", CIM_STRING }, + { L"ClassGuid", CIM_STRING }, { L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC }, { L"Manufacturer", CIM_STRING }, { L"Name", CIM_STRING }, @@ -755,6 +756,7 @@ struct record_physicalmemory struct record_pnpentity { const WCHAR *caption; + const WCHAR *class_guid; const WCHAR *device_id; const WCHAR *manufacturer; const WCHAR *name; @@ -3177,10 +3179,13 @@ static enum fill_status fill_pnpentity( struct table *table, const struct expr * while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo )) { WCHAR device_id[MAX_PATH]; + WCHAR guid[40] = {0}; if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id, ARRAY_SIZE(device_id), NULL )) { + StringFromGUID2( &devinfo.ClassGuid, guid, ARRAY_SIZE(guid) ); rec->caption = L"Wine PnP Device"; + rec->class_guid = wcsdup( guid ); rec->device_id = wcsdup( device_id ); rec->manufacturer = L"The Wine Project"; rec->name = L"Wine PnP Device";
Hans Leidekker (@hans) commented about dlls/wbemprox/builtin.c:
static const struct column col_pnpentity[] = { { L"Caption", CIM_STRING },
- { L"ClassGuid", CIM_STRING },
``CIM_STRING|COL_FLAG_DYNAMIC`` Otherwise it will be leaked.
Hans Leidekker (@hans) commented about dlls/wbemprox/builtin.c:
while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo )) { WCHAR device_id[MAX_PATH];
WCHAR guid[40] = {0};
``WCHAR device_id[MAX_PATH], WCHAR guid[GUID_SIZE];``
Hans Leidekker (@hans) commented about dlls/wbemprox/builtin.c:
while (SetupDiEnumDeviceInfo( device_info_set, idx++, &devinfo )) { WCHAR device_id[MAX_PATH];
WCHAR guid[40] = {0}; if (SetupDiGetDeviceInstanceIdW( device_info_set, &devinfo, device_id, ARRAY_SIZE(device_id), NULL )) {
StringFromGUID2( &devinfo.ClassGuid, guid, ARRAY_SIZE(guid) );
Native returns lower case guid strings, so please add ``wcslwr( guid )`` here.