From f1fcff6a3bbc73aef6651b68c50fb1e38766584f Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 21 Oct 2005 23:40:09 +0000 Subject: [PATCH] fix SetLastError value ERROR_MORE_DATA -> ERROR_INSUFFICIENT_BUFFER svn path=/trunk/; revision=18668 --- reactos/lib/setupapi/devinst.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 3291285a75d..6c50c1b7925 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -2153,7 +2153,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA( PropertyBufferSizeW, &RequiredSizeW); - if (bResult || GetLastError() == ERROR_MORE_DATA) + if (bResult || GetLastError() == ERROR_INSUFFICIENT_BUFFER) { bIsStringProperty = (RegType == REG_SZ || RegType == REG_MULTI_SZ || RegType == REG_EXPAND_SZ); @@ -2327,10 +2327,16 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW( &BufferSize); if (RequiredSize) *RequiredSize = BufferSize; - if (rc == ERROR_SUCCESS) - ret = TRUE; - else - SetLastError(rc); + switch(rc) { + case ERROR_SUCCESS: + ret = TRUE; + break; + case ERROR_MORE_DATA: + SetLastError(ERROR_INSUFFICIENT_BUFFER); + break; + default: + SetLastError(rc); + } RegCloseKey(hKey); break; }