From 401d4cf42af7af648f2823841df0c74a18728772 Mon Sep 17 00:00:00 2001 From: Alexander Yaworsky Date: Thu, 10 Mar 2005 11:14:04 +0000 Subject: [PATCH] Correct incorrect use of arguments to QueryServiceConfigA. Spotted by Troy Rollo. --- dlls/advapi32/service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index a0162aafd27..016d12b3f50 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1655,15 +1655,15 @@ QueryServiceConfigA( SC_HANDLE hService, if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) total += sz; + *pcbBytesNeeded = total; + /* if there's not enough memory, return an error */ - if( total > *pcbBytesNeeded ) + if( total > cbBufSize ) { - *pcbBytesNeeded = total; SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; } - *pcbBytesNeeded = total; ZeroMemory( lpServiceConfig, total ); sz = sizeof val;