James Hawkins : msi: If the user product key exists, the product' s state is advertised.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 27 09:11:20 CDT 2007


Module: wine
Branch: master
Commit: 15823e1acfab45d975a0239efd9fafa7e8dd741e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=15823e1acfab45d975a0239efd9fafa7e8dd741e

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Jun 26 16:36:02 2007 -0700

msi: If the user product key exists, the product's state is advertised.

---

 dlls/msi/msi.c       |   17 +++++++++--------
 dlls/msi/tests/msi.c |   15 +++------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 05d3bbf..7240ea4 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -762,7 +762,7 @@ INSTALLSTATE WINAPI MsiQueryProductStateA(LPCSTR szProduct)
 INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
 {
     UINT rc;
-    INSTALLSTATE rrc = INSTALLSTATE_UNKNOWN;
+    INSTALLSTATE state = INSTALLSTATE_UNKNOWN;
     HKEY hkey = 0;
     DWORD sz;
 
@@ -780,31 +780,32 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
     if (rc != ERROR_SUCCESS)
         goto end;
 
+    state = INSTALLSTATE_ADVERTISED;
     RegCloseKey(hkey);
 
     rc = MSIREG_OpenUninstallKey(szProduct,&hkey,FALSE);
     if (rc != ERROR_SUCCESS)
         goto end;
 
-    sz = sizeof(rrc);
-    rc = RegQueryValueExW(hkey,szWindowsInstaller,NULL,NULL,(LPVOID)&rrc, &sz);
+    sz = sizeof(state);
+    rc = RegQueryValueExW(hkey,szWindowsInstaller,NULL,NULL,(LPVOID)&state, &sz);
     if (rc != ERROR_SUCCESS)
         goto end;
 
-    switch (rrc)
+    switch (state)
     {
     case 1:
         /* default */
-        rrc = INSTALLSTATE_DEFAULT;
+        state = INSTALLSTATE_DEFAULT;
         break;
     default:
-        FIXME("Unknown install state read from registry (%i)\n",rrc);
-        rrc = INSTALLSTATE_UNKNOWN;
+        FIXME("Unknown install state read from registry (%i)\n",state);
+        state = INSTALLSTATE_UNKNOWN;
         break;
     }
 end:
     RegCloseKey(hkey);
-    return rrc;
+    return state;
 }
 
 INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 06c7276..9afa576 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -377,10 +377,7 @@ static void test_MsiQueryProductState(void)
 
     /* user product key exists */
     state = MsiQueryProductStateA(prodcode);
-    todo_wine
-    {
-        ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
-    }
+    ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
 
     lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
     lstrcatA(keypath, usersid);
@@ -392,20 +389,14 @@ static void test_MsiQueryProductState(void)
 
     /* local product key exists */
     state = MsiQueryProductStateA(prodcode);
-    todo_wine
-    {
-        ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
-    }
+    ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
 
     res = RegCreateKeyA(localkey, "InstallProperties", &props);
     ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
 
     /* install properties key exists */
     state = MsiQueryProductStateA(prodcode);
-    todo_wine
-    {
-        ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
-    }
+    ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state);
 
     data = 1;
     res = RegSetValueExA(props, "WindowsInstaller", 0, REG_DWORD, (const BYTE *)&data, sizeof(DWORD));




More information about the wine-cvs mailing list