mirror of
https://github.com/reactos/reactos.git
synced 2024-09-09 20:30:04 +00:00
- ensure SetLastError is called when EnumServicesStatusEx is returning required buffer sizes
- servman.exe now lists all ReactOS services svn path=/trunk/; revision=27423
This commit is contained in:
parent
771911b3ab
commit
843b40c7ad
|
@ -962,6 +962,14 @@ EnumServicesStatusExA(SC_HANDLE hSCManager,
|
||||||
lpResumeHandle,
|
lpResumeHandle,
|
||||||
(char *)pszGroupName);
|
(char *)pszGroupName);
|
||||||
|
|
||||||
|
if (dwError == ERROR_MORE_DATA)
|
||||||
|
{
|
||||||
|
DPRINT("Required buffer size %ul\n", *pcbBytesNeeded);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else if (dwError == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSA)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSA)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -975,8 +983,8 @@ EnumServicesStatusExA(SC_HANDLE hSCManager,
|
||||||
|
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (dwError != ERROR_SUCCESS)
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("ScmrEnumServicesStatusExA() failed (Error %lu)\n", dwError);
|
DPRINT1("ScmrEnumServicesStatusExA() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
|
@ -1026,6 +1034,14 @@ EnumServicesStatusExW(SC_HANDLE hSCManager,
|
||||||
lpResumeHandle,
|
lpResumeHandle,
|
||||||
(wchar_t *)pszGroupName);
|
(wchar_t *)pszGroupName);
|
||||||
|
|
||||||
|
if (dwError == ERROR_MORE_DATA)
|
||||||
|
{
|
||||||
|
DPRINT("Required buffer size %ul\n", *pcbBytesNeeded);
|
||||||
|
SetLastError(dwError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else if (dwError == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSW)lpServices;
|
lpStatusPtr = (LPENUM_SERVICE_STATUS_PROCESSW)lpServices;
|
||||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||||
{
|
{
|
||||||
|
@ -1039,9 +1055,8 @@ EnumServicesStatusExW(SC_HANDLE hSCManager,
|
||||||
|
|
||||||
lpStatusPtr++;
|
lpStatusPtr++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (dwError != ERROR_SUCCESS &&
|
else
|
||||||
dwError != ERROR_MORE_DATA)
|
|
||||||
{
|
{
|
||||||
DPRINT1("ScmrEnumServicesStatusExW() failed (Error %lu)\n", dwError);
|
DPRINT1("ScmrEnumServicesStatusExW() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
|
|
Loading…
Reference in a new issue