From 404cee2aa6ed08ae8b9a205396bee1fc2e3fd6d6 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 7 Nov 2019 23:37:54 -0600 Subject: [PATCH] setupapi: Set the DeviceDesc value in SetupDiInstallDevice(). At least one PnP enumeration utility expects this. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/setupapi/devinst.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 6de26b943f2..61ddade4055 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -4720,7 +4720,7 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) static const WCHAR addserviceW[] = {'A','d','d','S','e','r','v','i','c','e',0}; static const WCHAR rootW[] = {'r','o','o','t','\\',0}; WCHAR section[LINE_LEN], section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart; - WCHAR svc_name[LINE_LEN]; + WCHAR svc_name[LINE_LEN], field[LINE_LEN]; UINT install_flags = SPINST_ALL; HKEY driver_key, device_key; SC_HANDLE manager, service; @@ -4747,6 +4747,10 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) return FALSE; SetupFindFirstLineW(hinf, driver->mfg_key, driver->description, &ctx); + + SetupGetStringFieldW(&ctx, 0, field, ARRAY_SIZE(field), NULL); + RegSetValueExW(device->key, L"DeviceDesc", 0, REG_SZ, (BYTE *)field, wcslen(field) * sizeof(WCHAR)); + SetupGetStringFieldW(&ctx, 1, section, ARRAY_SIZE(section), NULL); SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, &extptr);