From 66242cc2c649de610b67a2517ff1124ea07b0e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 26 Oct 2005 18:19:20 +0000 Subject: [PATCH] Fix some corner-cases (no .inf file in provided directory when creating driver list, or no suitable driver when destroying driver list) svn path=/trunk/; revision=18777 --- reactos/lib/setupapi/devinst.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 3c9c42568d2..11f4aec60d0 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -4314,6 +4314,14 @@ SetupDiBuildDriverInfoList( Buffer, RequiredSize, &RequiredSize); } + if (!Result && GetLastError() == ERROR_FILE_NOT_FOUND) + { + /* No .inf file in specified directory. So, we should + * success as we created an empty driver info list. + */ + ret = TRUE; + goto done; + } if (Result) { LPCWSTR filename; @@ -4604,18 +4612,6 @@ SetupDiDestroyDriverInfoList( if (!DeviceInfoData) /* Fall back to destroying class driver list */ DriverType = SPDIT_CLASSDRIVER; - if (DriverType == SPDIT_CLASSDRIVER) - { - if (!(InstallParams.Flags & DI_DIDCLASS)) - /* The list was not created */ - goto done; - } - else if (DriverType == SPDIT_COMPATDRIVER) - { - if (!(InstallParams.Flags & DI_DIDCOMPAT)) - /* The list was not created */ - goto done; - } if (DriverType == SPDIT_CLASSDRIVER) {