From d55ca68f7d77e14c9053d2047a0fa3ff3323f9a6 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 1 Nov 2024 22:17:02 +0100 Subject: [PATCH] [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@reactos.org) + * 2005-2006 HervĂ© Poussineau (hpoussin@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);