From 048409d7cb0b79775c44ab3b7966a16878ddff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 11 Dec 2007 10:26:45 +0000 Subject: [PATCH] Handle AddReg and DelReg in Service section svn path=/trunk/; revision=31139 --- reactos/dll/win32/setupapi/install.c | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/setupapi/install.c b/reactos/dll/win32/setupapi/install.c index 52a6b3dbce5..2bc83ba4839 100644 --- a/reactos/dll/win32/setupapi/install.c +++ b/reactos/dll/win32/setupapi/install.c @@ -1631,6 +1631,8 @@ static BOOL InstallOneService( SC_HANDLE hService = NULL; LPDWORD GroupOrder = NULL; LPQUERY_SERVICE_CONFIGW ServiceConfig = NULL; + HKEY hServicesKey, hServiceKey; + LONG rc; BOOL ret = FALSE; HKEY hGroupOrderListKey = NULL; @@ -1752,7 +1754,6 @@ static BOOL InstallOneService( if (useTag) { /* Add the tag to SYSTEM\CurrentControlSet\Control\GroupOrderList key */ - LONG rc; LPCWSTR lpLoadOrderGroup; DWORD bufferSize; @@ -1831,7 +1832,44 @@ static BOOL InstallOneService( } } - ret = TRUE; + /* Handle AddReg and DelReg */ + rc = RegOpenKeyExW( + list ? list->HKLM : HKEY_LOCAL_MACHINE, + REGSTR_PATH_SERVICES, + 0, + 0, + &hServicesKey); + if (rc != ERROR_SUCCESS) + { + SetLastError(rc); + goto cleanup; + } + rc = RegOpenKeyExW( + hServicesKey, + ServiceName, + 0, + KEY_READ | KEY_WRITE, + &hServiceKey); + RegCloseKey(hServicesKey); + if (rc != ERROR_SUCCESS) + { + SetLastError(rc); + goto cleanup; + } + + ret = SetupInstallFromInfSectionW( + NULL, + hInf, + ServiceSection, + SPINST_REGISTRY, + hServiceKey, + NULL, + 0, + NULL, + NULL, + NULL, + NULL); + RegCloseKey(hServiceKey); cleanup: if (hSCManager != NULL)