Author: hpoussin
Date: Tue Sep 26 23:44:17 2006
New Revision: 24279
URL:
http://svn.reactos.org/svn/reactos?rev=24279&view=rev
Log:
Merge from Wine:
Frank Richter <frank.richter(a)gmail.com>
setupapi: Duplicate behaviour of native SetupGetInfInformation with NULL ReturnBuffer and
certain ReturnBufferSizes.
Modified:
trunk/reactos/dll/win32/setupapi/query.c
Modified: trunk/reactos/dll/win32/setupapi/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/query.c…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/query.c (original)
+++ trunk/reactos/dll/win32/setupapi/query.c Tue Sep 26 23:44:17 2006
@@ -119,6 +119,7 @@
{
HINF inf;
BOOL ret;
+ DWORD infSize;
TRACE("(%p, %ld, %p, %ld, %p)\n", InfSpec, SearchControl, ReturnBuffer,
ReturnBufferSize, RequiredSize);
@@ -130,12 +131,6 @@
else
SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
-
- if (!ReturnBuffer && ReturnBufferSize)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
@@ -170,7 +165,13 @@
return FALSE;
}
- ret = fill_inf_info(inf, ReturnBuffer, ReturnBufferSize, RequiredSize);
+ ret = fill_inf_info(inf, ReturnBuffer, ReturnBufferSize, &infSize);
+ if (!ReturnBuffer && (ReturnBufferSize >= infSize))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ ret = FALSE;
+ }
+ if (RequiredSize) *RequiredSize = infSize;
if (SearchControl >= INFINFO_INF_NAME_IS_ABSOLUTE)
SetupCloseInfFile(inf);