[1/4] msi: Fix install state detection for registry components.

Hans Leidekker hans at codeweavers.com
Fri Apr 20 03:55:52 CDT 2012


Note that I'm reusing a duplicate test.
---
 dlls/msi/msi.c       |    2 +-
 dlls/msi/tests/msi.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 4d18265..4783573 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -2217,7 +2217,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
     else
     {
         if (lstrlenW(val) > 2 &&
-            val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9')
+            val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9' && val[2] != ':')
         {
             *pdwState = INSTALLSTATE_SOURCE;
         }
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 8768d2a..f7d0717 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -1646,10 +1646,10 @@ static void test_MsiQueryComponentState(void)
     ok(state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
     ok(error == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", error);
 
-    res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"01", 3);
+    res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"01:", 4);
     ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
 
-    /* bad INSTALLSTATE_SOURCE */
+    /* registry component */
     state = MAGIC_ERROR;
     SetLastError(0xdeadbeef);
     r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
-- 
1.7.5.4







More information about the wine-patches mailing list