From 74e2cfb66c85aa6bd086fc0cda928a515ae8d1ed Mon Sep 17 00:00:00 2001 From: Troy Rollo Date: Fri, 4 Mar 2005 10:47:41 +0000 Subject: [PATCH] Correct incorrect use of arguments to QueryServiceConfigW. --- 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 f40ef39cbcf..75521c2360c 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1803,15 +1803,15 @@ QueryServiceConfigW( 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;