Author: ekohl
Date: Fri Aug 29 17:31:54 2008
New Revision: 35770
URL:
http://svn.reactos.org/svn/reactos?rev=35770&view=rev
Log:
QueryServiceConfig2A/W: Add more parameter checks. Fixes 3 winetest failures.
Modified:
trunk/reactos/dll/win32/advapi32/service/scm.c
Modified: trunk/reactos/dll/win32/advapi32/service/scm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Fri Aug 29 17:31:54 2008
@@ -1831,7 +1831,15 @@
TRACE("QueryServiceConfig2A(%p, %lu, %p, %lu, %p)\n",
hService, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded);
- if (lpBuffer == NULL && cbBufSize != 0)
+ if (dwInfoLevel != SERVICE_CONFIG_DESCRIPTION &&
+ dwInfoLevel != SERVICE_CONFIG_FAILURE_ACTIONS)
+ {
+ SetLastError(ERROR_INVALID_LEVEL);
+ return FALSE;
+ }
+
+ if ((lpBuffer == NULL && cbBufSize != 0) ||
+ pcbBytesNeeded == NULL)
{
SetLastError(ERROR_INVALID_ADDRESS);
return FALSE;
@@ -1921,7 +1929,15 @@
TRACE("QueryServiceConfig2W(%p, %lu, %p, %lu, %p)\n",
hService, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded);
- if (lpBuffer == NULL && cbBufSize != 0)
+ if (dwInfoLevel != SERVICE_CONFIG_DESCRIPTION &&
+ dwInfoLevel != SERVICE_CONFIG_FAILURE_ACTIONS)
+ {
+ SetLastError(ERROR_INVALID_LEVEL);
+ return FALSE;
+ }
+
+ if ((lpBuffer == NULL && cbBufSize != 0) ||
+ pcbBytesNeeded == NULL)
{
SetLastError(ERROR_INVALID_ADDRESS);
return FALSE;