From 4ee6c762d2ee2ab152438393722530c0a32615ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 25 Oct 2005 15:43:06 +0000 Subject: [PATCH] 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 --- reactos/lib/setupapi/devinst.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 587b45836b3..3c9c42568d2 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -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);