[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
This commit is contained in:
Thomas Faber 2015-04-04 06:30:44 +00:00
parent 9b70cba818
commit bd82c844a9
3 changed files with 15 additions and 16 deletions

View file

@ -1909,6 +1909,7 @@ DWORD RChangeServiceConfigW(
goto done; goto done;
} }
wcscpy(lpDisplayNameW, lpDisplayName);
if (lpService->lpDisplayName != lpService->lpServiceName) if (lpService->lpDisplayName != lpService->lpServiceName)
HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName);
@ -4816,14 +4817,14 @@ DWORD RChangeServiceConfig2A(
if (InfoW.dwInfoLevel == SERVICE_CONFIG_DESCRIPTION) if (InfoW.dwInfoLevel == SERVICE_CONFIG_DESCRIPTION)
{ {
LPSERVICE_DESCRIPTIONW lpServiceDescriptionW; LPSERVICE_DESCRIPTIONW lpServiceDescriptionW;
//LPSERVICE_DESCRIPTIONA lpServiceDescriptionA; LPSERVICE_DESCRIPTIONA lpServiceDescriptionA;
//lpServiceDescriptionA = Info.psd; lpServiceDescriptionA = Info.psd;
///if (lpServiceDescriptionA && if (lpServiceDescriptionA &&
///lpServiceDescriptionA->lpDescription) lpServiceDescriptionA->lpDescription)
///{ {
dwLength = (DWORD)((strlen(Info.lpDescription) + 1) * sizeof(WCHAR)); dwLength = (DWORD)((strlen(lpServiceDescriptionA->lpDescription) + 1) * sizeof(WCHAR));
lpServiceDescriptionW = HeapAlloc(GetProcessHeap(), lpServiceDescriptionW = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, HEAP_ZERO_MEMORY,
@ -4837,14 +4838,14 @@ DWORD RChangeServiceConfig2A(
MultiByteToWideChar(CP_ACP, MultiByteToWideChar(CP_ACP,
0, 0,
Info.lpDescription, lpServiceDescriptionA->lpDescription,
-1, -1,
lpServiceDescriptionW->lpDescription, lpServiceDescriptionW->lpDescription,
dwLength); dwLength);
ptr = lpServiceDescriptionW; ptr = lpServiceDescriptionW;
InfoW.psd = lpServiceDescriptionW; InfoW.psd = lpServiceDescriptionW;
///} }
} }
else if (Info.dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS) else if (Info.dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS)
{ {

View file

@ -167,17 +167,16 @@ ChangeServiceConfig2A(SC_HANDLE hService,
if (lpInfo == NULL) return TRUE; if (lpInfo == NULL) return TRUE;
/* Fill relevent field of the Info structure */ /* Fill relevant field of the Info structure */
Info.dwInfoLevel = dwInfoLevel; Info.dwInfoLevel = dwInfoLevel;
switch (dwInfoLevel) switch (dwInfoLevel)
{ {
case SERVICE_CONFIG_DESCRIPTION: case SERVICE_CONFIG_DESCRIPTION:
Info.psd = (LPSERVICE_DESCRIPTIONA)&lpInfo; Info.psd = lpInfo;
Info.lpDescription = ((LPSERVICE_DESCRIPTIONA)lpInfo)->lpDescription; //HACK
break; break;
case SERVICE_CONFIG_FAILURE_ACTIONS: case SERVICE_CONFIG_FAILURE_ACTIONS:
Info.psfa = (LPSERVICE_FAILURE_ACTIONSA)lpInfo; Info.psfa = lpInfo;
break; break;
default: default:
@ -225,16 +224,16 @@ ChangeServiceConfig2W(SC_HANDLE hService,
if (lpInfo == NULL) return TRUE; if (lpInfo == NULL) return TRUE;
/* Fill relevent field of the Info structure */ /* Fill relevant field of the Info structure */
Info.dwInfoLevel = dwInfoLevel; Info.dwInfoLevel = dwInfoLevel;
switch (dwInfoLevel) switch (dwInfoLevel)
{ {
case SERVICE_CONFIG_DESCRIPTION: case SERVICE_CONFIG_DESCRIPTION:
Info.psd = (LPSERVICE_DESCRIPTIONW)lpInfo; Info.psd = lpInfo;
break; break;
case SERVICE_CONFIG_FAILURE_ACTIONS: case SERVICE_CONFIG_FAILURE_ACTIONS:
Info.psfa = (LPSERVICE_FAILURE_ACTIONSW)lpInfo; Info.psfa = lpInfo;
break; break;
default: default:

View file

@ -192,7 +192,6 @@ typedef struct _SC_RPC_CONFIG_INFOA {
[case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp; [case(6)] LPSERVICE_RPC_REQUIRED_PRIVILEGES_INFO psrp;
[case(7)] LPSERVICE_PRESHUTDOWN_INFO psps; [case(7)] LPSERVICE_PRESHUTDOWN_INFO psps;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
[string] LPSTR lpDescription; //FIXME
} SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA; } SC_RPC_CONFIG_INFOA, *LPSC_RPC_CONFIG_INFOA;
typedef struct _SC_RPC_CONFIG_INFOW { typedef struct _SC_RPC_CONFIG_INFOW {