summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-30 09:34:13 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-06 20:30:31 +0100
commit81b8e5443e79ca264d23c5383a21b85ae6d56d69 (patch)
tree38bf0b0348f0e1ce73f6cff654da6e2172f46766
parent0eab29cb2cd62c7869c97b94c50af8fd26734e19 (diff)
downloadmsitools-81b8e5443e79ca264d23c5383a21b85ae6d56d69.tar.gz
msitools-81b8e5443e79ca264d23c5383a21b85ae6d56d69.tar.xz
msitools-81b8e5443e79ca264d23c5383a21b85ae6d56d69.zip
remove Unicode APIs
-rw-r--r--include/libmsi.h3
-rw-r--r--libmsi/database.c48
-rw-r--r--libmsi/msipriv.h14
-rw-r--r--libmsi/msiquery.c116
-rw-r--r--libmsi/record.c37
-rw-r--r--libmsi/suminfo.c196
6 files changed, 80 insertions, 334 deletions
diff --git a/include/libmsi.h b/include/libmsi.h
index de6efd1..d5a274b 100644
--- a/include/libmsi.h
+++ b/include/libmsi.h
@@ -161,7 +161,6 @@ unsigned MsiRecordGetFieldCount(LibmsiObject *);
int MsiRecordGetInteger(LibmsiObject *,unsigned);
unsigned MsiRecordDataSize(LibmsiObject *,unsigned);
bool MsiRecordIsNull(LibmsiObject *,unsigned);
-unsigned MsiFormatRecord(LibmsiObject *,LibmsiObject *,char *,unsigned *);
unsigned MsiRecordSetStream(LibmsiObject *,unsigned,const char *);
unsigned MsiRecordReadStream(LibmsiObject *,unsigned,char*,unsigned *);
@@ -173,8 +172,6 @@ unsigned MsiDatabaseApplyTransform(LibmsiObject *,const char *,int);
unsigned MsiViewGetColumnInfo(LibmsiObject *, LibmsiColInfo, LibmsiObject **);
-unsigned MsiCreateTransformSummaryInfo(LibmsiObject *, LibmsiObject *, const char *, int, int);
-
unsigned MsiSummaryInfoGetProperty(LibmsiObject *,unsigned,unsigned *,int *,uint64_t*,char *,unsigned *);
unsigned MsiSummaryInfoSetProperty(LibmsiObject *, unsigned, unsigned, int, uint64_t*, const char *);
diff --git a/libmsi/database.c b/libmsi/database.c
index f8d02fe..c40cbbe 100644
--- a/libmsi/database.c
+++ b/libmsi/database.c
@@ -1159,26 +1159,10 @@ done:
*
* row4 : data <tab> data <tab> data <tab> ... data <cr> <lf>
*/
-unsigned MsiDatabaseExportW( LibmsiObject *handle, const WCHAR *szTable,
- int fd )
-{
- LibmsiDatabase *db;
- unsigned r;
-
- TRACE("%x %s %s %s\n", handle, debugstr_w(szTable),
- debugstr_w(szFolder), debugstr_w(szFilename));
-
- db = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_DATABASE );
- if( !db )
- return ERROR_INVALID_HANDLE;
- r = MSI_DatabaseExport( db, szTable, fd );
- msiobj_release( &db->hdr );
- return r;
-}
-
unsigned MsiDatabaseExport( LibmsiObject *handle, const char *szTable,
int fd )
{
+ LibmsiDatabase *db;
WCHAR *path = NULL;
WCHAR *file = NULL;
WCHAR *table = NULL;
@@ -1194,7 +1178,11 @@ unsigned MsiDatabaseExport( LibmsiObject *handle, const char *szTable,
goto end;
}
- r = MsiDatabaseExportW( handle, table, fd );
+ db = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_DATABASE );
+ if( !db )
+ return ERROR_INVALID_HANDLE;
+ r = MSI_DatabaseExport( db, table, fd );
+ msiobj_release( &db->hdr );
end:
msi_free( table );
@@ -1204,22 +1192,6 @@ end:
return r;
}
-unsigned MsiDatabaseMerge(LibmsiObject *hDatabase, LibmsiObject *hDatabaseMerge,
- const char *szTableName)
-{
- unsigned r;
- WCHAR *table;
-
- TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge,
- debugstr_a(szTableName));
-
- table = strdupAtoW(szTableName);
- r = MsiDatabaseMergeW(hDatabase, hDatabaseMerge, table);
-
- msi_free(table);
- return r;
-}
-
typedef struct _tagMERGETABLE
{
struct list entry;
@@ -1873,12 +1845,13 @@ static unsigned update_merge_errors(LibmsiDatabase *db, const WCHAR *error,
return r;
}
-unsigned MsiDatabaseMergeW(LibmsiObject *hDatabase, LibmsiObject *hDatabaseMerge,
- const WCHAR *szTableName)
+unsigned MsiDatabaseMerge(LibmsiObject *hDatabase, LibmsiObject *hDatabaseMerge,
+ const char *szTableName)
{
struct list tabledata = LIST_INIT(tabledata);
struct list *item, *cursor;
LibmsiDatabase *db, *merge;
+ WCHAR *szwTableName;
MERGETABLE *table;
bool conflicts;
unsigned r;
@@ -1889,6 +1862,7 @@ unsigned MsiDatabaseMergeW(LibmsiObject *hDatabase, LibmsiObject *hDatabaseMerge
if (szTableName && !*szTableName)
return ERROR_INVALID_TABLE;
+ szwTableName = strdupAtoW(szTableName);
db = msihandle2msiinfo(hDatabase, LIBMSI_OBJECT_TYPE_DATABASE);
merge = msihandle2msiinfo(hDatabaseMerge, LIBMSI_OBJECT_TYPE_DATABASE);
if (!db || !merge)
@@ -1908,7 +1882,7 @@ unsigned MsiDatabaseMergeW(LibmsiObject *hDatabase, LibmsiObject *hDatabaseMerge
{
conflicts = true;
- r = update_merge_errors(db, szTableName, table->name,
+ r = update_merge_errors(db, szwTableName, table->name,
table->numconflicts);
if (r != ERROR_SUCCESS)
break;
diff --git a/libmsi/msipriv.h b/libmsi/msipriv.h
index 27b6d6c..14a3453 100644
--- a/libmsi/msipriv.h
+++ b/libmsi/msipriv.h
@@ -409,20 +409,6 @@ extern unsigned msi_set_property( LibmsiDatabase *, const WCHAR *, const WCHAR *
extern unsigned msi_get_property( LibmsiDatabase *, const WCHAR *, WCHAR *, unsigned *);
extern int msi_get_property_int( LibmsiDatabase *package, const WCHAR *prop, int def );
-/* Unicode APIs */
-unsigned MsiDatabaseOpenViewW(LibmsiObject *,const WCHAR *,LibmsiObject **);
-LibmsiDBError MsiViewGetErrorW(LibmsiObject *,WCHAR *,unsigned *);
-unsigned MsiRecordSetStringW(LibmsiObject *,unsigned,const WCHAR *);
-unsigned MsiRecordGetStringW(LibmsiObject *,unsigned,WCHAR *,unsigned *);
-unsigned MsiFormatRecordW(LibmsiObject *,LibmsiObject *,WCHAR *,unsigned *);
-unsigned MsiDatabaseGetPrimaryKeysW(LibmsiObject *,const WCHAR *,LibmsiObject **);
-unsigned MsiCreateTransformSummaryInfoW(LibmsiObject *, LibmsiObject *, const WCHAR *, int, int);
-unsigned MsiSummaryInfoGetPropertyW(LibmsiObject *,unsigned,unsigned *,int *,uint64_t*,WCHAR *,unsigned *);
-unsigned MsiSummaryInfoSetPropertyW(LibmsiObject *, unsigned, unsigned, int, uint64_t*, const WCHAR *);
-unsigned MsiDatabaseExportW(LibmsiObject *, const WCHAR *, int fd);
-LibmsiCondition MsiDatabaseIsTablePersistentW(LibmsiObject *, const WCHAR *);
-unsigned MsiDatabaseMergeW(LibmsiObject *, LibmsiObject *, const WCHAR *);
-
/* common strings */
static const WCHAR szSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
static const WCHAR szSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
diff --git a/libmsi/msiquery.c b/libmsi/msiquery.c
index db78c69..5144cf1 100644
--- a/libmsi/msiquery.c
+++ b/libmsi/msiquery.c
@@ -89,6 +89,8 @@ unsigned MsiDatabaseOpenView(LibmsiObject *hdb,
{
unsigned r;
WCHAR *szwQuery;
+ LibmsiDatabase *db;
+ LibmsiQuery *query = NULL;
TRACE("%d %s %p\n", hdb, debugstr_a(szQuery), phView);
@@ -101,7 +103,16 @@ unsigned MsiDatabaseOpenView(LibmsiObject *hdb,
else
szwQuery = NULL;
- r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
+ TRACE("%s %p\n", debugstr_w(szQuery), phView);
+
+ db = msihandle2msiinfo( hdb, LIBMSI_OBJECT_TYPE_DATABASE );
+ if( !db )
+ return ERROR_INVALID_HANDLE;
+
+ r = MSI_DatabaseOpenViewW( db, szwQuery, &query );
+ if( r == ERROR_SUCCESS )
+ *phView = &query->hdr;
+ msiobj_release( &db->hdr );
msi_free( szwQuery );
return r;
@@ -237,27 +248,6 @@ LibmsiRecord *MSI_QueryGetRecord( LibmsiDatabase *db, const WCHAR *fmt, ... )
return rec;
}
-unsigned MsiDatabaseOpenViewW(LibmsiObject *hdb,
- const WCHAR *szQuery, LibmsiObject **phView)
-{
- LibmsiDatabase *db;
- LibmsiQuery *query = NULL;
- unsigned ret;
-
- TRACE("%s %p\n", debugstr_w(szQuery), phView);
-
- db = msihandle2msiinfo( hdb, LIBMSI_OBJECT_TYPE_DATABASE );
- if( !db )
- return ERROR_INVALID_HANDLE;
-
- ret = MSI_DatabaseOpenViewW( db, szQuery, &query );
- if( ret == ERROR_SUCCESS )
- *phView = &query->hdr;
- msiobj_release( &db->hdr );
-
- return ret;
-}
-
unsigned msi_view_get_row(LibmsiDatabase *db, LibmsiView *view, unsigned row, LibmsiRecord **rec)
{
unsigned row_count = 0, col_count = 0, i, ival, ret, type;
@@ -608,38 +598,6 @@ unsigned MsiViewModify( LibmsiObject *hView, LibmsiModify eModifyMode,
return r;
}
-LibmsiDBError MsiViewGetErrorW( LibmsiObject *handle, WCHAR *buffer, unsigned *buflen )
-{
- LibmsiQuery *query;
- const WCHAR *column;
- LibmsiDBError r;
- unsigned len;
-
- TRACE("%u %p %p\n", handle, buffer, buflen);
-
- if (!buflen)
- return LIBMSI_DB_ERROR_INVALIDARG;
-
- query = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_VIEW );
- if( !query )
- return LIBMSI_DB_ERROR_INVALIDARG;
-
- if ((r = query->view->error)) column = query->view->error_column;
- else column = szEmpty;
-
- len = strlenW( column );
- if (buffer)
- {
- if (*buflen > len)
- strcpyW( buffer, column );
- else
- r = LIBMSI_DB_ERROR_MOREDATA;
- }
- *buflen = len;
- msiobj_release( &query->hdr );
- return r;
-}
-
LibmsiDBError MsiViewGetError( LibmsiObject *handle, char *buffer, unsigned *buflen )
{
LibmsiQuery *query;
@@ -841,30 +799,11 @@ unsigned MSI_DatabaseGetPrimaryKeys( LibmsiDatabase *db,
return r;
}
-unsigned MsiDatabaseGetPrimaryKeysW( LibmsiObject *hdb,
- const WCHAR *table, LibmsiObject **phRec )
-{
- LibmsiRecord *rec = NULL;
- LibmsiDatabase *db;
- unsigned r;
-
- TRACE("%d %s %p\n", hdb, debugstr_w(table), phRec);
-
- db = msihandle2msiinfo( hdb, LIBMSI_OBJECT_TYPE_DATABASE );
- if( !db )
- return ERROR_INVALID_HANDLE;
-
- r = MSI_DatabaseGetPrimaryKeys( db, table, &rec );
- if( r == ERROR_SUCCESS )
- *phRec = &rec->hdr;
- msiobj_release( &db->hdr );
-
- return r;
-}
-
unsigned MsiDatabaseGetPrimaryKeys(LibmsiObject *hdb,
const char *table, LibmsiObject **phRec)
{
+ LibmsiRecord *rec = NULL;
+ LibmsiDatabase *db;
WCHAR *szwTable = NULL;
unsigned r;
@@ -876,7 +815,15 @@ unsigned MsiDatabaseGetPrimaryKeys(LibmsiObject *hdb,
if( !szwTable )
return ERROR_OUTOFMEMORY;
}
- r = MsiDatabaseGetPrimaryKeysW( hdb, szwTable, phRec );
+
+ db = msihandle2msiinfo( hdb, LIBMSI_OBJECT_TYPE_DATABASE );
+ if( !db )
+ return ERROR_INVALID_HANDLE;
+
+ r = MSI_DatabaseGetPrimaryKeys( db, szwTable, &rec );
+ if( r == ERROR_SUCCESS )
+ *phRec = &rec->hdr;
+ msiobj_release( &db->hdr );
msi_free( szwTable );
return r;
@@ -886,6 +833,7 @@ LibmsiCondition MsiDatabaseIsTablePersistent(
LibmsiObject *hDatabase, const char *szTableName)
{
WCHAR *szwTableName = NULL;
+ LibmsiDatabase *db;
LibmsiCondition r;
TRACE("%x %s\n", hDatabase, debugstr_a(szTableName));
@@ -896,27 +844,15 @@ LibmsiCondition MsiDatabaseIsTablePersistent(
if( !szwTableName )
return LIBMSI_CONDITION_ERROR;
}
- r = MsiDatabaseIsTablePersistentW( hDatabase, szwTableName );
- msi_free( szwTableName );
-
- return r;
-}
-
-LibmsiCondition MsiDatabaseIsTablePersistentW(
- LibmsiObject *hDatabase, const WCHAR *szTableName)
-{
- LibmsiDatabase *db;
- LibmsiCondition r;
-
- TRACE("%x %s\n", hDatabase, debugstr_w(szTableName));
db = msihandle2msiinfo( hDatabase, LIBMSI_OBJECT_TYPE_DATABASE );
if( !db )
return LIBMSI_CONDITION_ERROR;
- r = MSI_DatabaseIsTablePersistent( db, szTableName );
+ r = MSI_DatabaseIsTablePersistent( db, szwTableName );
msiobj_release( &db->hdr );
+ msi_free( szwTableName );
return r;
}
diff --git a/libmsi/record.c b/libmsi/record.c
index 9d1854b..7eeb61d 100644
--- a/libmsi/record.c
+++ b/libmsi/record.c
@@ -496,25 +496,6 @@ unsigned MSI_RecordGetStringW(LibmsiRecord *rec, unsigned iField,
return ret;
}
-unsigned MsiRecordGetStringW(LibmsiObject *handle, unsigned iField,
- WCHAR *szValue, unsigned *pcchValue)
-{
- LibmsiRecord *rec;
- unsigned ret;
-
- TRACE("%d %d %p %p\n", handle, iField, szValue, pcchValue);
-
- rec = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_RECORD );
- if( !rec )
- return ERROR_INVALID_HANDLE;
-
- msiobj_lock( &rec->hdr );
- ret = MSI_RecordGetStringW( rec, iField, szValue, pcchValue );
- msiobj_unlock( &rec->hdr );
- msiobj_release( &rec->hdr );
- return ret;
-}
-
static unsigned msi_get_stream_size( IStream *stm )
{
STATSTG stat;
@@ -632,24 +613,6 @@ unsigned MSI_RecordSetStringW( LibmsiRecord *rec, unsigned iField, const WCHAR *
return 0;
}
-unsigned MsiRecordSetStringW( LibmsiObject *handle, unsigned iField, const WCHAR *szValue )
-{
- LibmsiRecord *rec;
- unsigned ret;
-
- TRACE("%d %d %s\n", handle, iField, debugstr_w(szValue));
-
- rec = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_RECORD );
- if( !rec )
- return ERROR_INVALID_HANDLE;
-
- msiobj_lock( &rec->hdr );
- ret = MSI_RecordSetStringW( rec, iField, szValue );
- msiobj_unlock( &rec->hdr );
- msiobj_release( &rec->hdr );
- return ret;
-}
-
/* read the data in a file into an IStream */
static unsigned RECORD_StreamFromFile(const char *szFile, IStream **pstm)
{
diff --git a/libmsi/suminfo.c b/libmsi/suminfo.c
index 77c7459..d405eff 100644
--- a/libmsi/suminfo.c
+++ b/libmsi/suminfo.c
@@ -506,15 +506,16 @@ unsigned MsiSummaryInfoGetPropertyCount(LibmsiObject *hSummaryInfo, unsigned *pC
return ERROR_SUCCESS;
}
-static unsigned get_prop( LibmsiObject *handle, unsigned uiProperty, unsigned *puiDataType,
- int *piValue, uint64_t *pftValue, awstring *str, unsigned *pcchValueBuf)
+unsigned MsiSummaryInfoGetProperty(
+ LibmsiObject *handle, unsigned uiProperty, unsigned *puiDataType, int *piValue,
+ uint64_t *pftValue, char *szValueBuf, unsigned *pcchValueBuf)
{
LibmsiSummaryInfo *si;
PROPVARIANT *prop;
unsigned ret = ERROR_SUCCESS;
TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType,
- piValue, pftValue, str, pcchValueBuf);
+ piValue, pftValue, szValueBuf, pcchValueBuf);
if ( uiProperty >= MSI_MAX_PROPS )
{
@@ -546,17 +547,9 @@ static unsigned get_prop( LibmsiObject *handle, unsigned uiProperty, unsigned *p
{
unsigned len = 0;
- if( str->unicode )
- {
- len = MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, NULL, 0 ) - 1;
- MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, str->str.w, *pcchValueBuf );
- }
- else
- {
- len = strlen( prop->pszVal );
- if( str->str.a )
- strcpynA(str->str.a, prop->pszVal, *pcchValueBuf );
- }
+ len = strlen( prop->pszVal );
+ if( szValueBuf )
+ strcpynA(szValueBuf, prop->pszVal, *pcchValueBuf );
if (len >= *pcchValueBuf)
ret = ERROR_MORE_DATA;
*pcchValueBuf = len;
@@ -616,58 +609,47 @@ WCHAR *msi_get_suminfo_product( IStorage *stg )
return prod;
}
-unsigned MsiSummaryInfoGetProperty(
- LibmsiObject *handle, unsigned uiProperty, unsigned *puiDataType, int *piValue,
- uint64_t *pftValue, char *szValueBuf, unsigned *pcchValueBuf)
-{
- awstring str;
-
- TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType,
- piValue, pftValue, szValueBuf, pcchValueBuf );
-
- str.unicode = false;
- str.str.a = szValueBuf;
-
- return get_prop( handle, uiProperty, puiDataType, piValue,
- pftValue, &str, pcchValueBuf );
-}
-
-unsigned MsiSummaryInfoGetPropertyW(
- LibmsiObject *handle, unsigned uiProperty, unsigned *puiDataType, int *piValue,
- uint64_t *pftValue, WCHAR *szValueBuf, unsigned *pcchValueBuf)
+unsigned MsiSummaryInfoSetProperty( LibmsiObject *handle, unsigned uiProperty,
+ unsigned uiDataType, int iValue, uint64_t* pftValue, const char *szValue )
{
- awstring str;
+ LibmsiSummaryInfo *si;
+ PROPVARIANT *prop;
+ unsigned len;
+ unsigned ret;
+ int type;
- TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType,
- piValue, pftValue, szValueBuf, pcchValueBuf );
+ TRACE("%p %u %u %i %p %p\n", si, uiProperty, type, iValue,
+ pftValue, szValue );
- str.unicode = true;
- str.str.w = szValueBuf;
+ type = get_type( uiProperty );
+ if( type == VT_EMPTY || type != uiDataType )
+ return ERROR_DATATYPE_MISMATCH;
- return get_prop( handle, uiProperty, puiDataType, piValue,
- pftValue, &str, pcchValueBuf );
-}
+ if( uiDataType == VT_LPSTR && !szValue )
+ return ERROR_INVALID_PARAMETER;
-static unsigned set_prop( LibmsiSummaryInfo *si, unsigned uiProperty, unsigned type,
- int iValue, uint64_t* pftValue, awcstring *str )
-{
- PROPVARIANT *prop;
- unsigned len;
+ if( uiDataType == VT_FILETIME && !pftValue )
+ return ERROR_INVALID_PARAMETER;
- TRACE("%p %u %u %i %p %p\n", si, uiProperty, type, iValue,
- pftValue, str );
+ si = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_SUMMARYINFO );
+ if( !si )
+ return ERROR_INVALID_HANDLE;
prop = &si->property[uiProperty];
if( prop->vt == VT_EMPTY )
{
+ ret = ERROR_FUNCTION_FAILED;
if( !si->update_count )
- return ERROR_FUNCTION_FAILED;
+ goto end;
si->update_count--;
}
else if( prop->vt != type )
- return ERROR_SUCCESS;
+ {
+ ret = ERROR_SUCCESS;
+ goto end;
+ }
free_prop( prop );
prop->vt = type;
@@ -684,86 +666,14 @@ static unsigned set_prop( LibmsiSummaryInfo *si, unsigned uiProperty, unsigned t
prop->filetime.dwHighDateTime = (unsigned) (*pftValue >> 32);
break;
case VT_LPSTR:
- if( str->unicode )
- {
- len = WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
- NULL, 0, NULL, NULL );
- prop->pszVal = msi_alloc( len );
- WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
- prop->pszVal, len, NULL, NULL );
- }
- else
- {
- len = strlen( str->str.a ) + 1;
- prop->pszVal = msi_alloc( len );
- strcpy( prop->pszVal, str->str.a );
- }
+ len = strlen( szValue ) + 1;
+ prop->pszVal = msi_alloc( len );
+ strcpy( prop->pszVal, szValue );
break;
}
- return ERROR_SUCCESS;
-}
-
-unsigned MsiSummaryInfoSetPropertyW( LibmsiObject *handle, unsigned uiProperty,
- unsigned uiDataType, int iValue, uint64_t* pftValue, const WCHAR *szValue )
-{
- awcstring str;
- LibmsiSummaryInfo *si;
- unsigned type, ret;
-
- TRACE("%d %u %u %i %p %s\n", handle, uiProperty, uiDataType,
- iValue, pftValue, debugstr_w(szValue) );
-
- type = get_type( uiProperty );
- if( type == VT_EMPTY || type != uiDataType )
- return ERROR_DATATYPE_MISMATCH;
-
- if( uiDataType == VT_LPSTR && !szValue )
- return ERROR_INVALID_PARAMETER;
-
- if( uiDataType == VT_FILETIME && !pftValue )
- return ERROR_INVALID_PARAMETER;
-
- si = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_SUMMARYINFO );
- if( !si )
- return ERROR_INVALID_HANDLE;
-
- str.unicode = true;
- str.str.w = szValue;
- ret = set_prop( si, uiProperty, type, iValue, pftValue, &str );
-
- msiobj_release( &si->hdr );
- return ret;
-}
-
-unsigned MsiSummaryInfoSetProperty( LibmsiObject *handle, unsigned uiProperty,
- unsigned uiDataType, int iValue, uint64_t* pftValue, const char *szValue )
-{
- awcstring str;
- LibmsiSummaryInfo *si;
- unsigned type, ret;
-
- TRACE("%d %u %u %i %p %s\n", handle, uiProperty, uiDataType,
- iValue, pftValue, debugstr_a(szValue) );
-
- type = get_type( uiProperty );
- if( type == VT_EMPTY || type != uiDataType )
- return ERROR_DATATYPE_MISMATCH;
-
- if( uiDataType == VT_LPSTR && !szValue )
- return ERROR_INVALID_PARAMETER;
-
- if( uiDataType == VT_FILETIME && !pftValue )
- return ERROR_INVALID_PARAMETER;
-
- si = msihandle2msiinfo( handle, LIBMSI_OBJECT_TYPE_SUMMARYINFO );
- if( !si )
- return ERROR_INVALID_HANDLE;
-
- str.unicode = false;
- str.str.a = szValue;
- ret = set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
-
+ ret = ERROR_SUCCESS;
+end:
msiobj_release( &si->hdr );
return ret;
}
@@ -830,7 +740,7 @@ static void parse_filetime( const WCHAR *str, uint64_t *ft )
}
static unsigned parse_prop( const WCHAR *prop, const WCHAR *value, unsigned *pid, int *int_value,
- uint64_t *ft_value, awcstring *str_value )
+ uint64_t *ft_value, char **str_value )
{
*pid = atoiW( prop );
switch (*pid)
@@ -858,8 +768,7 @@ static unsigned parse_prop( const WCHAR *prop, const WCHAR *value, unsigned *pid
case MSI_PID_REVNUMBER:
case MSI_PID_APPNAME:
case MSI_PID_TITLE:
- str_value->str.w = value;
- str_value->unicode = true;
+ *str_value = strdupWtoA(value);
break;
default:
@@ -890,15 +799,17 @@ unsigned msi_add_suminfo( LibmsiDatabase *db, WCHAR ***records, int num_records,
unsigned pid;
int int_value = 0;
uint64_t ft_value;
- awcstring str_value;
+ char *str_value = NULL;
r = parse_prop( records[i][j], records[i][j + 1], &pid, &int_value, &ft_value, &str_value );
if (r != ERROR_SUCCESS)
goto end;
- r = set_prop( si, pid, get_type(pid), int_value, &ft_value, &str_value );
+ r = MsiSummaryInfoSetProperty( &si->hdr, pid, get_type(pid), int_value, &ft_value, str_value );
if (r != ERROR_SUCCESS)
goto end;
+
+ msi_free(str_value);
}
}
@@ -926,24 +837,3 @@ unsigned MsiSummaryInfoPersist( LibmsiObject *handle )
msiobj_release( &si->hdr );
return ret;
}
-
-unsigned MsiCreateTransformSummaryInfo( LibmsiObject *db, LibmsiObject *db_ref, const char *transform, int error, int validation )
-{
- unsigned r;
- WCHAR *transformW = NULL;
-
- TRACE("%u, %u, %s, %d, %d\n", db, db_ref, debugstr_a(transform), error, validation);
-
- if (transform && !(transformW = strdupAtoW( transform )))
- return ERROR_OUTOFMEMORY;
-
- r = MsiCreateTransformSummaryInfoW( db, db_ref, transformW, error, validation );
- msi_free( transformW );
- return r;
-}
-
-unsigned MsiCreateTransformSummaryInfoW( LibmsiObject *db, LibmsiObject *db_ref, const WCHAR *transform, int error, int validation )
-{
- FIXME("%u, %u, %s, %d, %d\n", db, db_ref, debugstr_w(transform), error, validation);
- return ERROR_FUNCTION_FAILED;
-}