mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +00:00
- Fix returned length for RGetServiceKeyNameW
- Perform parameters check in right order in ROpenServiceW svn path=/trunk/; revision=39420
This commit is contained in:
parent
c6c028fe41
commit
e35599aa1e
1 changed files with 7 additions and 7 deletions
|
@ -2445,12 +2445,6 @@ DWORD ROpenServiceW(
|
||||||
if (ScmShutdown)
|
if (ScmShutdown)
|
||||||
return ERROR_SHUTDOWN_IN_PROGRESS;
|
return ERROR_SHUTDOWN_IN_PROGRESS;
|
||||||
|
|
||||||
if (!lpServiceHandle)
|
|
||||||
return ERROR_INVALID_PARAMETER;
|
|
||||||
|
|
||||||
if (!lpServiceName)
|
|
||||||
return ERROR_INVALID_ADDRESS;
|
|
||||||
|
|
||||||
hManager = (PMANAGER_HANDLE)hSCManager;
|
hManager = (PMANAGER_HANDLE)hSCManager;
|
||||||
if (!hManager || hManager->Handle.Tag != MANAGER_TAG)
|
if (!hManager || hManager->Handle.Tag != MANAGER_TAG)
|
||||||
{
|
{
|
||||||
|
@ -2458,6 +2452,12 @@ DWORD ROpenServiceW(
|
||||||
return ERROR_INVALID_HANDLE;
|
return ERROR_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lpServiceHandle)
|
||||||
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
if (!lpServiceName)
|
||||||
|
return ERROR_INVALID_ADDRESS;
|
||||||
|
|
||||||
/* FIXME: Lock the service list */
|
/* FIXME: Lock the service list */
|
||||||
|
|
||||||
/* Get service database entry */
|
/* Get service database entry */
|
||||||
|
@ -2872,7 +2872,7 @@ DWORD RGetServiceKeyNameW(
|
||||||
|
|
||||||
dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER;
|
dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER;
|
||||||
|
|
||||||
*lpcchBuffer = dwLength * 2;
|
*lpcchBuffer = dwLength;
|
||||||
|
|
||||||
return dwError;
|
return dwError;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue