diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index 33a7fa25398..45d3ebe86e8 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -71,35 +71,6 @@ LPWSTR msi_dup_record_field( MSIRECORD *row, INT index ) return strdupW( MSI_RecordGetString(row,index) ); } -LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop) -{ - DWORD sz = 0; - LPWSTR str; - UINT r; - - r = MSI_GetPropertyW(package, prop, NULL, &sz); - if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA) - return NULL; - - sz++; - str = msi_alloc(sz*sizeof(WCHAR)); - r = MSI_GetPropertyW(package, prop, str, &sz); - if (r != ERROR_SUCCESS) - { - msi_free(str); - str = NULL; - } - return str; -} - -int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def ) -{ - LPWSTR str = msi_dup_property( package, prop ); - int val = str ? atoiW( str ) : def; - msi_free( str ); - return val; -} - MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ) { MSICOMPONENT *comp; diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 13fd6cee316..227be6cd638 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -1001,7 +1001,7 @@ UINT MSI_GetPropertyW( MSIPACKAGE *package, LPCWSTR szName, if ( *pchValueBuf <= len ) { - TRACE("have %lu, need %lu -> ERROR_MORE_DATA\n", *pchValueBuf, len); + TRACE("have %lu, need %u -> ERROR_MORE_DATA\n", *pchValueBuf, len); r = ERROR_MORE_DATA; } else @@ -1012,6 +1012,28 @@ UINT MSI_GetPropertyW( MSIPACKAGE *package, LPCWSTR szName, return r; } +LPWSTR msi_dup_property( MSIPACKAGE *package, LPCWSTR szName ) +{ + msi_property *prop; + LPWSTR value = NULL; + + prop = msi_prop_find( package, szName ); + if (prop) + value = strdupW( prop->value ); + + return value; +} + +int msi_get_property_int( MSIPACKAGE *package, LPCWSTR name, int value ) +{ + msi_property *prop; + + prop = msi_prop_find( package, name ); + if (prop) + value = atoiW( prop->value ); + return value; +} + static UINT MSI_GetProperty( MSIHANDLE handle, LPCWSTR name, awstring *szValueBuf, DWORD* pchValueBuf ) {