mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 12:18:13 +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,
|
||||
(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;
|
||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||
{
|
||||
|
@ -975,8 +983,8 @@ EnumServicesStatusExA(SC_HANDLE hSCManager,
|
|||
|
||||
lpStatusPtr++;
|
||||
}
|
||||
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("ScmrEnumServicesStatusExA() failed (Error %lu)\n", dwError);
|
||||
SetLastError(dwError);
|
||||
|
@ -1026,6 +1034,14 @@ EnumServicesStatusExW(SC_HANDLE hSCManager,
|
|||
lpResumeHandle,
|
||||
(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;
|
||||
for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++)
|
||||
{
|
||||
|
@ -1039,9 +1055,8 @@ EnumServicesStatusExW(SC_HANDLE hSCManager,
|
|||
|
||||
lpStatusPtr++;
|
||||
}
|
||||
|
||||
if (dwError != ERROR_SUCCESS &&
|
||||
dwError != ERROR_MORE_DATA)
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("ScmrEnumServicesStatusExW() failed (Error %lu)\n", dwError);
|
||||
SetLastError(dwError);
|
||||
|
|
Loading…
Reference in a new issue