From bd82c844a9d229fa85eb274912a7aec707d0a743 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 4 Apr 2015 06:30:44 +0000 Subject: [PATCH] [SERVICES][ADVAPI32] - Remove old hack member in SC_RPC_CONFIG_INFOA that is no longer necessary and makes info levels other than SERVICE_CONFIG_DESCRIPTION fail. Fixes failure in VMware Tools installer. - Actually save the new service description in RChangeServiceConfigW CORE-9479 #resolve svn path=/trunk/; revision=67027 --- reactos/base/system/services/rpcserver.c | 17 +++++++++-------- reactos/dll/win32/advapi32/service/scm.c | 13 ++++++------- reactos/include/reactos/idl/svcctl.idl | 1 - 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 172a6d5b9ee..a430933ba29 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -1909,6 +1909,7 @@ DWORD RChangeServiceConfigW( goto done; } + wcscpy(lpDisplayNameW, lpDisplayName); if (lpService->lpDisplayName != lpService->lpServiceName) HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); @@ -4816,14 +4817,14 @@ DWORD RChangeServiceConfig2A( if (InfoW.dwInfoLevel == SERVICE_CONFIG_DESCRIPTION) { LPSERVICE_DESCRIPTIONW lpServiceDescriptionW; - //LPSERVICE_DESCRIPTIONA lpServiceDescriptionA; + LPSERVICE_DESCRIPTIONA lpServiceDescriptionA; - //lpServiceDescriptionA = Info.psd; + lpServiceDescriptionA = Info.psd; - ///if (lpServiceDescriptionA && - ///lpServiceDescriptionA->lpDescription) - ///{ - dwLength = (DWORD)((strlen(Info.lpDescription) + 1) * sizeof(WCHAR)); + if (lpServiceDescriptionA && + lpServiceDescriptionA->lpDescription) + { + dwLength = (DWORD)((strlen(lpServiceDescriptionA->lpDescription) + 1) * sizeof(WCHAR)); lpServiceDescriptionW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, @@ -4837,14 +4838,14 @@ DWORD RChangeServiceConfig2A( MultiByteToWideChar(CP_ACP, 0, - Info.lpDescription, + lpServiceDescriptionA->lpDescription, -1, lpServiceDescriptionW->lpDescription, dwLength); ptr = lpServiceDescriptionW; InfoW.psd = lpServiceDescriptionW; - ///} + } } else if (Info.dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS) { diff --git a/reactos/dll/win32/advapi32/service/scm.c b/reactos/dll/win32/advapi32/service/scm.c index 0e80fc293e4..33e1949c309 100644 --- a/reactos/dll/win32/advapi32/service/scm.c +++ b/reactos/dll/win32/advapi32/service/scm.c @@ -167,17 +167,16 @@ ChangeServiceConfig2A(SC_HANDLE hService, if (lpInfo == NULL) return TRUE; - /* Fill relevent field of the Info structure */ + /* Fill relevant field of the Info structure */ Info.dwInfoLevel = dwInfoLevel; switch (dwInfoLevel) { case SERVICE_CONFIG_DESCRIPTION: - Info.psd = (LPSERVICE_DESCRIPTIONA)&lpInfo; - Info.lpDescription = ((LPSERVICE_DESCRIPTIONA)lpInfo)->lpDescription; //HACK + Info.psd = lpInfo; break; case SERVICE_CONFIG_FAILURE_ACTIONS: - Info.psfa = (LPSERVICE_FAILURE_ACTIONSA)lpInfo; + Info.psfa = lpInfo; break; default: @@ -225,16 +224,16 @@ ChangeServiceConfig2W(SC_HANDLE hService, if (lpInfo == NULL) return TRUE; - /* Fill relevent field of the Info structure */ + /* Fill relevant field of the Info structure */ Info.dwInfoLevel = dwInfoLevel; switch (dwInfoLevel) { case SERVICE_CONFIG_DESCRIPTION: - Info.psd = (LPSERVICE_DESCRIPTIONW)lpInfo; + Info.psd = lpInfo; break; case SERVICE_CONFIG_FAILURE_ACTIONS: - Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)lpInfo; + Info.psfa = lpInfo; break; default: diff --git a/reactos/include/reactos/idl/svcctl.idl b/reactos/include/reactos/idl/svcctl.idl index 11602930d5f..76904c55f29 100644 --- a/reactos/include/reactos/idl/svcctl.idl +++ b/reactos/include/reactos/idl/svcctl.idl @@ -192,7 +192,6 @@ typedef struct _SC_RPC_CONFIG_INFOA { [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp; [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps; } DUMMYUNIONNAME; - [string] LPSTR lpDescription; //FIXME } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA; typedef struct _SC_RPC_CONFIG_INFOW {