[0.4.7][SERVICES] RChangeServiceConfig2A(): Zero-Initialize InfoW variable CORE-14521

This lets forward NULL Info.psd/Info.psd->lpDescription/Info.psfa,
instead of an uninitialized value.

Currently this branch does not show the bug CORE-14521, but that is just because
it doesn't use the more mean "advapi32 : service" test of 0.4.10.

If we would port back the newer test from 0.4.9-dev-555-g 3c1b7834e1
, then we would see it hanging as well.

fix picked from 0.4.10-dev-627-g e3a1c2c81b
-------
I also muted a forgotten DPRINT1, like it was done during 0.4.10-dev'ing on master
and fixed some whitespace indentation, like it was done during 0.4.9-dev'ing on master
This commit is contained in:
Joachim Henze 2022-03-04 23:59:26 +01:00
parent e061407748
commit 74201126b6

View file

@ -1234,36 +1234,36 @@ DWORD RControlService(
if (dwError == ERROR_SUCCESS)
{
if (dwControl == SERVICE_CONTROL_STOP ||
dwControl == SERVICE_CONTROL_PAUSE ||
dwControl == SERVICE_CONTROL_CONTINUE)
if (dwControl == SERVICE_CONTROL_STOP ||
dwControl == SERVICE_CONTROL_PAUSE ||
dwControl == SERVICE_CONTROL_CONTINUE)
{
/* Log a successful send control */
switch (dwControl)
{
/* Log a successful send control */
case SERVICE_CONTROL_STOP:
uID = IDS_SERVICE_STOP;
break;
switch (dwControl)
{
case SERVICE_CONTROL_STOP:
uID = IDS_SERVICE_STOP;
break;
case SERVICE_CONTROL_PAUSE:
uID = IDS_SERVICE_PAUSE;
break;
case SERVICE_CONTROL_PAUSE:
uID = IDS_SERVICE_PAUSE;
break;
case SERVICE_CONTROL_CONTINUE:
uID = IDS_SERVICE_RESUME;
break;
}
LoadStringW(GetModuleHandle(NULL), uID, szLogBuffer, 80);
lpLogStrings[0] = lpService->lpDisplayName;
lpLogStrings[1] = szLogBuffer;
ScmLogEvent(EVENT_SERVICE_CONTROL_SUCCESS,
EVENTLOG_INFORMATION_TYPE,
2,
lpLogStrings);
case SERVICE_CONTROL_CONTINUE:
uID = IDS_SERVICE_RESUME;
break;
}
LoadStringW(GetModuleHandle(NULL), uID, szLogBuffer, 80);
lpLogStrings[0] = lpService->lpDisplayName;
lpLogStrings[1] = szLogBuffer;
ScmLogEvent(EVENT_SERVICE_CONTROL_SUCCESS,
EVENTLOG_INFORMATION_TYPE,
2,
lpLogStrings);
}
}
return dwError;
@ -2436,7 +2436,6 @@ DWORD RCreateServiceW(
goto done;
}
DPRINT1("\n");
/* Write the security descriptor */
dwError = ScmWriteSecurityDescriptor(hServiceKey,
lpService->pSecurityDescriptor);
@ -4936,7 +4935,7 @@ DWORD RChangeServiceConfig2A(
SC_RPC_HANDLE hService,
SC_RPC_CONFIG_INFOA Info)
{
SC_RPC_CONFIG_INFOW InfoW;
SC_RPC_CONFIG_INFOW InfoW = { 0 };
DWORD dwRet, dwLength;
PVOID ptr = NULL;