James Hawkins : setupapi: Handle the INFINFO_REVERSE_DEFAULT_SEARCH search flag.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 14 07:28:23 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 94515450fac20ad00246b4d1ceeeaa8a7ae35ffa
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=94515450fac20ad00246b4d1ceeeaa8a7ae35ffa

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Feb 14 12:23:58 2006 +0100

setupapi: Handle the INFINFO_REVERSE_DEFAULT_SEARCH search flag.

---

 dlls/setupapi/query.c       |   32 ++++++++++++++++++++++++++++++++
 dlls/setupapi/tests/query.c |    7 ++-----
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c
index 1f4478e..957cba6 100644
--- a/dlls/setupapi/query.c
+++ b/dlls/setupapi/query.c
@@ -60,6 +60,36 @@ static BOOL fill_inf_info(HINF inf, PSP_
     return TRUE;
 }
 
+static HINF search_for_inf(LPCVOID InfSpec, DWORD SearchControl)
+{
+    HINF hInf = INVALID_HANDLE_VALUE;
+    WCHAR inf_path[MAX_PATH];
+
+    static const WCHAR infW[] = {'\\','i','n','f','\\',0};
+    static const WCHAR system32W[] = {'\\','s','y','s','t','e','m','3','2','\\',0};
+
+    if (SearchControl == INFINFO_REVERSE_DEFAULT_SEARCH)
+    {
+        GetWindowsDirectoryW(inf_path, MAX_PATH);
+        lstrcatW(inf_path, system32W);
+        lstrcatW(inf_path, InfSpec);
+
+        hInf = SetupOpenInfFileW(inf_path, NULL,
+                                 INF_STYLE_OLDNT | INF_STYLE_WIN4, NULL);
+        if (hInf != INVALID_HANDLE_VALUE)
+            return hInf;
+
+        GetWindowsDirectoryW(inf_path, MAX_PATH);
+        lstrcpyW(inf_path, infW);
+        lstrcatW(inf_path, InfSpec);
+
+        return SetupOpenInfFileW(inf_path, NULL,
+                                 INF_STYLE_OLDNT | INF_STYLE_WIN4, NULL);
+    }
+
+    return INVALID_HANDLE_VALUE;
+}
+
 /***********************************************************************
  *      SetupGetInfInformationA    (SETUPAPI.@)
  *
@@ -131,6 +161,8 @@ BOOL WINAPI SetupGetInfInformationW(LPCV
                                     INF_STYLE_OLDNT | INF_STYLE_WIN4, NULL);
             break;
         case INFINFO_REVERSE_DEFAULT_SEARCH:
+            inf = search_for_inf(InfSpec, SearchControl);
+            break;
         case INFINFO_INF_PATH_LIST_SEARCH:
             FIXME("Unhandled search control: %ld\n", SearchControl);
 
diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c
index c5581f8..1113aa1 100644
--- a/dlls/setupapi/tests/query.c
+++ b/dlls/setupapi/tests/query.c
@@ -231,11 +231,8 @@ static void test_SetupGetInfInformation(
 
     /* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */
     ret = pSetupGetInfInformationA("test.inf", INFINFO_REVERSE_DEFAULT_SEARCH, info, size, &size);
-    todo_wine
-    {
-        ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n");
-        ok(check_info_filename(info, inf_two), "Expected returned filename to be equal\n");
-    }
+    ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n");
+    ok(check_info_filename(info, inf_two), "Expected returned filename to be equal\n");
 
     DeleteFileA(inf_filename);
     DeleteFileA(inf_one);




More information about the wine-cvs mailing list