mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 09:21:31 +00:00
******* TODO: Check whether I want to remove this switch (lerror) thing and use code more similar to Wine's...
[WINESYNC] setupapi: Fix SetupDiGetDeviceRegistryProperty if property does not exist. Signed-off-by: Andrew Wesie <awesie@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id e4645d60d72a9fbfbd745e275d4f90110bdceb4d by Andrew Wesie <awesie@gmail.com> SYNC NOTE: Adapted for ReactOS code. Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
parent
3c8b1d2e0b
commit
4aaaa0687d
|
@ -3312,18 +3312,34 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
||||||
if (RequiredSize)
|
if (RequiredSize)
|
||||||
*RequiredSize = size;
|
*RequiredSize = size;
|
||||||
|
|
||||||
|
#if 0 // Similar to Wine's code
|
||||||
|
if (lError == ERROR_FILE_NOT_FOUND)
|
||||||
|
lError = ERROR_INVALID_DATA;
|
||||||
|
else if (lError == ERROR_MORE_DATA || !PropertyBufferSize)
|
||||||
|
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||||
|
/*
|
||||||
|
else if (lError == ERROR_SUCCESS)
|
||||||
|
ret = TRUE;
|
||||||
|
else
|
||||||
|
SetLastError(lError);
|
||||||
|
*/
|
||||||
|
#else
|
||||||
switch (lError)
|
switch (lError)
|
||||||
{
|
{
|
||||||
case ERROR_SUCCESS:
|
case ERROR_SUCCESS:
|
||||||
if (PropertyBuffer == NULL && size != 0)
|
if (!PropertyBuffer && size != 0)
|
||||||
lError = ERROR_INSUFFICIENT_BUFFER;
|
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||||
break;
|
break;
|
||||||
|
case ERROR_FILE_NOT_FOUND:
|
||||||
|
lError = ERROR_INVALID_DATA;
|
||||||
|
break;
|
||||||
case ERROR_MORE_DATA:
|
case ERROR_MORE_DATA:
|
||||||
lError = ERROR_INSUFFICIENT_BUFFER;
|
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (Property == SPDRP_PHYSICAL_DEVICE_OBJECT_NAME)
|
else if (Property == SPDRP_PHYSICAL_DEVICE_OBJECT_NAME)
|
||||||
{
|
{
|
||||||
|
@ -3373,7 +3389,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
||||||
lError = ERROR_INSUFFICIENT_BUFFER;
|
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default:
|
||||||
lError = ERROR_INVALID_DATA;
|
lError = ERROR_INVALID_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,4 @@ files:
|
||||||
dlls/setupapi/misc.c: dll/win32/setupapi/misc.c
|
dlls/setupapi/misc.c: dll/win32/setupapi/misc.c
|
||||||
dlls/setupapi/stubs.c: dll/win32/setupapi/stubs.c
|
dlls/setupapi/stubs.c: dll/win32/setupapi/stubs.c
|
||||||
tags:
|
tags:
|
||||||
wine: 852cd999f3de5b95444b99a1912ed6900a64a37b
|
wine: e4645d60d72a9fbfbd745e275d4f90110bdceb4d
|
||||||
|
|
Loading…
Reference in a new issue