diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 3f69910065d..999b4caf16b 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -415,6 +415,9 @@ extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL cr extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ); +extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val); + extern DWORD msi_version_str_to_dword(LPCWSTR p); extern LPWSTR msi_version_dword_to_str(DWORD version); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index c7a7e8adf91..7c6eca1b632 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -369,6 +369,32 @@ LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val return r; } +LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ) +{ + DWORD len = 0; + LPWSTR val; + LONG r; + + r = RegQueryValueExW(hkey, name, NULL, NULL, NULL, &len); + if (r != ERROR_SUCCESS) + return NULL; + + len += sizeof (WCHAR); + val = msi_alloc( len ); + if (!val) + return NULL; + val[0] = 0; + RegQueryValueExW(hkey, name, NULL, NULL, (LPBYTE) val, &len); + return val; +} + +BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val) +{ + DWORD type, len = sizeof (DWORD); + LONG r = RegQueryValueExW(hkey, name, NULL, &type, (LPBYTE) val, &len); + return r == ERROR_SUCCESS && type == REG_DWORD; +} + UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create) { UINT rc;