mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +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
42c39fb66a
commit
936f020646
2 changed files with 19 additions and 3 deletions
|
@ -3312,18 +3312,34 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
|||
if (RequiredSize)
|
||||
*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)
|
||||
{
|
||||
case ERROR_SUCCESS:
|
||||
if (PropertyBuffer == NULL && size != 0)
|
||||
if (!PropertyBuffer && size != 0)
|
||||
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||
break;
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
lError = ERROR_INVALID_DATA;
|
||||
break;
|
||||
case ERROR_MORE_DATA:
|
||||
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (Property == SPDRP_PHYSICAL_DEVICE_OBJECT_NAME)
|
||||
{
|
||||
|
@ -3373,7 +3389,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
|||
lError = ERROR_INSUFFICIENT_BUFFER;
|
||||
break;
|
||||
|
||||
default :
|
||||
default:
|
||||
lError = ERROR_INVALID_DATA;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@ files:
|
|||
dlls/setupapi/misc.c: dll/win32/setupapi/misc.c
|
||||
dlls/setupapi/stubs.c: dll/win32/setupapi/stubs.c
|
||||
tags:
|
||||
wine: 852cd999f3de5b95444b99a1912ed6900a64a37b
|
||||
wine: e4645d60d72a9fbfbd745e275d4f90110bdceb4d
|
||||
|
|
Loading…
Reference in a new issue