Commit 00fdc6cb authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Use msi_string_lookup_id instead of msi_id2stringW where possible.

parent ace8fd72
...@@ -926,20 +926,7 @@ static void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count ) ...@@ -926,20 +926,7 @@ static void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count )
LPWSTR MSI_makestring( MSIDATABASE *db, UINT stringid) LPWSTR MSI_makestring( MSIDATABASE *db, UINT stringid)
{ {
UINT sz=0, r; return strdupW(msi_string_lookup_id( db->strings, stringid ));
LPWSTR str;
r = msi_id2stringW( db->strings, stringid, NULL, &sz );
if( r != ERROR_SUCCESS )
return NULL;
str = msi_alloc( sz*sizeof (WCHAR) );
if( !str )
return str;
r = msi_id2stringW( db->strings, stringid, str, &sz );
if( r == ERROR_SUCCESS )
return str;
msi_free( str );
return NULL;
} }
static UINT get_tablecolumns( MSIDATABASE *db, static UINT get_tablecolumns( MSIDATABASE *db,
...@@ -1116,7 +1103,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt ...@@ -1116,7 +1103,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
{ {
MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
UINT ival = 0, refcol = 0, r; UINT ival = 0, refcol = 0, r;
LPWSTR sval; LPCWSTR sval;
LPWSTR full_name; LPWSTR full_name;
DWORD len; DWORD len;
static const WCHAR szDot[] = { '.', 0 }; static const WCHAR szDot[] = { '.', 0 };
...@@ -1140,7 +1127,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt ...@@ -1140,7 +1127,7 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
return r; return r;
/* lookup the string value from the string table */ /* lookup the string value from the string table */
sval = MSI_makestring( tv->db, refcol ); sval = msi_string_lookup_id( tv->db->strings, refcol );
if( !sval ) if( !sval )
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
...@@ -1154,7 +1141,6 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt ...@@ -1154,7 +1141,6 @@ static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, ISt
if( r ) if( r )
ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r); ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r);
msi_free( full_name ); msi_free( full_name );
msi_free( sval );
return r; return r;
} }
......
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