Zebediah Figura : setupapi: Process the .Services subsection in SetupDiInstallDevice().

Alexandre Julliard julliard at winehq.org
Mon May 27 14:50:19 CDT 2019


Module: wine
Branch: master
Commit: b2adecd5e429d0e651da123aa7e7bcbe204d0419
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b2adecd5e429d0e651da123aa7e7bcbe204d0419

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri May 24 23:33:55 2019 -0500

setupapi: Process the .Services subsection in SetupDiInstallDevice().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/devinst.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 9bedb73..0279d10 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -4688,6 +4688,8 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data)
     static const WCHAR infsectionW[] = {'I','n','f','S','e','c','t','i','o','n',0};
     static const WCHAR infsectionextW[] = {'I','n','f','S','e','c','t','i','o','n','E','x','t',0};
     static const WCHAR dothwW[] = {'.','H','W',0};
+    static const WCHAR dotservicesW[] = {'.','S','e','r','v','i','c','e','s',0};
+    static const WCHAR addserviceW[] = {'A','d','d','S','e','r','v','i','c','e',0};
     WCHAR section[LINE_LEN], section_ext[LINE_LEN], subsection[LINE_LEN], inf_path[MAX_PATH], *extptr, *filepart;
     UINT install_flags = SPINST_ALL;
     HKEY driver_key, device_key;
@@ -4747,6 +4749,26 @@ BOOL WINAPI SetupDiInstallDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data)
     SetupInstallFromInfSectionW(NULL, hinf, subsection, install_flags, device_key, NULL,
             SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL);
 
+    strcpyW(subsection, section_ext);
+    strcatW(subsection, dotservicesW);
+    SetupInstallServicesFromInfSectionW(hinf, subsection, 0);
+
+    if (SetupFindFirstLineW(hinf, subsection, addserviceW, &ctx))
+    {
+        do
+        {
+            INT flags;
+
+            if (SetupGetIntField(&ctx, 2, &flags) && (flags & SPSVCINST_ASSOCSERVICE))
+            {
+                WCHAR svc_name[LINE_LEN];
+                if (SetupGetStringFieldW(&ctx, 1, svc_name, ARRAY_SIZE(svc_name), NULL) && svc_name[0])
+                    RegSetValueExW(device->key, Service, 0, REG_SZ, (BYTE *)svc_name, strlenW(svc_name) * sizeof(WCHAR));
+                break;
+            }
+        } while (SetupFindNextMatchLineW(&ctx, addserviceW, &ctx));
+    }
+
     SetupTermDefaultQueueCallback(callback_ctx);
     SetupCloseInfFile(hinf);
 




More information about the wine-cvs mailing list