https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d55ca68f7d77e14c9053d…
commit d55ca68f7d77e14c9053d2047a0fa3ff3323f9a6
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Fri Nov 1 22:17:02 2024 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Fri Nov 1 22:17:02 2024 +0100
[SETUPAPI] SETUP_CreateDevicesList must return ERROR_INVALID_DATA when the Enumerator
is invalid
This fixes the devclass apitest.
---
dll/win32/setupapi/devclass.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dll/win32/setupapi/devclass.c b/dll/win32/setupapi/devclass.c
index 7f94eebdb94..b8f78401598 100644
--- a/dll/win32/setupapi/devclass.c
+++ b/dll/win32/setupapi/devclass.c
@@ -2,7 +2,7 @@
* SetupAPI device class-related functions
*
* Copyright 2000 Andreas Mohr for CodeWeavers
- * 2005-2006 Herv� Poussineau (hpoussin(a)reactos.org)
+ * 2005-2006 Hervé Poussineau (hpoussin(a)reactos.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -159,7 +159,7 @@ SETUP_CreateDevicesList(
TRACE("CM_Get_Device_ID_List_ExW() failed with status 0x%x\n",
cr);
if (Buffer)
HeapFree(GetProcessHeap(), 0, Buffer);
- return GetErrorCodeFromCrCode(cr);
+ return (cr == CR_REGISTRY_ERROR) ? ERROR_INVALID_DATA :
GetErrorCodeFromCrCode(cr);
}
}
while (cr != CR_SUCCESS);