https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a95a0b61bd6c693c4ba9bd...
commit a95a0b61bd6c693c4ba9bdca5009bee0b3047dc6 Author: Eric Kohl eric.kohl@reactos.org AuthorDate: Sat Nov 2 00:16:41 2019 +0100 Commit: Eric Kohl eric.kohl@reactos.org CommitDate: Sat Nov 2 00:17:33 2019 +0100
[SETUPAPI] Add support for the optional StartName entry in inf file service install sections --- dll/win32/setupapi/install.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dll/win32/setupapi/install.c b/dll/win32/setupapi/install.c index 9fddeafc712..9527ad32067 100644 --- a/dll/win32/setupapi/install.c +++ b/dll/win32/setupapi/install.c @@ -42,6 +42,7 @@ static const WCHAR SecurityKey[] = {'S','e','c','u','r','i','t','y',0}; static const WCHAR ServiceBinaryKey[] = {'S','e','r','v','i','c','e','B','i','n','a','r','y',0}; static const WCHAR ServiceTypeKey[] = {'S','e','r','v','i','c','e','T','y','p','e',0}; static const WCHAR StartTypeKey[] = {'S','t','a','r','t','T','y','p','e',0}; +static const WCHAR StartNameKey[] = {'S','t','a','r','t','N','a','m','e',0};
static const WCHAR Name[] = {'N','a','m','e',0}; static const WCHAR CmdLine[] = {'C','m','d','L','i','n','e',0}; @@ -1791,6 +1792,7 @@ static BOOL InstallOneService( LPWSTR DisplayName = NULL; LPWSTR Description = NULL; LPWSTR Dependencies = NULL; + LPWSTR StartName = NULL; LPWSTR SecurityDescriptor = NULL; PSECURITY_DESCRIPTOR sd = NULL; INT ServiceType, StartType, ErrorControl; @@ -1834,6 +1836,7 @@ static BOOL InstallOneService( GetLineText(hInf, ServiceSection, DisplayNameKey, &DisplayName); GetLineText(hInf, ServiceSection, DescriptionKey, &Description); GetLineText(hInf, ServiceSection, DependenciesKey, &Dependencies); + GetLineText(hInf, ServiceSection, StartNameKey, &StartName);
/* If there is no group, we must not request a tag */ if (!LoadOrderGroup || !*LoadOrderGroup) @@ -1868,7 +1871,8 @@ static BOOL InstallOneService( LoadOrderGroup, useTag ? &tagId : NULL, Dependencies, - NULL, NULL); + StartName, + NULL); if (hService == NULL) goto cleanup; } @@ -1901,7 +1905,8 @@ static BOOL InstallOneService( (ServiceFlags & SPSVCINST_NOCLOBBER_LOADORDERGROUP && ServiceConfig->lpLoadOrderGroup) ? NULL : LoadOrderGroup, useTag ? &tagId : NULL, (ServiceFlags & SPSVCINST_NOCLOBBER_DEPENDENCIES && ServiceConfig->lpDependencies) ? NULL : Dependencies, - NULL, NULL, + StartName, + NULL, (ServiceFlags & SPSVCINST_NOCLOBBER_DISPLAYNAME && ServiceConfig->lpDisplayName) ? NULL : DisplayName); if (!ret) goto cleanup; @@ -2057,6 +2062,7 @@ cleanup: MyFree(Dependencies); MyFree(SecurityDescriptor); MyFree(GroupOrder); + MyFree(StartName);
TRACE("Returning %d\n", ret); return ret;