Commit 869495ef authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Use msi_reg_get_val_str() to read a registry value.

parent db1baf73
...@@ -1572,22 +1572,11 @@ UINT WINAPI MsiProvideQualifiedComponentExW(LPCWSTR szComponent, ...@@ -1572,22 +1572,11 @@ UINT WINAPI MsiProvideQualifiedComponentExW(LPCWSTR szComponent,
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return ERROR_INDEX_ABSENT; return ERROR_INDEX_ABSENT;
sz = 0; info = msi_reg_get_val_str( hkey, szQualifier );
rc = RegQueryValueExW( hkey, szQualifier, NULL, NULL, NULL, &sz); RegCloseKey(hkey);
if (sz <= 0)
{
RegCloseKey(hkey);
return ERROR_INDEX_ABSENT;
}
info = msi_alloc(sz); if (!info)
rc = RegQueryValueExW( hkey, szQualifier, NULL, NULL, (LPBYTE)info, &sz);
if (rc != ERROR_SUCCESS)
{
RegCloseKey(hkey);
msi_free(info);
return ERROR_INDEX_ABSENT; return ERROR_INDEX_ABSENT;
}
MsiDecomposeDescriptorW(info, product, feature, component, &sz); MsiDecomposeDescriptorW(info, product, feature, component, &sz);
...@@ -1596,7 +1585,6 @@ UINT WINAPI MsiProvideQualifiedComponentExW(LPCWSTR szComponent, ...@@ -1596,7 +1585,6 @@ UINT WINAPI MsiProvideQualifiedComponentExW(LPCWSTR szComponent,
else else
rc = MsiGetComponentPathW(szProduct, component, lpPathBuf, pcchPathBuf); rc = MsiGetComponentPathW(szProduct, component, lpPathBuf, pcchPathBuf);
RegCloseKey(hkey);
msi_free(info); msi_free(info);
if (rc == INSTALLSTATE_LOCAL) if (rc == INSTALLSTATE_LOCAL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment