MSI: implement MsiQueryFeatureStateW

Aric Stewart aric at codeweavers.com
Wed Apr 27 09:49:37 CDT 2005


implement MsiQueryFeatureStateW

-------------- next part --------------
Index: dlls/msi/msi.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msi.c,v
retrieving revision 1.77
diff -u -r1.77 msi.c
--- dlls/msi/msi.c	27 Apr 2005 08:11:52 -0000	1.77
+++ dlls/msi/msi.c	27 Apr 2005 14:48:36 -0000
@@ -1065,14 +1065,30 @@
 
 /******************************************************************
  * MsiQueryFeatureStateW      [MSI.@]
+ *
+ * This does not verify that the Feature is functional. So i am only going to
+ * check the existance of the key in the registry. This should tell me if it is
+ * installed.
  */
 INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
 {
-    FIXME("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature));
-    /*
-     * Iterates all the features components and the features parents components
-     */
-    return INSTALLSTATE_LOCAL;
+    UINT rc;
+    DWORD sz = 0;
+    HKEY hkey;
+
+    TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature));
+
+    rc = MSIREG_OpenFeaturesKey(szProduct, &hkey, FALSE);
+    if (rc != ERROR_SUCCESS)
+        return INSTALLSTATE_UNKNOWN;
+
+    rc = RegQueryValueExW( hkey, szFeature, NULL, NULL, NULL, &sz);
+    RegCloseKey(hkey);
+
+    if (rc == ERROR_SUCCESS)
+        return INSTALLSTATE_LOCAL;
+    else
+        return INSTALLSTATE_ABSENT;
 }
 
 /******************************************************************


More information about the wine-patches mailing list