mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 18:10:54 +00:00
EnumDependentServicesA/W and EnumServicesStatusA/W don't fix up pointers if the service manager returns an error.
This fixes bug #3737. Patch by Michael Martin aka bugboy <martinmnet@hotmail.com>. svn path=/trunk/; revision=36383
This commit is contained in:
parent
39a0bb1742
commit
2cbfa7cb91
|
@ -801,6 +801,13 @@ EnumDependentServicesA(SC_HANDLE hService,
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
|
||||||
|
if (dwError != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("REnumDependentServicesA() failed (Error %lu)\n", dwError);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -815,13 +822,6 @@ EnumDependentServicesA(SC_HANDLE hService,
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwError != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("REnumDependentServicesA() failed (Error %lu)\n", dwError);
|
|
||||||
SetLastError(dwError);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("EnumDependentServicesA() done\n");
|
TRACE("EnumDependentServicesA() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -865,6 +865,13 @@ EnumDependentServicesW(SC_HANDLE hService,
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
|
||||||
|
if (dwError != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("REnumDependentServicesW() failed (Error %lu)\n", dwError);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -879,13 +886,6 @@ EnumDependentServicesW(SC_HANDLE hService,
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwError != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("REnumDependentServicesW() failed (Error %lu)\n", dwError);
|
|
||||||
SetLastError(dwError);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("EnumDependentServicesW() done\n");
|
TRACE("EnumDependentServicesW() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -957,6 +957,13 @@ EnumServicesStatusA(SC_HANDLE hSCManager,
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
|
||||||
|
if (dwError != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("REnumServicesStatusA() failed (Error %lu)\n", dwError);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -971,13 +978,6 @@ EnumServicesStatusA(SC_HANDLE hSCManager,
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwError != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("REnumServicesStatusA() failed (Error %lu)\n", dwError);
|
|
||||||
SetLastError(dwError);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("EnumServicesStatusA() done\n");
|
TRACE("EnumServicesStatusA() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1025,6 +1025,13 @@ EnumServicesStatusW(SC_HANDLE hSCManager,
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
|
||||||
|
if (dwError != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("REnumServicesStatusW() failed (Error %lu)\n", dwError);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -1039,13 +1046,6 @@ EnumServicesStatusW(SC_HANDLE hSCManager,
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwError != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("REnumServicesStatusW() failed (Error %lu)\n", dwError);
|
|
||||||
SetLastError(dwError);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("EnumServicesStatusW() done\n");
|
TRACE("EnumServicesStatusW() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue