Module: wine Branch: refs/heads/master Commit: 869495efd3b9ed7b1f7d984583b6edecf6fd0368 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=869495efd3b9ed7b1f7d9845... Author: Mike McCormack <mike(a)codeweavers.com> Date: Fri Jul 21 14:05:15 2006 +0900 msi: Use msi_reg_get_val_str() to read a registry value. --- dlls/msi/msi.c | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 0d74524..38e7ce6 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1572,22 +1572,11 @@ UINT WINAPI MsiProvideQualifiedComponent if (rc != ERROR_SUCCESS) return ERROR_INDEX_ABSENT; - sz = 0; - rc = RegQueryValueExW( hkey, szQualifier, NULL, NULL, NULL, &sz); - if (sz <= 0) - { - RegCloseKey(hkey); - return ERROR_INDEX_ABSENT; - } + info = msi_reg_get_val_str( hkey, szQualifier ); + RegCloseKey(hkey); - info = msi_alloc(sz); - rc = RegQueryValueExW( hkey, szQualifier, NULL, NULL, (LPBYTE)info, &sz); - if (rc != ERROR_SUCCESS) - { - RegCloseKey(hkey); - msi_free(info); + if (!info) return ERROR_INDEX_ABSENT; - } MsiDecomposeDescriptorW(info, product, feature, component, &sz); @@ -1596,7 +1585,6 @@ UINT WINAPI MsiProvideQualifiedComponent else rc = MsiGetComponentPathW(szProduct, component, lpPathBuf, pcchPathBuf); - RegCloseKey(hkey); msi_free(info); if (rc == INSTALLSTATE_LOCAL)