From ece85e0cf0868819abb43f4d43174cc39139298b Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 28 Apr 2005 12:01:06 +0000 Subject: [PATCH] Implement MsiQueryFeatureStateW. --- dlls/msi/msi.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index e39459ee9e3..a0f67146ff5 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1065,14 +1065,30 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature) /****************************************************************** * MsiQueryFeatureStateW [MSI.@] + * + * This does not verify that the Feature is functional. So i am only going to + * check the existence 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; } /******************************************************************