Correct incorrect use of arguments to QueryServiceConfigA. Spotted by
Troy Rollo.
This commit is contained in:
parent
695f316c3a
commit
401d4cf42a
|
@ -1655,15 +1655,15 @@ QueryServiceConfigA( 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;
|
||||||
|
|
Loading…
Reference in New Issue