Return STATUS_INSUFFICIENT_BUFFER in SetupDiGetDeviceRegistryPropertyW if buffer for data was not specified.

This is not the same behaviour as RegQueryValueExW which returns a success in this case...

svn path=/trunk/; revision=18772
This commit is contained in:
Hervé Poussineau 2005-10-25 15:43:06 +00:00
parent 9c0aa86aa7
commit 4ee6c762d2

View file

@ -2383,7 +2383,10 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
*RequiredSize = BufferSize;
switch(rc) {
case ERROR_SUCCESS:
ret = TRUE;
if (PropertyBuffer != NULL || BufferSize == 0)
ret = TRUE;
else
SetLastError(ERROR_INSUFFICIENT_BUFFER);
break;
case ERROR_MORE_DATA:
SetLastError(ERROR_INSUFFICIENT_BUFFER);