mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
fix SetLastError value ERROR_MORE_DATA -> ERROR_INSUFFICIENT_BUFFER
svn path=/trunk/; revision=18668
This commit is contained in:
parent
786e945883
commit
f1fcff6a3b
1 changed files with 11 additions and 5 deletions
|
@ -2153,7 +2153,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(
|
||||||
PropertyBufferSizeW,
|
PropertyBufferSizeW,
|
||||||
&RequiredSizeW);
|
&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);
|
bIsStringProperty = (RegType == REG_SZ || RegType == REG_MULTI_SZ || RegType == REG_EXPAND_SZ);
|
||||||
|
|
||||||
|
@ -2327,10 +2327,16 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
||||||
&BufferSize);
|
&BufferSize);
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
*RequiredSize = BufferSize;
|
*RequiredSize = BufferSize;
|
||||||
if (rc == ERROR_SUCCESS)
|
switch(rc) {
|
||||||
|
case ERROR_SUCCESS:
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
else
|
break;
|
||||||
|
case ERROR_MORE_DATA:
|
||||||
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue