Correct incorrect use of arguments to QueryServiceConfigW.

This commit is contained in:
Troy Rollo 2005-03-04 10:47:41 +00:00 committed by Alexandre Julliard
parent 5b4327515e
commit 74e2cfb66c
1 changed files with 3 additions and 3 deletions

View File

@ -1803,15 +1803,15 @@ QueryServiceConfigW( SC_HANDLE hService,
if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) )
total += sz; total += sz;
*pcbBytesNeeded = total;
/* if there's not enough memory, return an error */ /* if there's not enough memory, return an error */
if( total > *pcbBytesNeeded ) if( total > cbBufSize )
{ {
*pcbBytesNeeded = total;
SetLastError( ERROR_INSUFFICIENT_BUFFER ); SetLastError( ERROR_INSUFFICIENT_BUFFER );
return FALSE; return FALSE;
} }
*pcbBytesNeeded = total;
ZeroMemory( lpServiceConfig, total ); ZeroMemory( lpServiceConfig, total );
sz = sizeof val; sz = sizeof val;