From b19defc32740225273c7efa63a784de18cde3dd1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 23 Oct 2012 11:16:54 +0200 Subject: get rid of stupid Win32 integer types --- include/debug.h | 8 +- include/libmsi.h | 100 ++++++++------- libmsi/alter.c | 44 +++---- libmsi/create.c | 24 ++-- libmsi/database.c | 170 ++++++++++++------------ libmsi/delete.c | 28 ++-- libmsi/distinct.c | 46 +++---- libmsi/drop.c | 16 +-- libmsi/handle.c | 8 +- libmsi/insert.c | 46 +++---- libmsi/msipriv.h | 182 +++++++++++++------------- libmsi/msiquery.c | 118 ++++++++--------- libmsi/query.h | 42 +++--- libmsi/record.c | 148 ++++++++++----------- libmsi/select.c | 54 ++++---- libmsi/sql-parser.y | 40 +++--- libmsi/storages.c | 70 +++++----- libmsi/streams.c | 74 +++++------ libmsi/string.c | 90 ++++++------- libmsi/suminfo.c | 162 +++++++++++------------ libmsi/table.c | 356 +++++++++++++++++++++++++-------------------------- libmsi/tokenize.c | 4 +- libmsi/unicode.h | 10 +- libmsi/update.c | 28 ++-- libmsi/where.c | 184 +++++++++++++------------- tests/testdatabase.c | 282 ++++++++++++++++++++-------------------- tests/testrecord.c | 22 ++-- tests/testrecord.ok | 2 +- tests/testsuminfo.c | 18 +-- 29 files changed, 1189 insertions(+), 1187 deletions(-) diff --git a/include/debug.h b/include/debug.h index eeda9b6..9d38a20 100644 --- a/include/debug.h +++ b/include/debug.h @@ -68,7 +68,7 @@ static inline const char *wine_dbgstr_wn( const WCHAR *s, int n ) static int i; CHAR *ret; - DWORD len; + unsigned len; if (!s) return ""; i = (i + 1) % 10; @@ -86,7 +86,7 @@ static inline const char *wine_dbg_sprintf( const char *format, ...) static int i; CHAR *ret; - DWORD len; + unsigned len; va_list ap; va_start(ap, format); @@ -120,7 +120,7 @@ static inline const char *wine_dbgstr_w( const WCHAR *s ) static inline const char *wine_dbgstr_guid( const GUID *id ) { if (!id) return "(null)"; - if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "", (WORD)(ULONG_PTR)id ); + if (!((uintptr_t)id >> 16)) return wine_dbg_sprintf( "", (WORD)(uintptr_t)id ); return wine_dbg_sprintf( "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", id->Data1, id->Data2, id->Data3, id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3], @@ -146,7 +146,7 @@ static inline const char *wine_dbgstr_rect( const RECT *rect ) rect->right, rect->bottom ); } -static inline const char *wine_dbgstr_longlong( ULONGLONG ll ) +static inline const char *wine_dbgstr_longlong( unsigned long long ll ) { if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll ); diff --git a/include/libmsi.h b/include/libmsi.h index 9674465..066c5cb 100644 --- a/include/libmsi.h +++ b/include/libmsi.h @@ -19,6 +19,8 @@ #ifndef _LIBMSI_H #define _LIBMSI_H +#include + struct tagMSIOBJECT; typedef struct tagMSIOBJECT MSIOBJECT; @@ -148,95 +150,95 @@ extern "C" { /* view manipulation */ -UINT MsiViewFetch(MSIOBJECT *,MSIOBJECT **); -UINT MsiViewExecute(MSIOBJECT *,MSIOBJECT *); -UINT MsiViewClose(MSIOBJECT *); -UINT MsiDatabaseOpenViewA(MSIOBJECT *,const CHAR *,MSIOBJECT **); -UINT MsiDatabaseOpenViewW(MSIOBJECT *,const WCHAR *,MSIOBJECT **); +unsigned MsiViewFetch(MSIOBJECT *,MSIOBJECT **); +unsigned MsiViewExecute(MSIOBJECT *,MSIOBJECT *); +unsigned MsiViewClose(MSIOBJECT *); +unsigned MsiDatabaseOpenViewA(MSIOBJECT *,const CHAR *,MSIOBJECT **); +unsigned MsiDatabaseOpenViewW(MSIOBJECT *,const WCHAR *,MSIOBJECT **); #define MsiDatabaseOpenView WINELIB_NAME_AW(MsiDatabaseOpenView) -MSIDBERROR MsiViewGetErrorA(MSIOBJECT *,CHAR *,DWORD *); -MSIDBERROR MsiViewGetErrorW(MSIOBJECT *,WCHAR *,DWORD *); +MSIDBERROR MsiViewGetErrorA(MSIOBJECT *,CHAR *,unsigned *); +MSIDBERROR MsiViewGetErrorW(MSIOBJECT *,WCHAR *,unsigned *); #define MsiViewGetError WINELIB_NAME_AW(MsiViewGetError) MSIDBSTATE MsiGetDatabaseState(MSIOBJECT *); /* record manipulation */ -MSIOBJECT * MsiCreateRecord(UINT); -UINT MsiRecordClearData(MSIOBJECT *); -UINT MsiRecordSetInteger(MSIOBJECT *,UINT,int); -UINT MsiRecordSetStringA(MSIOBJECT *,UINT,const CHAR *); -UINT MsiRecordSetStringW(MSIOBJECT *,UINT,const WCHAR *); +MSIOBJECT * MsiCreateRecord(unsigned); +unsigned MsiRecordClearData(MSIOBJECT *); +unsigned MsiRecordSetInteger(MSIOBJECT *,unsigned,int); +unsigned MsiRecordSetStringA(MSIOBJECT *,unsigned,const CHAR *); +unsigned MsiRecordSetStringW(MSIOBJECT *,unsigned,const WCHAR *); #define MsiRecordSetString WINELIB_NAME_AW(MsiRecordSetString) -UINT MsiRecordGetStringA(MSIOBJECT *,UINT,CHAR *,DWORD *); -UINT MsiRecordGetStringW(MSIOBJECT *,UINT,WCHAR *,DWORD *); +unsigned MsiRecordGetStringA(MSIOBJECT *,unsigned,CHAR *,unsigned *); +unsigned MsiRecordGetStringW(MSIOBJECT *,unsigned,WCHAR *,unsigned *); #define MsiRecordGetString WINELIB_NAME_AW(MsiRecordGetString) -UINT MsiRecordGetFieldCount(MSIOBJECT *); -int MsiRecordGetInteger(MSIOBJECT *,UINT); -UINT MsiRecordDataSize(MSIOBJECT *,UINT); -BOOL MsiRecordIsNull(MSIOBJECT *,UINT); -UINT MsiFormatRecordA(MSIOBJECT *,MSIOBJECT *,CHAR *,DWORD *); -UINT MsiFormatRecordW(MSIOBJECT *,MSIOBJECT *,WCHAR *,DWORD *); +unsigned MsiRecordGetFieldCount(MSIOBJECT *); +int MsiRecordGetInteger(MSIOBJECT *,unsigned); +unsigned MsiRecordDataSize(MSIOBJECT *,unsigned); +BOOL MsiRecordIsNull(MSIOBJECT *,unsigned); +unsigned MsiFormatRecordA(MSIOBJECT *,MSIOBJECT *,CHAR *,unsigned *); +unsigned MsiFormatRecordW(MSIOBJECT *,MSIOBJECT *,WCHAR *,unsigned *); #define MsiFormatRecord WINELIB_NAME_AW(MsiFormatRecord) -UINT MsiRecordSetStreamA(MSIOBJECT *,UINT,const CHAR *); -UINT MsiRecordSetStreamW(MSIOBJECT *,UINT,const WCHAR *); +unsigned MsiRecordSetStreamA(MSIOBJECT *,unsigned,const CHAR *); +unsigned MsiRecordSetStreamW(MSIOBJECT *,unsigned,const WCHAR *); #define MsiRecordSetStream WINELIB_NAME_AW(MsiRecordSetStream) -UINT MsiRecordReadStream(MSIOBJECT *,UINT,char*,DWORD *); +unsigned MsiRecordReadStream(MSIOBJECT *,unsigned,char*,unsigned *); -UINT MsiDatabaseGetPrimaryKeysA(MSIOBJECT *,const CHAR *,MSIOBJECT **); -UINT MsiDatabaseGetPrimaryKeysW(MSIOBJECT *,const WCHAR *,MSIOBJECT **); +unsigned MsiDatabaseGetPrimaryKeysA(MSIOBJECT *,const CHAR *,MSIOBJECT **); +unsigned MsiDatabaseGetPrimaryKeysW(MSIOBJECT *,const WCHAR *,MSIOBJECT **); #define MsiDatabaseGetPrimaryKeys WINELIB_NAME_AW(MsiDatabaseGetPrimaryKeys) /* database transforms */ -UINT MsiDatabaseApplyTransformA(MSIOBJECT *,const CHAR *,int); -UINT MsiDatabaseApplyTransformW(MSIOBJECT *,const WCHAR *,int); +unsigned MsiDatabaseApplyTransformA(MSIOBJECT *,const CHAR *,int); +unsigned MsiDatabaseApplyTransformW(MSIOBJECT *,const WCHAR *,int); #define MsiDatabaseApplyTransform WINELIB_NAME_AW(MsiDatabaseApplyTransform) -UINT MsiViewGetColumnInfo(MSIOBJECT *, MSICOLINFO, MSIOBJECT **); +unsigned MsiViewGetColumnInfo(MSIOBJECT *, MSICOLINFO, MSIOBJECT **); -UINT MsiCreateTransformSummaryInfoA(MSIOBJECT *, MSIOBJECT *, const CHAR *, int, int); -UINT MsiCreateTransformSummaryInfoW(MSIOBJECT *, MSIOBJECT *, const WCHAR *, int, int); +unsigned MsiCreateTransformSummaryInfoA(MSIOBJECT *, MSIOBJECT *, const CHAR *, int, int); +unsigned MsiCreateTransformSummaryInfoW(MSIOBJECT *, MSIOBJECT *, const WCHAR *, int, int); #define MsiCreateTransformSummaryInfo WINELIB_NAME_AW(MsiCreateTransformSummaryInfo) -UINT MsiGetSummaryInformationA(MSIOBJECT *, const CHAR *, UINT, MSIOBJECT **); -UINT MsiGetSummaryInformationW(MSIOBJECT *, const WCHAR *, UINT, MSIOBJECT **); +unsigned MsiGetSummaryInformationA(MSIOBJECT *, const CHAR *, unsigned, MSIOBJECT **); +unsigned MsiGetSummaryInformationW(MSIOBJECT *, const WCHAR *, unsigned, MSIOBJECT **); #define MsiGetSummaryInformation WINELIB_NAME_AW(MsiGetSummaryInformation) -UINT MsiSummaryInfoGetPropertyA(MSIOBJECT *,UINT,UINT *,INT *,FILETIME*,CHAR *,DWORD *); -UINT MsiSummaryInfoGetPropertyW(MSIOBJECT *,UINT,UINT *,INT *,FILETIME*,WCHAR *,DWORD *); +unsigned MsiSummaryInfoGetPropertyA(MSIOBJECT *,unsigned,unsigned *,int *,FILETIME*,CHAR *,unsigned *); +unsigned MsiSummaryInfoGetPropertyW(MSIOBJECT *,unsigned,unsigned *,int *,FILETIME*,WCHAR *,unsigned *); #define MsiSummaryInfoGetProperty WINELIB_NAME_AW(MsiSummaryInfoGetProperty) -UINT MsiSummaryInfoSetPropertyA(MSIOBJECT *, UINT, UINT, INT, FILETIME*, const CHAR *); -UINT MsiSummaryInfoSetPropertyW(MSIOBJECT *, UINT, UINT, INT, FILETIME*, const WCHAR *); +unsigned MsiSummaryInfoSetPropertyA(MSIOBJECT *, unsigned, unsigned, int, FILETIME*, const CHAR *); +unsigned MsiSummaryInfoSetPropertyW(MSIOBJECT *, unsigned, unsigned, int, FILETIME*, const WCHAR *); #define MsiSummaryInfoSetProperty WINELIB_NAME_AW(MsiSummaryInfoSetProperty) -UINT MsiDatabaseExportA(MSIOBJECT *, const CHAR *, const CHAR *, const CHAR *); -UINT MsiDatabaseExportW(MSIOBJECT *, const WCHAR *, const WCHAR *, const WCHAR *); +unsigned MsiDatabaseExportA(MSIOBJECT *, const CHAR *, const CHAR *, const CHAR *); +unsigned MsiDatabaseExportW(MSIOBJECT *, const WCHAR *, const WCHAR *, const WCHAR *); #define MsiDatabaseExport WINELIB_NAME_AW(MsiDatabaseExport) -UINT MsiDatabaseImportA(MSIOBJECT *, const CHAR *, const CHAR *); -UINT MsiDatabaseImportW(MSIOBJECT *, const WCHAR *, const WCHAR *); +unsigned MsiDatabaseImportA(MSIOBJECT *, const CHAR *, const CHAR *); +unsigned MsiDatabaseImportW(MSIOBJECT *, const WCHAR *, const WCHAR *); #define MsiDatabaseImport WINELIB_NAME_AW(MsiDatabaseImport) -UINT MsiOpenDatabaseW(const WCHAR *, const WCHAR *, MSIOBJECT **); -UINT MsiOpenDatabaseA(const CHAR *, const CHAR *, MSIOBJECT **); +unsigned MsiOpenDatabaseW(const WCHAR *, const WCHAR *, MSIOBJECT **); +unsigned MsiOpenDatabaseA(const CHAR *, const CHAR *, MSIOBJECT **); #define MsiOpenDatabase WINELIB_NAME_AW(MsiOpenDatabase) MSICONDITION MsiDatabaseIsTablePersistentA(MSIOBJECT *, const CHAR *); MSICONDITION MsiDatabaseIsTablePersistentW(MSIOBJECT *, const WCHAR *); #define MsiDatabaseIsTablePersistent WINELIB_NAME_AW(MsiDatabaseIsTablePersistent) -UINT MsiSummaryInfoPersist(MSIOBJECT *); -UINT MsiSummaryInfoGetPropertyCount(MSIOBJECT *,UINT *); +unsigned MsiSummaryInfoPersist(MSIOBJECT *); +unsigned MsiSummaryInfoGetPropertyCount(MSIOBJECT *,unsigned *); -UINT MsiViewModify(MSIOBJECT *, MSIMODIFY, MSIOBJECT *); +unsigned MsiViewModify(MSIOBJECT *, MSIMODIFY, MSIOBJECT *); -UINT MsiDatabaseMergeA(MSIOBJECT *, MSIOBJECT *, const CHAR *); -UINT MsiDatabaseMergeW(MSIOBJECT *, MSIOBJECT *, const WCHAR *); +unsigned MsiDatabaseMergeA(MSIOBJECT *, MSIOBJECT *, const CHAR *); +unsigned MsiDatabaseMergeW(MSIOBJECT *, MSIOBJECT *, const WCHAR *); #define MsiDatabaseMerge WINELIB_NAME_AW(MsiDatabaseMerge) /* Non Unicode */ -UINT MsiDatabaseCommit(MSIOBJECT *); -UINT MsiCloseHandle(MSIOBJECT *); +unsigned MsiDatabaseCommit(MSIOBJECT *); +unsigned MsiCloseHandle(MSIOBJECT *); MSIOBJECT * MsiGetLastErrorRecord(void); diff --git a/libmsi/alter.c b/libmsi/alter.c index daba950..e139bcc 100644 --- a/libmsi/alter.c +++ b/libmsi/alter.c @@ -38,10 +38,10 @@ typedef struct tagMSIALTERVIEW MSIDATABASE *db; MSIVIEW *table; column_info *colinfo; - INT hold; + int hold; } MSIALTERVIEW; -static UINT ALTER_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned ALTER_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -50,7 +50,7 @@ static UINT ALTER_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return ERROR_FUNCTION_FAILED; } -static UINT ALTER_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm) +static unsigned ALTER_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, IStream **stm) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -59,7 +59,7 @@ static UINT ALTER_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm return ERROR_FUNCTION_FAILED; } -static UINT ALTER_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned ALTER_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -68,9 +68,9 @@ static UINT ALTER_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) return av->table->ops->get_row(av->table, row, rec); } -static UINT ITERATE_columns(MSIRECORD *row, void *param) +static unsigned ITERATE_columns(MSIRECORD *row, void *param) { - (*(UINT *)param)++; + (*(unsigned *)param)++; return ERROR_SUCCESS; } @@ -78,7 +78,7 @@ static BOOL check_column_exists(MSIDATABASE *db, const WCHAR *table, const WCHAR { MSIQUERY *view; MSIRECORD *rec; - UINT r; + unsigned r; static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', @@ -104,9 +104,9 @@ done: return (r == ERROR_SUCCESS); } -static UINT alter_add_column(MSIALTERVIEW *av) +static unsigned alter_add_column(MSIALTERVIEW *av) { - UINT r, colnum = 1; + unsigned r, colnum = 1; MSIQUERY *view; MSIVIEW *columns; @@ -147,10 +147,10 @@ static UINT alter_add_column(MSIALTERVIEW *av) return r; } -static UINT ALTER_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned ALTER_execute( MSIVIEW *view, MSIRECORD *record ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; - UINT ref; + unsigned ref; TRACE("%p %p\n", av, record); @@ -169,7 +169,7 @@ static UINT ALTER_execute( MSIVIEW *view, MSIRECORD *record ) return ERROR_SUCCESS; } -static UINT ALTER_close( MSIVIEW *view ) +static unsigned ALTER_close( MSIVIEW *view ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -178,7 +178,7 @@ static UINT ALTER_close( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT ALTER_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned ALTER_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -187,8 +187,8 @@ static UINT ALTER_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return ERROR_FUNCTION_FAILED; } -static UINT ALTER_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned ALTER_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -197,8 +197,8 @@ static UINT ALTER_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return ERROR_FUNCTION_FAILED; } -static UINT ALTER_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned ALTER_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -207,7 +207,7 @@ static UINT ALTER_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return ERROR_FUNCTION_FAILED; } -static UINT ALTER_delete( MSIVIEW *view ) +static unsigned ALTER_delete( MSIVIEW *view ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; @@ -219,8 +219,8 @@ static UINT ALTER_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT ALTER_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned ALTER_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { TRACE("%p, %d, %u, %p\n", view, col, val, *handle); @@ -250,10 +250,10 @@ static const MSIVIEWOPS alter_ops = NULL, }; -UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name, column_info *colinfo, int hold ) +unsigned ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name, column_info *colinfo, int hold ) { MSIALTERVIEW *av; - UINT r; + unsigned r; TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold ); diff --git a/libmsi/create.c b/libmsi/create.c index 24a9fb1..b35ea26 100644 --- a/libmsi/create.c +++ b/libmsi/create.c @@ -47,7 +47,7 @@ typedef struct tagMSICREATEVIEW column_info *col_info; } MSICREATEVIEW; -static UINT CREATE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned CREATE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -56,7 +56,7 @@ static UINT CREATE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return ERROR_FUNCTION_FAILED; } -static UINT CREATE_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned CREATE_execute( MSIVIEW *view, MSIRECORD *record ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE; @@ -70,7 +70,7 @@ static UINT CREATE_execute( MSIVIEW *view, MSIRECORD *record ) return msi_create_table( cv->db, cv->name, cv->col_info, persist ); } -static UINT CREATE_close( MSIVIEW *view ) +static unsigned CREATE_close( MSIVIEW *view ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -79,7 +79,7 @@ static UINT CREATE_close( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT CREATE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned CREATE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -88,8 +88,8 @@ static UINT CREATE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return ERROR_FUNCTION_FAILED; } -static UINT CREATE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned CREATE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -98,8 +98,8 @@ static UINT CREATE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return ERROR_FUNCTION_FAILED; } -static UINT CREATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row) +static unsigned CREATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -108,7 +108,7 @@ static UINT CREATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return ERROR_FUNCTION_FAILED; } -static UINT CREATE_delete( MSIVIEW *view ) +static unsigned CREATE_delete( MSIVIEW *view ) { MSICREATEVIEW *cv = (MSICREATEVIEW*)view; @@ -143,7 +143,7 @@ static const MSIVIEWOPS create_ops = NULL, }; -static UINT check_columns( const column_info *col_info ) +static unsigned check_columns( const column_info *col_info ) { const column_info *c1, *c2; @@ -156,11 +156,11 @@ static UINT check_columns( const column_info *col_info ) return ERROR_SUCCESS; } -UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, +unsigned CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, column_info *col_info, BOOL hold ) { MSICREATEVIEW *cv = NULL; - UINT r; + unsigned r; column_info *col; BOOL temp = TRUE; BOOL tempprim = FALSE; diff --git a/libmsi/database.c b/libmsi/database.c index a042037..efdfe52 100644 --- a/libmsi/database.c +++ b/libmsi/database.c @@ -49,7 +49,7 @@ * Any binary data in a table is a reference to a stream. */ -#define IS_INTMSIDBOPEN(x) (((ULONG_PTR)(x) >> 16) == 0) +#define IS_INTMSIDBOPEN(x) (((uintptr_t)(x) >> 16) == 0) typedef struct tagMSITRANSFORM { struct list entry; @@ -62,7 +62,7 @@ typedef struct tagMSISTREAM { IStream *stm; } MSISTREAM; -static UINT find_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, IStream **stm ) +static unsigned find_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, IStream **stm ) { MSISTREAM *stream; @@ -94,7 +94,7 @@ static UINT find_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, return ERROR_FUNCTION_FAILED; } -UINT msi_clone_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, IStream **stm ) +unsigned msi_clone_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, IStream **stm ) { IStream *stream; @@ -124,7 +124,7 @@ UINT msi_clone_open_stream( MSIDATABASE *db, IStorage *stg, const WCHAR *name, I return ERROR_FUNCTION_FAILED; } -UINT msi_get_raw_stream( MSIDATABASE *db, const WCHAR *stname, IStream **stm ) +unsigned msi_get_raw_stream( MSIDATABASE *db, const WCHAR *stname, IStream **stm ) { HRESULT r; IStorage *stg; @@ -293,12 +293,12 @@ static HRESULT db_initialize( IStorage *stg, const GUID *clsid ) return S_OK; } -UINT MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDATABASE **pdb) +unsigned MSI_OpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIDATABASE **pdb) { IStorage *stg = NULL; HRESULT r; MSIDATABASE *db = NULL; - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; const WCHAR *szMode; const WCHAR *save_path; STATSTG stat; @@ -450,10 +450,10 @@ end: return ret; } -UINT MsiOpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIOBJECT **phDB) +unsigned MsiOpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIOBJECT **phDB) { MSIDATABASE *db; - UINT ret; + unsigned ret; TRACE("%s %s %p\n",debugstr_w(szDBPath),debugstr_w(szPersist), phDB); @@ -466,7 +466,7 @@ UINT MsiOpenDatabaseW(const WCHAR *szDBPath, const WCHAR *szPersist, MSIOBJECT * return ret; } -UINT MsiOpenDatabaseA(const CHAR *szDBPath, const CHAR *szPersist, MSIOBJECT **phDB) +unsigned MsiOpenDatabaseA(const CHAR *szDBPath, const CHAR *szPersist, MSIOBJECT **phDB) { HRESULT r = ERROR_FUNCTION_FAILED; WCHAR *szwDBPath = NULL; @@ -488,7 +488,7 @@ UINT MsiOpenDatabaseA(const CHAR *szDBPath, const CHAR *szPersist, MSIOBJECT **p goto end; } else - szwPersist = (WCHAR *)(DWORD_PTR)szPersist; + szwPersist = (WCHAR *)(uintptr_t)szPersist; r = MsiOpenDatabaseW( szwDBPath, szwPersist, phDB ); @@ -500,12 +500,12 @@ end: return r; } -static WCHAR *msi_read_text_archive(const WCHAR *path, DWORD *len) +static WCHAR *msi_read_text_archive(const WCHAR *path, unsigned *len) { HANDLE file; CHAR *data = NULL; WCHAR *wdata = NULL; - DWORD read, size = 0; + unsigned read, size = 0; file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); if (file == INVALID_HANDLE_VALUE) @@ -530,11 +530,11 @@ done: return wdata; } -static void msi_parse_line(WCHAR **line, WCHAR ***entries, DWORD *num_entries, DWORD *len) +static void msi_parse_line(WCHAR **line, WCHAR ***entries, unsigned *num_entries, unsigned *len) { WCHAR *ptr = *line; WCHAR *save; - DWORD i, count = 1, chars_left = *len; + unsigned i, count = 1, chars_left = *len; *entries = NULL; @@ -603,7 +603,7 @@ static void msi_parse_line(WCHAR **line, WCHAR ***entries, DWORD *num_entries, D static WCHAR *msi_build_createsql_prelude(WCHAR *table) { WCHAR *prelude; - DWORD size; + unsigned size; static const WCHAR create_fmt[] = {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','%','s','`',' ','(',' ',0}; @@ -616,12 +616,12 @@ static WCHAR *msi_build_createsql_prelude(WCHAR *table) return prelude; } -static WCHAR *msi_build_createsql_columns(WCHAR **columns_data, WCHAR **types, DWORD num_columns) +static WCHAR *msi_build_createsql_columns(WCHAR **columns_data, WCHAR **types, unsigned num_columns) { WCHAR *columns; WCHAR *p; const WCHAR *type; - DWORD sql_size = 1, i, len; + unsigned sql_size = 1, i, len; WCHAR expanded[128], *ptr; WCHAR size[10], comma[2], extra[30]; @@ -713,12 +713,12 @@ static WCHAR *msi_build_createsql_columns(WCHAR **columns_data, WCHAR **types, D return columns; } -static WCHAR *msi_build_createsql_postlude(WCHAR **primary_keys, DWORD num_keys) +static WCHAR *msi_build_createsql_postlude(WCHAR **primary_keys, unsigned num_keys) { WCHAR *postlude; WCHAR *keys; WCHAR *ptr; - DWORD size, key_size, i; + unsigned size, key_size, i; static const WCHAR key_fmt[] = {'`','%','s','`',',',' ',0}; static const WCHAR postlude_fmt[] = {'P','R','I','M','A','R','Y',' ','K','E','Y',' ','%','s',')',0}; @@ -752,10 +752,10 @@ done: return postlude; } -static UINT msi_add_table_to_db(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, DWORD num_labels, DWORD num_columns) +static unsigned msi_add_table_to_db(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, unsigned num_labels, unsigned num_columns) { - UINT r = ERROR_OUTOFMEMORY; - DWORD size; + unsigned r = ERROR_OUTOFMEMORY; + unsigned size; MSIQUERY *view; WCHAR *create_sql = NULL; WCHAR *prelude; @@ -796,7 +796,7 @@ done: static WCHAR *msi_import_stream_filename(const WCHAR *path, const WCHAR *name) { - DWORD len; + unsigned len; WCHAR *fullname; WCHAR *ptr; @@ -819,10 +819,10 @@ static WCHAR *msi_import_stream_filename(const WCHAR *path, const WCHAR *name) return fullname; } -static UINT construct_record(DWORD num_columns, WCHAR **types, +static unsigned construct_record(unsigned num_columns, WCHAR **types, WCHAR **data, WCHAR *path, MSIRECORD **rec) { - UINT i; + unsigned i; *rec = MSI_CreateRecord(num_columns); if (!*rec) @@ -842,7 +842,7 @@ static UINT construct_record(DWORD num_columns, WCHAR **types, case 'V': case 'v': if (*data[i]) { - UINT r; + unsigned r; WCHAR *file = msi_import_stream_filename(path, data[i]); if (!file) return ERROR_FUNCTION_FAILED; @@ -863,12 +863,12 @@ static UINT construct_record(DWORD num_columns, WCHAR **types, return ERROR_SUCCESS; } -static UINT msi_add_records_to_table(MSIDATABASE *db, WCHAR **columns, WCHAR **types, +static unsigned msi_add_records_to_table(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, WCHAR ***records, int num_columns, int num_records, WCHAR *path) { - UINT r; + unsigned r; int i; MSIQUERY *view; MSIRECORD *rec; @@ -911,12 +911,12 @@ done: return r; } -static UINT MSI_DatabaseImport(MSIDATABASE *db, const WCHAR *folder, const WCHAR *file) +static unsigned MSI_DatabaseImport(MSIDATABASE *db, const WCHAR *folder, const WCHAR *file) { - UINT r; - DWORD len, i; - DWORD num_labels, num_types; - DWORD num_columns, num_records = 0; + unsigned r; + unsigned len, i; + unsigned num_labels, num_types; + unsigned num_columns, num_records = 0; WCHAR **columns; WCHAR **types; WCHAR **labels; @@ -1026,10 +1026,10 @@ done: return r; } -UINT MsiDatabaseImportW(MSIOBJECT *handle, const WCHAR *szFolder, const WCHAR *szFilename) +unsigned MsiDatabaseImportW(MSIOBJECT *handle, const WCHAR *szFolder, const WCHAR *szFilename) { MSIDATABASE *db; - UINT r; + unsigned r; TRACE("%x %s %s\n",handle,debugstr_w(szFolder), debugstr_w(szFilename)); @@ -1041,12 +1041,12 @@ UINT MsiDatabaseImportW(MSIOBJECT *handle, const WCHAR *szFolder, const WCHAR *s return r; } -UINT MsiDatabaseImportA( MSIOBJECT *handle, +unsigned MsiDatabaseImportA( MSIOBJECT *handle, const CHAR *szFolder, const CHAR *szFilename ) { WCHAR *path = NULL; WCHAR *file = NULL; - UINT r = ERROR_OUTOFMEMORY; + unsigned r = ERROR_OUTOFMEMORY; TRACE("%x %s %s\n", handle, debugstr_a(szFolder), debugstr_a(szFilename)); @@ -1073,12 +1073,12 @@ end: return r; } -static UINT msi_export_record( HANDLE handle, MSIRECORD *row, UINT start ) +static unsigned msi_export_record( HANDLE handle, MSIRECORD *row, unsigned start ) { - UINT i, count, len, r = ERROR_SUCCESS; + unsigned i, count, len, r = ERROR_SUCCESS; const char *sep; char *buffer; - DWORD sz; + unsigned sz; len = 0x100; buffer = msi_alloc( len ); @@ -1120,16 +1120,16 @@ static UINT msi_export_record( HANDLE handle, MSIRECORD *row, UINT start ) return r; } -static UINT msi_export_row( MSIRECORD *row, void *arg ) +static unsigned msi_export_row( MSIRECORD *row, void *arg ) { return msi_export_record( arg, row, 1 ); } -static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage ) +static unsigned msi_export_forcecodepage( HANDLE handle, unsigned codepage ) { static const char fmt[] = "\r\n\r\n%u\t_ForceCodepage\r\n"; char data[sizeof(fmt) + 10]; - DWORD sz; + unsigned sz; sprintf( data, fmt, codepage ); @@ -1140,7 +1140,7 @@ static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage ) return ERROR_SUCCESS; } -static UINT MSI_DatabaseExport( MSIDATABASE *db, const WCHAR *table, +static unsigned MSI_DatabaseExport( MSIDATABASE *db, const WCHAR *table, const WCHAR *folder, const WCHAR *file ) { static const WCHAR query[] = { @@ -1151,7 +1151,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, const WCHAR *table, MSIQUERY *view = NULL; WCHAR *filename; HANDLE handle; - UINT len, r; + unsigned len, r; TRACE("%p %s %s %s\n", db, debugstr_w(table), debugstr_w(folder), debugstr_w(file) ); @@ -1176,7 +1176,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, const WCHAR *table, if (!strcmpW( table, forcecodepage )) { - UINT codepage = msi_get_string_table_codepage( db->strings ); + unsigned codepage = msi_get_string_table_codepage( db->strings ); r = msi_export_forcecodepage( handle, codepage ); goto done; } @@ -1234,11 +1234,11 @@ done: * * row4 : data data data ... data */ -UINT MsiDatabaseExportW( MSIOBJECT *handle, const WCHAR *szTable, +unsigned MsiDatabaseExportW( MSIOBJECT *handle, const WCHAR *szTable, const WCHAR *szFolder, const WCHAR *szFilename ) { MSIDATABASE *db; - UINT r; + unsigned r; TRACE("%x %s %s %s\n", handle, debugstr_w(szTable), debugstr_w(szFolder), debugstr_w(szFilename)); @@ -1251,13 +1251,13 @@ UINT MsiDatabaseExportW( MSIOBJECT *handle, const WCHAR *szTable, return r; } -UINT MsiDatabaseExportA( MSIOBJECT *handle, const CHAR *szTable, +unsigned MsiDatabaseExportA( MSIOBJECT *handle, const CHAR *szTable, const CHAR *szFolder, const CHAR *szFilename ) { WCHAR *path = NULL; WCHAR *file = NULL; WCHAR *table = NULL; - UINT r = ERROR_OUTOFMEMORY; + unsigned r = ERROR_OUTOFMEMORY; TRACE("%x %s %s %s\n", handle, debugstr_a(szTable), debugstr_a(szFolder), debugstr_a(szFilename)); @@ -1293,10 +1293,10 @@ end: return r; } -UINT MsiDatabaseMergeA(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, +unsigned MsiDatabaseMergeA(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, const CHAR *szTableName) { - UINT r; + unsigned r; WCHAR *table; TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge, @@ -1314,13 +1314,13 @@ typedef struct _tagMERGETABLE struct list entry; struct list rows; WCHAR *name; - DWORD numconflicts; + unsigned numconflicts; WCHAR **columns; - DWORD numcolumns; + unsigned numcolumns; WCHAR **types; - DWORD numtypes; + unsigned numtypes; WCHAR **labels; - DWORD numlabels; + unsigned numlabels; } MERGETABLE; typedef struct _tagMERGEROW @@ -1351,10 +1351,10 @@ static BOOL merge_type_match(const WCHAR *type1, const WCHAR *type2) return !strcmpW( type1, type2 ); } -static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) +static unsigned merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) { MSIRECORD *dbrec, *mergerec; - UINT r, i, count; + unsigned r, i, count; r = MSI_ViewGetColumnInfo(dbview, MSICOLINFO_NAMES, &dbrec); if (r != ERROR_SUCCESS) @@ -1410,11 +1410,11 @@ done: return r; } -static UINT merge_verify_primary_keys(MSIDATABASE *db, MSIDATABASE *mergedb, +static unsigned merge_verify_primary_keys(MSIDATABASE *db, MSIDATABASE *mergedb, const WCHAR *table) { MSIRECORD *dbrec, *mergerec = NULL; - UINT r, i, count; + unsigned r, i, count; r = MSI_DatabaseGetPrimaryKeys(db, table, &dbrec); if (r != ERROR_SUCCESS) @@ -1452,7 +1452,7 @@ static WCHAR *get_key_value(MSIQUERY *view, const WCHAR *key, MSIRECORD *rec) MSIRECORD *colnames; WCHAR *str; WCHAR *val; - UINT r, i = 0, sz = 0; + unsigned r, i = 0, sz = 0; int cmp; r = MSI_ViewGetColumnInfo(view, MSICOLINFO_NAMES, &colnames); @@ -1514,9 +1514,9 @@ static WCHAR *create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view, WCHAR *val; const WCHAR *setptr; const WCHAR *key; - DWORD size, oldsize; + unsigned size, oldsize; MSIRECORD *keys; - UINT r, i, count; + unsigned r, i, count; static const WCHAR keyset[] = { '`','%','s','`',' ','=',' ','%','s',' ','A','N','D',' ',0}; @@ -1572,7 +1572,7 @@ done: return query; } -static UINT merge_diff_row(MSIRECORD *rec, void *param) +static unsigned merge_diff_row(MSIRECORD *rec, void *param) { MERGEDATA *data = param; MERGETABLE *table = data->curtable; @@ -1580,7 +1580,7 @@ static UINT merge_diff_row(MSIRECORD *rec, void *param) MSIQUERY *dbview = NULL; MSIRECORD *row = NULL; WCHAR *query = NULL; - UINT r = ERROR_SUCCESS; + unsigned r = ERROR_SUCCESS; if (TABLE_Exists(data->db, table->name)) { @@ -1632,9 +1632,9 @@ done: return r; } -static UINT msi_get_table_labels(MSIDATABASE *db, const WCHAR *table, WCHAR ***labels, DWORD *numlabels) +static unsigned msi_get_table_labels(MSIDATABASE *db, const WCHAR *table, WCHAR ***labels, unsigned *numlabels) { - UINT r, i, count; + unsigned r, i, count; MSIRECORD *prec = NULL; r = MSI_DatabaseGetPrimaryKeys(db, table, &prec); @@ -1661,9 +1661,9 @@ end: return r; } -static UINT msi_get_query_columns(MSIQUERY *query, WCHAR ***columns, DWORD *numcolumns) +static unsigned msi_get_query_columns(MSIQUERY *query, WCHAR ***columns, unsigned *numcolumns) { - UINT r, i, count; + unsigned r, i, count; MSIRECORD *prec = NULL; r = MSI_ViewGetColumnInfo(query, MSICOLINFO_NAMES, &prec); @@ -1690,9 +1690,9 @@ end: return r; } -static UINT msi_get_query_types(MSIQUERY *query, WCHAR ***types, DWORD *numtypes) +static unsigned msi_get_query_types(MSIQUERY *query, WCHAR ***types, unsigned *numtypes) { - UINT r, i, count; + unsigned r, i, count; MSIRECORD *prec = NULL; r = MSI_ViewGetColumnInfo(query, MSICOLINFO_TYPES, &prec); @@ -1734,7 +1734,7 @@ static void merge_free_rows(MERGETABLE *table) static void free_merge_table(MERGETABLE *table) { - UINT i; + unsigned i; if (table->labels != NULL) { @@ -1766,9 +1766,9 @@ static void free_merge_table(MERGETABLE *table) msi_free(table); } -static UINT msi_get_merge_table (MSIDATABASE *db, const WCHAR *name, MERGETABLE **ptable) +static unsigned msi_get_merge_table (MSIDATABASE *db, const WCHAR *name, MERGETABLE **ptable) { - UINT r; + unsigned r; MERGETABLE *table; MSIQUERY *mergeview = NULL; @@ -1814,14 +1814,14 @@ err: return r; } -static UINT merge_diff_tables(MSIRECORD *rec, void *param) +static unsigned merge_diff_tables(MSIRECORD *rec, void *param) { MERGEDATA *data = param; MERGETABLE *table; MSIQUERY *dbview = NULL; MSIQUERY *mergeview = NULL; const WCHAR *name; - UINT r; + unsigned r; static const WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ','`','%','s','`',0}; @@ -1868,7 +1868,7 @@ done: return r; } -static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, +static unsigned gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, struct list *tabledata) { static const WCHAR query[] = { @@ -1876,7 +1876,7 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, '`','_','T','a','b','l','e','s','`',0}; MSIQUERY *view; MERGEDATA data; - UINT r; + unsigned r; r = MSI_DatabaseOpenViewW(merge, query, &view); if (r != ERROR_SUCCESS) @@ -1890,9 +1890,9 @@ static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge, return r; } -static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) +static unsigned merge_table(MSIDATABASE *db, MERGETABLE *table) { - UINT r; + unsigned r; MERGEROW *row; MSIVIEW *tv; @@ -1920,10 +1920,10 @@ static UINT merge_table(MSIDATABASE *db, MERGETABLE *table) return ERROR_SUCCESS; } -static UINT update_merge_errors(MSIDATABASE *db, const WCHAR *error, - WCHAR *table, DWORD numconflicts) +static unsigned update_merge_errors(MSIDATABASE *db, const WCHAR *error, + WCHAR *table, unsigned numconflicts) { - UINT r; + unsigned r; MSIQUERY *view; static const WCHAR create[] = { @@ -1962,7 +1962,7 @@ static UINT update_merge_errors(MSIDATABASE *db, const WCHAR *error, return r; } -UINT MsiDatabaseMergeW(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, +unsigned MsiDatabaseMergeW(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, const WCHAR *szTableName) { struct list tabledata = LIST_INIT(tabledata); @@ -1970,7 +1970,7 @@ UINT MsiDatabaseMergeW(MSIOBJECT *hDatabase, MSIOBJECT *hDatabaseMerge, MSIDATABASE *db, *merge; MERGETABLE *table; BOOL conflicts; - UINT r; + unsigned r; TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge, debugstr_w(szTableName)); diff --git a/libmsi/delete.c b/libmsi/delete.c index b6371db..f7b352c 100644 --- a/libmsi/delete.c +++ b/libmsi/delete.c @@ -53,7 +53,7 @@ typedef struct tagMSIDELETEVIEW MSIVIEW *table; } MSIDELETEVIEW; -static UINT DELETE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned DELETE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -62,7 +62,7 @@ static UINT DELETE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return ERROR_FUNCTION_FAILED; } -static UINT DELETE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm) +static unsigned DELETE_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, IStream **stm) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -71,10 +71,10 @@ static UINT DELETE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **st return ERROR_FUNCTION_FAILED; } -static UINT DELETE_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned DELETE_execute( MSIVIEW *view, MSIRECORD *record ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; - UINT r, i, rows = 0, cols = 0; + unsigned r, i, rows = 0, cols = 0; TRACE("%p %p\n", dv, record); @@ -98,7 +98,7 @@ static UINT DELETE_execute( MSIVIEW *view, MSIRECORD *record ) return ERROR_SUCCESS; } -static UINT DELETE_close( MSIVIEW *view ) +static unsigned DELETE_close( MSIVIEW *view ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -110,7 +110,7 @@ static UINT DELETE_close( MSIVIEW *view ) return dv->table->ops->close( dv->table ); } -static UINT DELETE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned DELETE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -124,8 +124,8 @@ static UINT DELETE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return dv->table->ops->get_dimensions( dv->table, NULL, cols ); } -static UINT DELETE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned DELETE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -138,8 +138,8 @@ static UINT DELETE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, type, temporary, table_name); } -static UINT DELETE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned DELETE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -148,7 +148,7 @@ static UINT DELETE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return ERROR_FUNCTION_FAILED; } -static UINT DELETE_delete( MSIVIEW *view ) +static unsigned DELETE_delete( MSIVIEW *view ) { MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view; @@ -162,8 +162,8 @@ static UINT DELETE_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT DELETE_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned DELETE_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { TRACE("%p, %d, %u, %p\n", view, col, val, *handle); @@ -194,7 +194,7 @@ static const MSIVIEWOPS delete_ops = NULL, }; -UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) +unsigned DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) { MSIDELETEVIEW *dv = NULL; diff --git a/libmsi/distinct.c b/libmsi/distinct.c index d8cb895..3439855 100644 --- a/libmsi/distinct.c +++ b/libmsi/distinct.c @@ -35,9 +35,9 @@ typedef struct tagDISTINCTSET { - UINT val; - UINT count; - UINT row; + unsigned val; + unsigned count; + unsigned row; struct tagDISTINCTSET *nextrow; struct tagDISTINCTSET *nextcol; } DISTINCTSET; @@ -47,11 +47,11 @@ typedef struct tagMSIDISTINCTVIEW MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; - UINT row_count; - UINT *translation; + unsigned row_count; + unsigned *translation; } MSIDISTINCTVIEW; -static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row ) +static DISTINCTSET ** distinct_insert( DISTINCTSET **x, unsigned val, unsigned row ) { /* horrible O(n) find */ while( *x ) @@ -88,7 +88,7 @@ static void distinct_free( DISTINCTSET *x ) } } -static UINT DISTINCT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned DISTINCT_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -105,10 +105,10 @@ static UINT DISTINCT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return dv->table->ops->fetch_int( dv->table, row, col, val ); } -static UINT DISTINCT_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned DISTINCT_execute( MSIVIEW *view, MSIRECORD *record ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; - UINT r, i, j, r_count, c_count; + unsigned r, i, j, r_count, c_count; DISTINCTSET *rowset = NULL; TRACE("%p %p\n", dv, record); @@ -124,7 +124,7 @@ static UINT DISTINCT_execute( MSIVIEW *view, MSIRECORD *record ) if( r != ERROR_SUCCESS ) return r; - dv->translation = msi_alloc( r_count*sizeof(UINT) ); + dv->translation = msi_alloc( r_count*sizeof(unsigned) ); if( !dv->translation ) return ERROR_FUNCTION_FAILED; @@ -135,7 +135,7 @@ static UINT DISTINCT_execute( MSIVIEW *view, MSIRECORD *record ) for( j=1; j<=c_count; j++ ) { - UINT val = 0; + unsigned val = 0; r = dv->table->ops->fetch_int( dv->table, i, j, &val ); if( r != ERROR_SUCCESS ) { @@ -167,7 +167,7 @@ static UINT DISTINCT_execute( MSIVIEW *view, MSIRECORD *record ) return ERROR_SUCCESS; } -static UINT DISTINCT_close( MSIVIEW *view ) +static unsigned DISTINCT_close( MSIVIEW *view ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -183,7 +183,7 @@ static UINT DISTINCT_close( MSIVIEW *view ) return dv->table->ops->close( dv->table ); } -static UINT DISTINCT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned DISTINCT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -202,8 +202,8 @@ static UINT DISTINCT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return dv->table->ops->get_dimensions( dv->table, NULL, cols ); } -static UINT DISTINCT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned DISTINCT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -216,8 +216,8 @@ static UINT DISTINCT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, type, temporary, table_name ); } -static UINT DISTINCT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned DISTINCT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -229,7 +229,7 @@ static UINT DISTINCT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return dv->table->ops->modify( dv->table, eModifyMode, rec, row ); } -static UINT DISTINCT_delete( MSIVIEW *view ) +static unsigned DISTINCT_delete( MSIVIEW *view ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; @@ -245,11 +245,11 @@ static UINT DISTINCT_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT DISTINCT_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned DISTINCT_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view; - UINT r; + unsigned r; TRACE("%p, %d, %u, %p\n", view, col, val, *handle); @@ -289,10 +289,10 @@ static const MSIVIEWOPS distinct_ops = NULL, }; -UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) +unsigned DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) { MSIDISTINCTVIEW *dv = NULL; - UINT count = 0, r; + unsigned count = 0, r; TRACE("%p\n", dv ); diff --git a/libmsi/drop.c b/libmsi/drop.c index 0be6435..69cc32f 100644 --- a/libmsi/drop.c +++ b/libmsi/drop.c @@ -38,13 +38,13 @@ typedef struct tagMSIDROPVIEW MSIDATABASE *db; MSIVIEW *table; column_info *colinfo; - INT hold; + int hold; } MSIDROPVIEW; -static UINT DROP_execute(MSIVIEW *view, MSIRECORD *record) +static unsigned DROP_execute(MSIVIEW *view, MSIRECORD *record) { MSIDROPVIEW *dv = (MSIDROPVIEW*)view; - UINT r; + unsigned r; TRACE("%p %p\n", dv, record); @@ -58,7 +58,7 @@ static UINT DROP_execute(MSIVIEW *view, MSIRECORD *record) return dv->table->ops->drop(dv->table); } -static UINT DROP_close(MSIVIEW *view) +static unsigned DROP_close(MSIVIEW *view) { MSIDROPVIEW *dv = (MSIDROPVIEW*)view; @@ -67,7 +67,7 @@ static UINT DROP_close(MSIVIEW *view) return ERROR_SUCCESS; } -static UINT DROP_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) +static unsigned DROP_get_dimensions(MSIVIEW *view, unsigned *rows, unsigned *cols) { MSIDROPVIEW *dv = (MSIDROPVIEW*)view; @@ -76,7 +76,7 @@ static UINT DROP_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) return ERROR_FUNCTION_FAILED; } -static UINT DROP_delete( MSIVIEW *view ) +static unsigned DROP_delete( MSIVIEW *view ) { MSIDROPVIEW *dv = (MSIDROPVIEW*)view; @@ -113,10 +113,10 @@ static const MSIVIEWOPS drop_ops = NULL, }; -UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, const WCHAR *name) +unsigned DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, const WCHAR *name) { MSIDROPVIEW *dv; - UINT r; + unsigned r; TRACE("%p %s\n", view, debugstr_w(name)); diff --git a/libmsi/handle.c b/libmsi/handle.c index deb9069..3ff52d4 100644 --- a/libmsi/handle.c +++ b/libmsi/handle.c @@ -37,11 +37,11 @@ static CRITICAL_SECTION_DEBUG MSI_object_cs_debug = 0, 0, &MSI_object_cs, { &MSI_object_cs_debug.ProcessLocksList, &MSI_object_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_object_cs") } + 0, 0, { (uintptr_t)(__FILE__ ": MSI_object_cs") } }; static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 }; -void *msihandle2msiinfo(MSIOBJECT *obj, UINT type) +void *msihandle2msiinfo(MSIOBJECT *obj, unsigned type) { if( !obj ) return NULL; @@ -52,7 +52,7 @@ void *msihandle2msiinfo(MSIOBJECT *obj, UINT type) return obj; } -void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ) +void *alloc_msiobject(unsigned type, unsigned size, msihandledestructor destroy ) { MSIOBJECT *info; @@ -107,7 +107,7 @@ int msiobj_release( MSIOBJECT *obj ) /*********************************************************** * MsiCloseHandle [MSI.@] */ -UINT MsiCloseHandle(MSIOBJECT *obj) +unsigned MsiCloseHandle(MSIOBJECT *obj) { TRACE("%x\n",obj); diff --git a/libmsi/insert.c b/libmsi/insert.c index 13cbc6b..27a78ef 100644 --- a/libmsi/insert.c +++ b/libmsi/insert.c @@ -47,7 +47,7 @@ typedef struct tagMSIINSERTVIEW column_info *vals; } MSIINSERTVIEW; -static UINT INSERT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned INSERT_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; @@ -62,10 +62,10 @@ static UINT INSERT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) * Merge a value_list and a record to create a second record. * Replace wildcard entries in the valuelist with values from the record */ -MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) +MSIRECORD *msi_query_merge_record( unsigned fields, const column_info *vl, MSIRECORD *rec ) { MSIRECORD *merged; - DWORD wildcard_count = 1, i; + unsigned wildcard_count = 1, i; merged = MSI_CreateRecord( fields ); for( i=1; i <= fields; i++ ) @@ -105,11 +105,11 @@ err: /* checks to see if the column order specified in the INSERT query * matches the column order of the table */ -static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count) +static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, unsigned col_count) { const WCHAR *a; const WCHAR *b; - UINT i; + unsigned i; for (i = 1; i <= col_count; i++) { @@ -124,11 +124,11 @@ static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count) /* rearranges the data in the record to be inserted based on column order, * and pads the record for any missing columns in the INSERT query */ -static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) +static unsigned msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) { MSIRECORD *padded; - UINT col_count, val_count; - UINT r, i, colidx; + unsigned col_count, val_count; + unsigned r, i, colidx; const WCHAR *a; const WCHAR *b; @@ -179,7 +179,7 @@ err: static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) { - UINT r, i, col_count, type; + unsigned r, i, col_count, type; r = iv->table->ops->get_dimensions( iv->table, NULL, &col_count ); if (r != ERROR_SUCCESS) @@ -202,10 +202,10 @@ static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row) return FALSE; } -static UINT INSERT_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned INSERT_execute( MSIVIEW *view, MSIRECORD *record ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; - UINT r, row = -1, col_count = 0; + unsigned r, row = -1, col_count = 0; MSIVIEW *sv; MSIRECORD *values = NULL; @@ -250,7 +250,7 @@ err: } -static UINT INSERT_close( MSIVIEW *view ) +static unsigned INSERT_close( MSIVIEW *view ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; MSIVIEW *sv; @@ -264,7 +264,7 @@ static UINT INSERT_close( MSIVIEW *view ) return sv->ops->close( sv ); } -static UINT INSERT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned INSERT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; MSIVIEW *sv; @@ -278,8 +278,8 @@ static UINT INSERT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return sv->ops->get_dimensions( sv, rows, cols ); } -static UINT INSERT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned INSERT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; MSIVIEW *sv; @@ -293,7 +293,7 @@ static UINT INSERT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return sv->ops->get_column_info( sv, n, name, type, temporary, table_name ); } -static UINT INSERT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) +static unsigned INSERT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, unsigned row) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; @@ -302,7 +302,7 @@ static UINT INSERT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, return ERROR_FUNCTION_FAILED; } -static UINT INSERT_delete( MSIVIEW *view ) +static unsigned INSERT_delete( MSIVIEW *view ) { MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view; MSIVIEW *sv; @@ -318,8 +318,8 @@ static UINT INSERT_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT INSERT_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned INSERT_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { TRACE("%p, %d, %u, %p\n", view, col, val, *handle); @@ -350,19 +350,19 @@ static const MSIVIEWOPS insert_ops = NULL, }; -static UINT count_column_info( const column_info *ci ) +static unsigned count_column_info( const column_info *ci ) { - UINT n = 0; + unsigned n = 0; for ( ; ci; ci = ci->next ) n++; return n; } -UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, +unsigned INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, column_info *columns, column_info *values, BOOL temp ) { MSIINSERTVIEW *iv = NULL; - UINT r; + unsigned r; MSIVIEW *tv = NULL, *sv = NULL; TRACE("%p\n", iv ); diff --git a/libmsi/msipriv.h b/libmsi/msipriv.h index 6f2def5..865efbf 100644 --- a/libmsi/msipriv.h +++ b/libmsi/msipriv.h @@ -62,8 +62,8 @@ typedef VOID (*msihandledestructor)( MSIOBJECT * ); struct tagMSIOBJECT { - UINT magic; - UINT type; + unsigned magic; + unsigned type; LONG refcount; msihandledestructor destructor; }; @@ -76,12 +76,12 @@ typedef struct tagMSIDATABASE MSIOBJECT hdr; IStorage *storage; string_table *strings; - UINT bytes_per_strref; + unsigned bytes_per_strref; WCHAR *path; WCHAR *deletefile; const WCHAR *mode; - UINT media_transform_offset; - UINT media_transform_disk_id; + unsigned media_transform_offset; + unsigned media_transform_disk_id; struct list tables; struct list transforms; struct list streams; @@ -93,7 +93,7 @@ typedef struct tagMSIQUERY { MSIOBJECT hdr; MSIVIEW *view; - UINT row; + unsigned row; MSIDATABASE *db; struct list mem; } MSIQUERY; @@ -101,11 +101,11 @@ typedef struct tagMSIQUERY /* maybe we can use a Variant instead of doing it ourselves? */ typedef struct tagMSIFIELD { - UINT type; + unsigned type; union { - INT iVal; - INT_PTR pVal; + int iVal; + intptr_t pVal; WCHAR *szwVal; IStream *stream; } u; @@ -114,7 +114,7 @@ typedef struct tagMSIFIELD typedef struct tagMSIRECORD { MSIOBJECT hdr; - UINT count; /* as passed to MsiCreateRecord */ + unsigned count; /* as passed to MsiCreateRecord */ MSIFIELD fields[1]; /* nb. array size is count+1 */ } MSIRECORD; @@ -122,7 +122,7 @@ typedef struct _column_info { const WCHAR *table; const WCHAR *column; - INT type; + int type; BOOL temporary; struct expr *val; struct _column_info *next; @@ -141,7 +141,7 @@ typedef struct tagMSIVIEWOPS * To get a string value, query the database's string table with * the integer value returned from this function. */ - UINT (*fetch_int)( MSIVIEW *view, UINT row, UINT col, UINT *val ); + unsigned (*fetch_int)( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ); /* * fetch_stream - gets a stream from {row,col} in the table @@ -149,40 +149,40 @@ typedef struct tagMSIVIEWOPS * This function is similar to fetch_int, except fetches a * stream instead of an integer. */ - UINT (*fetch_stream)( MSIVIEW *view, UINT row, UINT col, IStream **stm ); + unsigned (*fetch_stream)( MSIVIEW *view, unsigned row, unsigned col, IStream **stm ); /* * get_row - gets values from a row * */ - UINT (*get_row)( MSIVIEW *view, UINT row, MSIRECORD **rec ); + unsigned (*get_row)( MSIVIEW *view, unsigned row, MSIRECORD **rec ); /* * set_row - sets values in a row as specified by mask * * Similar semantics to fetch_int */ - UINT (*set_row)( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ); + unsigned (*set_row)( MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask ); /* * Inserts a new row into the database from the records contents */ - UINT (*insert_row)( MSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary ); + unsigned (*insert_row)( MSIVIEW *view, MSIRECORD *record, unsigned row, BOOL temporary ); /* * Deletes a row from the database */ - UINT (*delete_row)( MSIVIEW *view, UINT row ); + unsigned (*delete_row)( MSIVIEW *view, unsigned row ); /* * execute - loads the underlying data into memory so it can be read */ - UINT (*execute)( MSIVIEW *view, MSIRECORD *record ); + unsigned (*execute)( MSIVIEW *view, MSIRECORD *record ); /* * close - clears the data read by execute from memory */ - UINT (*close)( MSIVIEW *view ); + unsigned (*close)( MSIVIEW *view ); /* * get_dimensions - returns the number of rows or columns in a table. @@ -190,25 +190,25 @@ typedef struct tagMSIVIEWOPS * The number of rows can only be queried after the execute method * is called. The number of columns can be queried at any time. */ - UINT (*get_dimensions)( MSIVIEW *view, UINT *rows, UINT *cols ); + unsigned (*get_dimensions)( MSIVIEW *view, unsigned *rows, unsigned *cols ); /* * get_column_info - returns the name and type of a specific column * * The column information can be queried at any time. */ - UINT (*get_column_info)( MSIVIEW *view, UINT n, const WCHAR **name, UINT *type, + unsigned (*get_column_info)( MSIVIEW *view, unsigned n, const WCHAR **name, unsigned *type, BOOL *temporary, const WCHAR **table_name ); /* * modify - not yet implemented properly */ - UINT (*modify)( MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *record, UINT row ); + unsigned (*modify)( MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *record, unsigned row ); /* * delete - destroys the structure completely */ - UINT (*delete)( MSIVIEW * ); + unsigned (*delete)( MSIVIEW * ); /* * find_matching_rows - iterates through rows that match a value @@ -221,37 +221,37 @@ typedef struct tagMSIVIEWOPS * position in the iteration. It must be initialised to zero before the * first call and continued to be passed in to subsequent calls. */ - UINT (*find_matching_rows)( MSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle ); + unsigned (*find_matching_rows)( MSIVIEW *view, unsigned col, unsigned val, unsigned *row, MSIITERHANDLE *handle ); /* * add_ref - increases the reference count of the table */ - UINT (*add_ref)( MSIVIEW *view ); + unsigned (*add_ref)( MSIVIEW *view ); /* * release - decreases the reference count of the table */ - UINT (*release)( MSIVIEW *view ); + unsigned (*release)( MSIVIEW *view ); /* * add_column - adds a column to the table */ - UINT (*add_column)( MSIVIEW *view, const WCHAR *table, UINT number, const WCHAR *column, UINT type, BOOL hold ); + unsigned (*add_column)( MSIVIEW *view, const WCHAR *table, unsigned number, const WCHAR *column, unsigned type, BOOL hold ); /* * remove_column - removes the column represented by table name and column number from the table */ - UINT (*remove_column)( MSIVIEW *view, const WCHAR *table, UINT number ); + unsigned (*remove_column)( MSIVIEW *view, const WCHAR *table, unsigned number ); /* * sort - orders the table by columns */ - UINT (*sort)( MSIVIEW *view, column_info *columns ); + unsigned (*sort)( MSIVIEW *view, column_info *columns ); /* * drop - drops the table from the database */ - UINT (*drop)( MSIVIEW *view ); + unsigned (*drop)( MSIVIEW *view ); } MSIVIEWOPS; struct tagMSIVIEW @@ -268,7 +268,7 @@ typedef struct tagMSISUMMARYINFO { MSIOBJECT hdr; IStorage *storage; - DWORD update_count; + unsigned update_count; PROPVARIANT property[MSI_MAX_PROPS]; } MSISUMMARYINFO; @@ -297,13 +297,13 @@ typedef struct { } str; } awcstring; -UINT msi_strcpy_to_awstring( const WCHAR *str, awstring *awbuf, DWORD *sz ); +unsigned msi_strcpy_to_awstring( const WCHAR *str, awstring *awbuf, unsigned *sz ); /* handle functions */ -extern void *msihandle2msiinfo(MSIOBJECT *handle, UINT type); +extern void *msihandle2msiinfo(MSIOBJECT *handle, unsigned type); extern MSIOBJECT *alloc_msihandle( MSIOBJECT * ); extern MSIOBJECT *alloc_msi_remote_handle( IUnknown *unk ); -extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ); +extern void *alloc_msiobject(unsigned type, unsigned size, msihandledestructor destroy ); extern void msiobj_addref(MSIOBJECT *); extern int msiobj_release(MSIOBJECT *); extern void msiobj_lock(MSIOBJECT *); @@ -311,7 +311,7 @@ extern void msiobj_unlock(MSIOBJECT *); extern void msi_free_handle_table(void); extern void free_cached_tables( MSIDATABASE *db ); -extern UINT MSI_CommitTables( MSIDATABASE *db ); +extern unsigned MSI_CommitTables( MSIDATABASE *db ); /* string table functions */ @@ -321,53 +321,53 @@ enum StringPersistence StringNonPersistent = 1 }; -extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence ); -extern UINT msi_string2idW( const string_table *st, const WCHAR *buffer, UINT *id ); +extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, uint16_t refcount, enum StringPersistence persistence ); +extern unsigned msi_string2idW( const string_table *st, const WCHAR *buffer, unsigned *id ); extern VOID msi_destroy_stringtable( string_table *st ); -extern const WCHAR *msi_string_lookup_id( const string_table *st, UINT id ); +extern const WCHAR *msi_string_lookup_id( const string_table *st, unsigned id ); extern HRESULT msi_init_string_table( IStorage *stg ); -extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ); -extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref ); -extern UINT msi_get_string_table_codepage( const string_table *st ); -extern UINT msi_set_string_table_codepage( string_table *st, UINT codepage ); +extern string_table *msi_load_string_table( IStorage *stg, unsigned *bytes_per_strref ); +extern unsigned msi_save_string_table( const string_table *st, IStorage *storage, unsigned *bytes_per_strref ); +extern unsigned msi_get_string_table_codepage( const string_table *st ); +extern unsigned msi_set_string_table_codepage( string_table *st, unsigned codepage ); extern BOOL TABLE_Exists( MSIDATABASE *db, const WCHAR *name ); extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, const WCHAR *table ); -extern UINT read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, - BYTE **pdata, UINT *psz ); -extern UINT write_stream_data( IStorage *stg, const WCHAR *stname, - const void *data, UINT sz, BOOL bTable ); +extern unsigned read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, + uint8_t **pdata, unsigned *psz ); +extern unsigned write_stream_data( IStorage *stg, const WCHAR *stname, + const void *data, unsigned sz, BOOL bTable ); /* transform functions */ -extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ); -extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, +extern unsigned msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ); +extern unsigned MSI_DatabaseApplyTransformW( MSIDATABASE *db, const WCHAR *szTransformFile, int iErrorCond ); extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg ); /* record internals */ extern void MSI_CloseRecord( MSIOBJECT * ); -extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *); -extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **); -extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT ); -extern MSIRECORD *MSI_CreateRecord( UINT ); -extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int ); -extern UINT MSI_RecordSetIntPtr( MSIRECORD *, UINT, INT_PTR ); -extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, const WCHAR *); -extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT ); -extern UINT MSI_RecordGetStringW( MSIRECORD *, UINT, WCHAR *, DWORD *); -extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, CHAR *, DWORD *); -extern int MSI_RecordGetInteger( MSIRECORD *, UINT ); -extern INT_PTR MSI_RecordGetIntPtr( MSIRECORD *, UINT ); -extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, DWORD *); -extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *); -extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec ); -extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, const WCHAR *); -extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, const WCHAR *); -extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ); +extern unsigned MSI_RecordSetIStream( MSIRECORD *, unsigned, IStream *); +extern unsigned MSI_RecordGetIStream( MSIRECORD *, unsigned, IStream **); +extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, unsigned ); +extern MSIRECORD *MSI_CreateRecord( unsigned ); +extern unsigned MSI_RecordSetInteger( MSIRECORD *, unsigned, int ); +extern unsigned MSI_RecordSetIntPtr( MSIRECORD *, unsigned, intptr_t ); +extern unsigned MSI_RecordSetStringW( MSIRECORD *, unsigned, const WCHAR *); +extern BOOL MSI_RecordIsNull( MSIRECORD *, unsigned ); +extern unsigned MSI_RecordGetStringW( MSIRECORD *, unsigned, WCHAR *, unsigned *); +extern unsigned MSI_RecordGetStringA( MSIRECORD *, unsigned, CHAR *, unsigned *); +extern int MSI_RecordGetInteger( MSIRECORD *, unsigned ); +extern intptr_t MSI_RecordGetIntPtr( MSIRECORD *, unsigned ); +extern unsigned MSI_RecordReadStream( MSIRECORD *, unsigned, char *, unsigned *); +extern unsigned MSI_RecordSetStream(MSIRECORD *, unsigned, IStream *); +extern unsigned MSI_RecordGetFieldCount( const MSIRECORD *rec ); +extern unsigned MSI_RecordStreamToFile( MSIRECORD *, unsigned, const WCHAR *); +extern unsigned MSI_RecordSetStreamFromFileW( MSIRECORD *, unsigned, const WCHAR *); +extern unsigned MSI_RecordCopyField( MSIRECORD *, unsigned, MSIRECORD *, unsigned ); extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ); extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ); -extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field); +extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field); /* stream internals */ extern void enum_stream_names( IStorage *stg ); @@ -375,38 +375,38 @@ extern WCHAR *encode_streamname(BOOL bTable, const WCHAR *in); extern BOOL decode_streamname(const WCHAR *in, WCHAR *out); /* database internals */ -extern UINT msi_get_raw_stream( MSIDATABASE *, const WCHAR *, IStream **); -extern UINT msi_clone_open_stream( MSIDATABASE *, IStorage *, const WCHAR *, IStream ** ); +extern unsigned msi_get_raw_stream( MSIDATABASE *, const WCHAR *, IStream **); +extern unsigned msi_clone_open_stream( MSIDATABASE *, IStorage *, const WCHAR *, IStream ** ); void msi_destroy_stream( MSIDATABASE *, const WCHAR * ); -extern UINT MSI_OpenDatabaseW( const WCHAR *, const WCHAR *, MSIDATABASE **); -extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, const WCHAR *, MSIQUERY **); -extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, const WCHAR *, ... ); -typedef UINT (*record_func)( MSIRECORD *, void *); -extern UINT MSI_IterateRecords( MSIQUERY *, DWORD *, record_func, void *); +extern unsigned MSI_OpenDatabaseW( const WCHAR *, const WCHAR *, MSIDATABASE **); +extern unsigned MSI_DatabaseOpenViewW(MSIDATABASE *, const WCHAR *, MSIQUERY **); +extern unsigned MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, const WCHAR *, ... ); +typedef unsigned (*record_func)( MSIRECORD *, void *); +extern unsigned MSI_IterateRecords( MSIQUERY *, unsigned *, record_func, void *); extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, const WCHAR *query, ... ); -extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, const WCHAR *, MSIRECORD **); +extern unsigned MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, const WCHAR *, MSIRECORD **); /* view internals */ -extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * ); -extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ); -extern UINT MSI_ViewClose( MSIQUERY* ); -extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **); -extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ); -extern UINT VIEW_find_column( MSIVIEW *, const WCHAR *, const WCHAR *, UINT *); -extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **); +extern unsigned MSI_ViewExecute( MSIQUERY*, MSIRECORD * ); +extern unsigned MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ); +extern unsigned MSI_ViewClose( MSIQUERY* ); +extern unsigned MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **); +extern unsigned MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ); +extern unsigned VIEW_find_column( MSIVIEW *, const WCHAR *, const WCHAR *, unsigned *); +extern unsigned msi_view_get_row(MSIDATABASE *, MSIVIEW *, unsigned, MSIRECORD **); /* summary information */ -extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ); -extern WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ); -extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ); +extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, unsigned uiUpdateCount ); +extern WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si, unsigned uiProperty ); +extern int msi_suminfo_get_int32( MSISUMMARYINFO *si, unsigned uiProperty ); extern WCHAR *msi_get_suminfo_product( IStorage *stg ); -extern UINT msi_add_suminfo( MSIDATABASE *db, WCHAR ***records, int num_records, int num_columns ); +extern unsigned msi_add_suminfo( MSIDATABASE *db, WCHAR ***records, int num_records, int num_columns ); /* Helpers */ -extern WCHAR *msi_dup_record_field(MSIRECORD *row, INT index); +extern WCHAR *msi_dup_record_field(MSIRECORD *row, int index); extern WCHAR *msi_dup_property( MSIDATABASE *db, const WCHAR *prop ); -extern UINT msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *); -extern UINT msi_get_property( MSIDATABASE *, const WCHAR *, WCHAR *, DWORD *); +extern unsigned msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *); +extern unsigned msi_get_property( MSIDATABASE *, const WCHAR *, WCHAR *, unsigned *); extern int msi_get_property_int( MSIDATABASE *package, const WCHAR *prop, int def ); /* common strings */ @@ -550,7 +550,7 @@ static inline BOOL msi_free( void *mem ) static inline char *strdupWtoA( const WCHAR *str ) { CHAR *ret = NULL; - DWORD len; + unsigned len; if (!str) return ret; len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); @@ -563,7 +563,7 @@ static inline char *strdupWtoA( const WCHAR *str ) static inline WCHAR *strdupAtoW( const CHAR *str ) { WCHAR *ret = NULL; - DWORD len; + unsigned len; if (!str) return ret; len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); diff --git a/libmsi/msiquery.c b/libmsi/msiquery.c index 873a674..a4f22b5 100644 --- a/libmsi/msiquery.c +++ b/libmsi/msiquery.c @@ -54,11 +54,11 @@ static void MSI_CloseView( MSIOBJECT *arg ) } } -UINT VIEW_find_column( MSIVIEW *table, const WCHAR *name, const WCHAR *table_name, UINT *n ) +unsigned VIEW_find_column( MSIVIEW *table, const WCHAR *name, const WCHAR *table_name, unsigned *n ) { const WCHAR *col_name; const WCHAR *haystack_table_name; - UINT i, count, r; + unsigned i, count, r; r = table->ops->get_dimensions( table, NULL, &count ); if( r != ERROR_SUCCESS ) @@ -66,7 +66,7 @@ UINT VIEW_find_column( MSIVIEW *table, const WCHAR *name, const WCHAR *table_nam for( i=1; i<=count; i++ ) { - INT x; + int x; r = table->ops->get_column_info( table, i, &col_name, NULL, NULL, &haystack_table_name ); @@ -84,10 +84,10 @@ UINT VIEW_find_column( MSIVIEW *table, const WCHAR *name, const WCHAR *table_nam return ERROR_INVALID_PARAMETER; } -UINT MsiDatabaseOpenViewA(MSIOBJECT *hdb, +unsigned MsiDatabaseOpenViewA(MSIOBJECT *hdb, const CHAR *szQuery, MSIOBJECT **phView) { - UINT r; + unsigned r; WCHAR *szwQuery; TRACE("%d %s %p\n", hdb, debugstr_a(szQuery), phView); @@ -107,11 +107,11 @@ UINT MsiDatabaseOpenViewA(MSIOBJECT *hdb, return r; } -UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, +unsigned MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView) { MSIQUERY *query; - UINT r; + unsigned r; TRACE("%s %p\n", debugstr_w(szQuery), pView); @@ -139,9 +139,9 @@ UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, return r; } -UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, const WCHAR *fmt, ... ) +unsigned MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, const WCHAR *fmt, ... ) { - UINT r; + unsigned r; int size = 100, res; WCHAR *query; @@ -164,11 +164,11 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, const WCHAR *fmt, ... ) return r; } -UINT MSI_IterateRecords( MSIQUERY *view, DWORD *count, +unsigned MSI_IterateRecords( MSIQUERY *view, unsigned *count, record_func func, void *param ) { MSIRECORD *rec = NULL; - UINT r, n = 0, max = 0; + unsigned r, n = 0, max = 0; r = MSI_ViewExecute( view, NULL ); if( r != ERROR_SUCCESS ) @@ -206,7 +206,7 @@ MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, const WCHAR *fmt, ... ) { MSIRECORD *rec = NULL; MSIQUERY *view = NULL; - UINT r; + unsigned r; int size = 100, res; WCHAR *query; @@ -237,12 +237,12 @@ MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, const WCHAR *fmt, ... ) return rec; } -UINT MsiDatabaseOpenViewW(MSIOBJECT *hdb, +unsigned MsiDatabaseOpenViewW(MSIOBJECT *hdb, const WCHAR *szQuery, MSIOBJECT **phView) { MSIDATABASE *db; MSIQUERY *query = NULL; - UINT ret; + unsigned ret; TRACE("%s %p\n", debugstr_w(szQuery), phView); @@ -258,9 +258,9 @@ UINT MsiDatabaseOpenViewW(MSIOBJECT *hdb, return ret; } -UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) +unsigned msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, unsigned row, MSIRECORD **rec) { - UINT row_count = 0, col_count = 0, i, ival, ret, type; + unsigned row_count = 0, col_count = 0, i, ival, ret, type; TRACE("%p %p %d %p\n", db, view, row, rec); @@ -336,10 +336,10 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec) return ERROR_SUCCESS; } -UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec) +unsigned MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec) { MSIVIEW *view; - UINT r; + unsigned r; TRACE("%p %p\n", query, prec ); @@ -351,17 +351,17 @@ UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec) if (r == ERROR_SUCCESS) { query->row ++; - MSI_RecordSetIntPtr(*prec, 0, (INT_PTR)query); + MSI_RecordSetIntPtr(*prec, 0, (intptr_t)query); } return r; } -UINT MsiViewFetch(MSIOBJECT *hView, MSIOBJECT **record) +unsigned MsiViewFetch(MSIOBJECT *hView, MSIOBJECT **record) { MSIQUERY *query; MSIRECORD *rec = NULL; - UINT ret; + unsigned ret; TRACE("%d %p\n", hView, record); @@ -379,7 +379,7 @@ UINT MsiViewFetch(MSIOBJECT *hView, MSIOBJECT **record) return ret; } -UINT MSI_ViewClose(MSIQUERY *query) +unsigned MSI_ViewClose(MSIQUERY *query) { MSIVIEW *view; @@ -394,10 +394,10 @@ UINT MSI_ViewClose(MSIQUERY *query) return view->ops->close( view ); } -UINT MsiViewClose(MSIOBJECT *hView) +unsigned MsiViewClose(MSIOBJECT *hView) { MSIQUERY *query; - UINT ret; + unsigned ret; TRACE("%d\n", hView ); @@ -410,7 +410,7 @@ UINT MsiViewClose(MSIOBJECT *hView) return ret; } -UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec ) +unsigned MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec ) { MSIVIEW *view; @@ -426,11 +426,11 @@ UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec ) return view->ops->execute( view, rec ); } -UINT MsiViewExecute(MSIOBJECT *hView, MSIOBJECT *hRec) +unsigned MsiViewExecute(MSIOBJECT *hView, MSIOBJECT *hRec) { MSIQUERY *query; MSIRECORD *rec = NULL; - UINT ret; + unsigned ret; TRACE("%d %d\n", hView, hRec); @@ -460,8 +460,8 @@ out: return ret; } -static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, - UINT type, BOOL temporary ) +static unsigned msi_set_record_type_string( MSIRECORD *rec, unsigned field, + unsigned type, BOOL temporary ) { static const WCHAR fmt[] = { '%','d',0 }; WCHAR szType[0x10]; @@ -497,9 +497,9 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, return MSI_RecordSetStringW( rec, field, szType ); } -UINT MSI_ViewGetColumnInfo( MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec ) +unsigned MSI_ViewGetColumnInfo( MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec ) { - UINT r = ERROR_FUNCTION_FAILED, i, count = 0, type; + unsigned r = ERROR_FUNCTION_FAILED, i, count = 0, type; MSIRECORD *rec; MSIVIEW *view = query->view; const WCHAR *name; @@ -536,11 +536,11 @@ UINT MSI_ViewGetColumnInfo( MSIQUERY *query, MSICOLINFO info, MSIRECORD **prec ) return ERROR_SUCCESS; } -UINT MsiViewGetColumnInfo(MSIOBJECT *hView, MSICOLINFO info, MSIOBJECT **hRec) +unsigned MsiViewGetColumnInfo(MSIOBJECT *hView, MSICOLINFO info, MSIOBJECT **hRec) { MSIQUERY *query = NULL; MSIRECORD *rec = NULL; - UINT r; + unsigned r; TRACE("%d %d %p\n", hView, info, hRec); @@ -563,10 +563,10 @@ UINT MsiViewGetColumnInfo(MSIOBJECT *hView, MSICOLINFO info, MSIOBJECT **hRec) return r; } -UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) +unsigned MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) { MSIVIEW *view = NULL; - UINT r; + unsigned r; if ( !query || !rec ) return ERROR_INVALID_HANDLE; @@ -575,7 +575,7 @@ UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) if ( !view || !view->ops->modify) return ERROR_FUNCTION_FAILED; - if ( mode == MSIMODIFY_UPDATE && MSI_RecordGetIntPtr( rec, 0 ) != (INT_PTR)query ) + if ( mode == MSIMODIFY_UPDATE && MSI_RecordGetIntPtr( rec, 0 ) != (intptr_t)query ) return ERROR_FUNCTION_FAILED; r = view->ops->modify( view, mode, rec, query->row ); @@ -585,12 +585,12 @@ UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) return r; } -UINT MsiViewModify( MSIOBJECT *hView, MSIMODIFY eModifyMode, +unsigned MsiViewModify( MSIOBJECT *hView, MSIMODIFY eModifyMode, MSIOBJECT *hRecord) { MSIQUERY *query = NULL; MSIRECORD *rec = NULL; - UINT r = ERROR_FUNCTION_FAILED; + unsigned r = ERROR_FUNCTION_FAILED; TRACE("%d %x %d\n", hView, eModifyMode, hRecord); @@ -608,12 +608,12 @@ UINT MsiViewModify( MSIOBJECT *hView, MSIMODIFY eModifyMode, return r; } -MSIDBERROR MsiViewGetErrorW( MSIOBJECT *handle, WCHAR *buffer, DWORD *buflen ) +MSIDBERROR MsiViewGetErrorW( MSIOBJECT *handle, WCHAR *buffer, unsigned *buflen ) { MSIQUERY *query; const WCHAR *column; MSIDBERROR r; - DWORD len; + unsigned len; TRACE("%u %p %p\n", handle, buffer, buflen); @@ -640,12 +640,12 @@ MSIDBERROR MsiViewGetErrorW( MSIOBJECT *handle, WCHAR *buffer, DWORD *buflen ) return r; } -MSIDBERROR MsiViewGetErrorA( MSIOBJECT *handle, CHAR *buffer, DWORD *buflen ) +MSIDBERROR MsiViewGetErrorA( MSIOBJECT *handle, CHAR *buffer, unsigned *buflen ) { MSIQUERY *query; const WCHAR *column; MSIDBERROR r; - DWORD len; + unsigned len; TRACE("%u %p %p\n", handle, buffer, buflen); @@ -678,11 +678,11 @@ MSIOBJECT * MsiGetLastErrorRecord( void ) return 0; } -UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, +unsigned MSI_DatabaseApplyTransformW( MSIDATABASE *db, const WCHAR *szTransformFile, int iErrorCond ) { HRESULT r; - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; IStorage *stg = NULL; STATSTG stat; @@ -714,11 +714,11 @@ end: return ret; } -UINT MsiDatabaseApplyTransformW( MSIOBJECT *hdb, +unsigned MsiDatabaseApplyTransformW( MSIOBJECT *hdb, const WCHAR *szTransformFile, int iErrorCond) { MSIDATABASE *db; - UINT r; + unsigned r; db = msihandle2msiinfo( hdb, MSIOBJECTTYPE_DATABASE ); if( !db ) @@ -728,11 +728,11 @@ UINT MsiDatabaseApplyTransformW( MSIOBJECT *hdb, return r; } -UINT MsiDatabaseApplyTransformA( MSIOBJECT *hdb, +unsigned MsiDatabaseApplyTransformA( MSIOBJECT *hdb, const CHAR *szTransformFile, int iErrorCond) { WCHAR *wstr; - UINT ret; + unsigned ret; TRACE("%d %s %d\n", hdb, debugstr_a(szTransformFile), iErrorCond); @@ -747,10 +747,10 @@ UINT MsiDatabaseApplyTransformA( MSIOBJECT *hdb, return ret; } -UINT MsiDatabaseCommit( MSIOBJECT *hdb ) +unsigned MsiDatabaseCommit( MSIOBJECT *hdb ) { MSIDATABASE *db; - UINT r; + unsigned r; TRACE("%d\n", hdb); @@ -784,16 +784,16 @@ UINT MsiDatabaseCommit( MSIOBJECT *hdb ) struct msi_primary_key_record_info { - DWORD n; + unsigned n; MSIRECORD *rec; }; -static UINT msi_primary_key_iterator( MSIRECORD *rec, void *param ) +static unsigned msi_primary_key_iterator( MSIRECORD *rec, void *param ) { struct msi_primary_key_record_info *info = param; const WCHAR *name; const WCHAR *table; - DWORD type; + unsigned type; type = MSI_RecordGetInteger( rec, 4 ); if( type & MSITYPE_KEY ) @@ -815,7 +815,7 @@ static UINT msi_primary_key_iterator( MSIRECORD *rec, void *param ) return ERROR_SUCCESS; } -UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, +unsigned MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, const WCHAR *table, MSIRECORD **prec ) { static const WCHAR sql[] = { @@ -825,7 +825,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, '`','T','a','b','l','e','`',' ','=',' ','\'','%','s','\'',0 }; struct msi_primary_key_record_info info; MSIQUERY *query = NULL; - UINT r; + unsigned r; if (!TABLE_Exists( db, table )) return ERROR_INVALID_TABLE; @@ -856,12 +856,12 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, return r; } -UINT MsiDatabaseGetPrimaryKeysW( MSIOBJECT *hdb, +unsigned MsiDatabaseGetPrimaryKeysW( MSIOBJECT *hdb, const WCHAR *table, MSIOBJECT **phRec ) { MSIRECORD *rec = NULL; MSIDATABASE *db; - UINT r; + unsigned r; TRACE("%d %s %p\n", hdb, debugstr_w(table), phRec); @@ -877,11 +877,11 @@ UINT MsiDatabaseGetPrimaryKeysW( MSIOBJECT *hdb, return r; } -UINT MsiDatabaseGetPrimaryKeysA(MSIOBJECT *hdb, +unsigned MsiDatabaseGetPrimaryKeysA(MSIOBJECT *hdb, const CHAR *table, MSIOBJECT **phRec) { WCHAR *szwTable = NULL; - UINT r; + unsigned r; TRACE("%d %s %p\n", hdb, debugstr_a(table), phRec); diff --git a/libmsi/query.h b/libmsi/query.h index 16a7d1c..0df6c41 100644 --- a/libmsi/query.h +++ b/libmsi/query.h @@ -59,12 +59,12 @@ struct sql_str { const WCHAR *data; - INT len; + int len; }; struct complex_expr { - UINT op; + unsigned op; struct expr *left; struct expr *right; }; @@ -79,7 +79,7 @@ union ext_column } unparsed; struct { - UINT column; + unsigned column; struct tagJOINTABLE *table; } parsed; }; @@ -90,53 +90,53 @@ struct expr union { struct complex_expr expr; - INT ival; - UINT uval; + int ival; + unsigned uval; const WCHAR *sval; union ext_column column; } u; }; -UINT MSI_ParseSQL( MSIDATABASE *db, const WCHAR *command, MSIVIEW **phview, +unsigned MSI_ParseSQL( MSIDATABASE *db, const WCHAR *command, MSIVIEW **phview, struct list *mem ); -UINT TABLE_CreateView( MSIDATABASE *db, const WCHAR *name, MSIVIEW **view ); +unsigned TABLE_CreateView( MSIDATABASE *db, const WCHAR *name, MSIVIEW **view ); -UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, +unsigned SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, const column_info *columns ); -UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ); +unsigned DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ); -UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, +unsigned ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, column_info *columns ); -UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *tables, +unsigned WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *tables, struct expr *cond ); -UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, +unsigned CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, column_info *col_info, BOOL hold ); -UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, +unsigned INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *table, column_info *columns, column_info *values, BOOL temp ); -UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *table, +unsigned UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *table, column_info *list, struct expr *expr ); -UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ); +unsigned DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ); -UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name, column_info *colinfo, int hold ); +unsigned ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name, column_info *colinfo, int hold ); -UINT STREAMS_CreateView( MSIDATABASE *db, MSIVIEW **view ); +unsigned STREAMS_CreateView( MSIDATABASE *db, MSIVIEW **view ); -UINT STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view ); +unsigned STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view ); -UINT DROP_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name ); +unsigned DROP_CreateView( MSIDATABASE *db, MSIVIEW **view, const WCHAR *name ); int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip); -MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ); +MSIRECORD *msi_query_merge_record( unsigned fields, const column_info *vl, MSIRECORD *rec ); -UINT msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_info, +unsigned msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_info, MSICONDITION persistent ); #pragma GCC visibility pop diff --git a/libmsi/record.c b/libmsi/record.c index 9677ad2..c3f71a6 100644 --- a/libmsi/record.c +++ b/libmsi/record.c @@ -66,16 +66,16 @@ static void MSI_FreeField( MSIFIELD *field ) void MSI_CloseRecord( MSIOBJECT *arg ) { MSIRECORD *rec = (MSIRECORD *) arg; - UINT i; + unsigned i; for( i=0; i<=rec->count; i++ ) MSI_FreeField( &rec->fields[i] ); } -MSIRECORD *MSI_CreateRecord( UINT cParams ) +MSIRECORD *MSI_CreateRecord( unsigned cParams ) { MSIRECORD *rec; - UINT len; + unsigned len; TRACE("%d\n", cParams); @@ -89,7 +89,7 @@ MSIRECORD *MSI_CreateRecord( UINT cParams ) return rec; } -MSIOBJECT * MsiCreateRecord( UINT cParams ) +MSIOBJECT * MsiCreateRecord( unsigned cParams ) { MSIRECORD *rec; @@ -99,15 +99,15 @@ MSIOBJECT * MsiCreateRecord( UINT cParams ) return &rec->hdr; } -UINT MSI_RecordGetFieldCount( const MSIRECORD *rec ) +unsigned MSI_RecordGetFieldCount( const MSIRECORD *rec ) { return rec->count; } -UINT MsiRecordGetFieldCount( MSIOBJECT *handle ) +unsigned MsiRecordGetFieldCount( MSIOBJECT *handle ) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d\n", handle ); @@ -146,10 +146,10 @@ static BOOL string2intW( const WCHAR *str, int *out ) return TRUE; } -UINT MSI_RecordCopyField( MSIRECORD *in_rec, UINT in_n, - MSIRECORD *out_rec, UINT out_n ) +unsigned MSI_RecordCopyField( MSIRECORD *in_rec, unsigned in_n, + MSIRECORD *out_rec, unsigned out_n ) { - UINT r = ERROR_SUCCESS; + unsigned r = ERROR_SUCCESS; msiobj_lock( &in_rec->hdr ); @@ -196,14 +196,14 @@ UINT MSI_RecordCopyField( MSIRECORD *in_rec, UINT in_n, return r; } -INT_PTR MSI_RecordGetIntPtr( MSIRECORD *rec, UINT iField ) +intptr_t MSI_RecordGetIntPtr( MSIRECORD *rec, unsigned iField ) { int ret; TRACE( "%p %d\n", rec, iField ); if( iField > rec->count ) - return MININT_PTR; + return INTPTR_MIN; switch( rec->fields[iField].type ) { @@ -214,15 +214,15 @@ INT_PTR MSI_RecordGetIntPtr( MSIRECORD *rec, UINT iField ) case MSIFIELD_WSTR: if( string2intW( rec->fields[iField].u.szwVal, &ret ) ) return ret; - return MININT_PTR; + return INTPTR_MIN; default: break; } - return MININT_PTR; + return INTPTR_MIN; } -int MSI_RecordGetInteger( MSIRECORD *rec, UINT iField) +int MSI_RecordGetInteger( MSIRECORD *rec, unsigned iField) { int ret = 0; @@ -248,10 +248,10 @@ int MSI_RecordGetInteger( MSIRECORD *rec, UINT iField) return MSI_NULL_INTEGER; } -int MsiRecordGetInteger( MSIOBJECT *handle, UINT iField) +int MsiRecordGetInteger( MSIOBJECT *handle, unsigned iField) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d\n", handle, iField ); @@ -267,10 +267,10 @@ int MsiRecordGetInteger( MSIOBJECT *handle, UINT iField) return ret; } -UINT MsiRecordClearData( MSIOBJECT *handle ) +unsigned MsiRecordClearData( MSIOBJECT *handle ) { MSIRECORD *rec; - UINT i; + unsigned i; TRACE("%d\n", handle ); @@ -291,7 +291,7 @@ UINT MsiRecordClearData( MSIOBJECT *handle ) return ERROR_SUCCESS; } -UINT MSI_RecordSetIntPtr( MSIRECORD *rec, UINT iField, INT_PTR pVal ) +unsigned MSI_RecordSetIntPtr( MSIRECORD *rec, unsigned iField, intptr_t pVal ) { TRACE("%p %u %ld\n", rec, iField, pVal); @@ -305,7 +305,7 @@ UINT MSI_RecordSetIntPtr( MSIRECORD *rec, UINT iField, INT_PTR pVal ) return ERROR_SUCCESS; } -UINT MSI_RecordSetInteger( MSIRECORD *rec, UINT iField, int iVal ) +unsigned MSI_RecordSetInteger( MSIRECORD *rec, unsigned iField, int iVal ) { TRACE("%p %u %d\n", rec, iField, iVal); @@ -319,10 +319,10 @@ UINT MSI_RecordSetInteger( MSIRECORD *rec, UINT iField, int iVal ) return ERROR_SUCCESS; } -UINT MsiRecordSetInteger( MSIOBJECT *handle, UINT iField, int iVal ) +unsigned MsiRecordSetInteger( MSIOBJECT *handle, unsigned iField, int iVal ) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %u %d\n", handle, iField, iVal); @@ -337,7 +337,7 @@ UINT MsiRecordSetInteger( MSIOBJECT *handle, UINT iField, int iVal ) return ret; } -BOOL MSI_RecordIsNull( MSIRECORD *rec, UINT iField ) +BOOL MSI_RecordIsNull( MSIRECORD *rec, unsigned iField ) { BOOL r = TRUE; @@ -349,10 +349,10 @@ BOOL MSI_RecordIsNull( MSIRECORD *rec, UINT iField ) return r; } -BOOL MsiRecordIsNull( MSIOBJECT *handle, UINT iField ) +BOOL MsiRecordIsNull( MSIOBJECT *handle, unsigned iField ) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d\n", handle, iField ); @@ -367,10 +367,10 @@ BOOL MsiRecordIsNull( MSIOBJECT *handle, UINT iField ) } -UINT MSI_RecordGetStringA(MSIRECORD *rec, UINT iField, - CHAR *szValue, DWORD *pcchValue) +unsigned MSI_RecordGetStringA(MSIRECORD *rec, unsigned iField, + CHAR *szValue, unsigned *pcchValue) { - UINT len=0, ret; + unsigned len=0, ret; CHAR buffer[16]; TRACE("%p %d %p %p\n", rec, iField, szValue, pcchValue); @@ -420,11 +420,11 @@ UINT MSI_RecordGetStringA(MSIRECORD *rec, UINT iField, return ret; } -UINT MsiRecordGetStringA(MSIOBJECT *handle, UINT iField, - CHAR *szValue, DWORD *pcchValue) +unsigned MsiRecordGetStringA(MSIOBJECT *handle, unsigned iField, + CHAR *szValue, unsigned *pcchValue) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %p %p\n", handle, iField, szValue, pcchValue); @@ -438,7 +438,7 @@ UINT MsiRecordGetStringA(MSIOBJECT *handle, UINT iField, return ret; } -const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, UINT iField ) +const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, unsigned iField ) { if( iField > rec->count ) return NULL; @@ -449,10 +449,10 @@ const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, UINT iField ) return rec->fields[iField].u.szwVal; } -UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, - WCHAR *szValue, DWORD *pcchValue) +unsigned MSI_RecordGetStringW(MSIRECORD *rec, unsigned iField, + WCHAR *szValue, unsigned *pcchValue) { - UINT len=0, ret; + unsigned len=0, ret; WCHAR buffer[16]; static const WCHAR szFormat[] = { '%','d',0 }; @@ -496,11 +496,11 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, return ret; } -UINT MsiRecordGetStringW(MSIOBJECT *handle, UINT iField, - WCHAR *szValue, DWORD *pcchValue) +unsigned MsiRecordGetStringW(MSIOBJECT *handle, unsigned iField, + WCHAR *szValue, unsigned *pcchValue) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %p %p\n", handle, iField, szValue, pcchValue); @@ -515,7 +515,7 @@ UINT MsiRecordGetStringW(MSIOBJECT *handle, UINT iField, return ret; } -static UINT msi_get_stream_size( IStream *stm ) +static unsigned msi_get_stream_size( IStream *stm ) { STATSTG stat; HRESULT r; @@ -526,7 +526,7 @@ static UINT msi_get_stream_size( IStream *stm ) return stat.cbSize.QuadPart; } -static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField) +static unsigned MSI_RecordDataSize(MSIRECORD *rec, unsigned iField) { TRACE("%p %d\n", rec, iField); @@ -536,7 +536,7 @@ static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField) switch( rec->fields[iField].type ) { case MSIFIELD_INT: - return sizeof (INT); + return sizeof (int); case MSIFIELD_WSTR: return lstrlenW( rec->fields[iField].u.szwVal ); case MSIFIELD_NULL: @@ -547,10 +547,10 @@ static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField) return 0; } -UINT MsiRecordDataSize(MSIOBJECT *handle, UINT iField) +unsigned MsiRecordDataSize(MSIOBJECT *handle, unsigned iField) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d\n", handle, iField); @@ -564,7 +564,7 @@ UINT MsiRecordDataSize(MSIOBJECT *handle, UINT iField) return ret; } -static UINT MSI_RecordSetStringA( MSIRECORD *rec, UINT iField, const CHAR *szValue ) +static unsigned MSI_RecordSetStringA( MSIRECORD *rec, unsigned iField, const CHAR *szValue ) { WCHAR *str; @@ -589,10 +589,10 @@ static UINT MSI_RecordSetStringA( MSIRECORD *rec, UINT iField, const CHAR *szVal return 0; } -UINT MsiRecordSetStringA( MSIOBJECT *handle, UINT iField, const CHAR *szValue ) +unsigned MsiRecordSetStringA( MSIOBJECT *handle, unsigned iField, const CHAR *szValue ) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %s\n", handle, iField, debugstr_a(szValue)); @@ -606,7 +606,7 @@ UINT MsiRecordSetStringA( MSIOBJECT *handle, UINT iField, const CHAR *szValue ) return ret; } -UINT MSI_RecordSetStringW( MSIRECORD *rec, UINT iField, const WCHAR *szValue ) +unsigned MSI_RecordSetStringW( MSIRECORD *rec, unsigned iField, const WCHAR *szValue ) { WCHAR *str; @@ -632,10 +632,10 @@ UINT MSI_RecordSetStringW( MSIRECORD *rec, UINT iField, const WCHAR *szValue ) return 0; } -UINT MsiRecordSetStringW( MSIOBJECT *handle, UINT iField, const WCHAR *szValue ) +unsigned MsiRecordSetStringW( MSIOBJECT *handle, unsigned iField, const WCHAR *szValue ) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %s\n", handle, iField, debugstr_w(szValue)); @@ -651,9 +651,9 @@ UINT MsiRecordSetStringW( MSIOBJECT *handle, UINT iField, const WCHAR *szValue ) } /* read the data in a file into an IStream */ -static UINT RECORD_StreamFromFile(const WCHAR *szFile, IStream **pstm) +static unsigned RECORD_StreamFromFile(const WCHAR *szFile, IStream **pstm) { - DWORD sz, szHighWord = 0, read; + unsigned sz, szHighWord = 0, read; HANDLE handle; HGLOBAL hGlob = 0; HRESULT hr; @@ -700,7 +700,7 @@ static UINT RECORD_StreamFromFile(const WCHAR *szFile, IStream **pstm) return ERROR_SUCCESS; } -UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream) +unsigned MSI_RecordSetStream(MSIRECORD *rec, unsigned iField, IStream *stream) { if ( (iField == 0) || (iField > rec->count) ) return ERROR_INVALID_PARAMETER; @@ -712,7 +712,7 @@ UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream) return ERROR_SUCCESS; } -UINT MSI_RecordSetStreamFromFileW(MSIRECORD *rec, UINT iField, const WCHAR *szFilename) +unsigned MSI_RecordSetStreamFromFileW(MSIRECORD *rec, unsigned iField, const WCHAR *szFilename) { IStream *stm = NULL; HRESULT r; @@ -752,10 +752,10 @@ UINT MSI_RecordSetStreamFromFileW(MSIRECORD *rec, UINT iField, const WCHAR *szFi return ERROR_SUCCESS; } -UINT MsiRecordSetStreamA(MSIOBJECT *hRecord, UINT iField, const CHAR *szFilename) +unsigned MsiRecordSetStreamA(MSIOBJECT *hRecord, unsigned iField, const CHAR *szFilename) { WCHAR *wstr = NULL; - UINT ret; + unsigned ret; TRACE("%d %d %s\n", hRecord, iField, debugstr_a(szFilename)); @@ -771,10 +771,10 @@ UINT MsiRecordSetStreamA(MSIOBJECT *hRecord, UINT iField, const CHAR *szFilename return ret; } -UINT MsiRecordSetStreamW(MSIOBJECT *handle, UINT iField, const WCHAR *szFilename) +unsigned MsiRecordSetStreamW(MSIOBJECT *handle, unsigned iField, const WCHAR *szFilename) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %s\n", handle, iField, debugstr_w(szFilename)); @@ -789,9 +789,9 @@ UINT MsiRecordSetStreamW(MSIOBJECT *handle, UINT iField, const WCHAR *szFilename return ret; } -UINT MSI_RecordReadStream(MSIRECORD *rec, UINT iField, char *buf, DWORD *sz) +unsigned MSI_RecordReadStream(MSIRECORD *rec, unsigned iField, char *buf, unsigned *sz) { - ULONG count; + unsigned count; HRESULT r; IStream *stm; @@ -847,10 +847,10 @@ UINT MSI_RecordReadStream(MSIRECORD *rec, UINT iField, char *buf, DWORD *sz) return ERROR_SUCCESS; } -UINT MsiRecordReadStream(MSIOBJECT *handle, UINT iField, char *buf, DWORD *sz) +unsigned MsiRecordReadStream(MSIOBJECT *handle, unsigned iField, char *buf, unsigned *sz) { MSIRECORD *rec; - UINT ret; + unsigned ret; TRACE("%d %d %p %p\n", handle, iField, buf, sz); @@ -864,7 +864,7 @@ UINT MsiRecordReadStream(MSIOBJECT *handle, UINT iField, char *buf, DWORD *sz) return ret; } -UINT MSI_RecordSetIStream( MSIRECORD *rec, UINT iField, IStream *stm ) +unsigned MSI_RecordSetIStream( MSIRECORD *rec, unsigned iField, IStream *stm ) { TRACE("%p %d %p\n", rec, iField, stm); @@ -880,7 +880,7 @@ UINT MSI_RecordSetIStream( MSIRECORD *rec, UINT iField, IStream *stm ) return ERROR_SUCCESS; } -UINT MSI_RecordGetIStream( MSIRECORD *rec, UINT iField, IStream **pstm) +unsigned MSI_RecordGetIStream( MSIRECORD *rec, unsigned iField, IStream **pstm) { TRACE("%p %d %p\n", rec, iField, pstm); @@ -896,12 +896,12 @@ UINT MSI_RecordGetIStream( MSIRECORD *rec, UINT iField, IStream **pstm) return ERROR_SUCCESS; } -static UINT msi_dump_stream_to_file( IStream *stm, const WCHAR *name ) +static unsigned msi_dump_stream_to_file( IStream *stm, const WCHAR *name ) { ULARGE_INTEGER size; LARGE_INTEGER pos; IStream *out; - DWORD stgm; + unsigned stgm; HRESULT r; stgm = STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_FAILIFTHERE; @@ -928,10 +928,10 @@ end: return ERROR_SUCCESS; } -UINT MSI_RecordStreamToFile( MSIRECORD *rec, UINT iField, const WCHAR *name ) +unsigned MSI_RecordStreamToFile( MSIRECORD *rec, unsigned iField, const WCHAR *name ) { IStream *stm = NULL; - UINT r; + unsigned r; TRACE("%p %u %s\n", rec, iField, debugstr_w(name)); @@ -952,7 +952,7 @@ UINT MSI_RecordStreamToFile( MSIRECORD *rec, UINT iField, const WCHAR *name ) MSIRECORD *MSI_CloneRecord(MSIRECORD *rec) { MSIRECORD *clone; - UINT r, i, count; + unsigned r, i, count; count = MSI_RecordGetFieldCount(rec); clone = MSI_CreateRecord(count); @@ -985,7 +985,7 @@ MSIRECORD *MSI_CloneRecord(MSIRECORD *rec) return clone; } -BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) +BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, unsigned field) { if (a->fields[field].type != b->fields[field].type) return FALSE; @@ -1015,7 +1015,7 @@ BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) BOOL MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) { - UINT i; + unsigned i; if (a->count != b->count) return FALSE; @@ -1029,11 +1029,11 @@ BOOL MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) return TRUE; } -WCHAR *msi_dup_record_field( MSIRECORD *rec, INT field ) +WCHAR *msi_dup_record_field( MSIRECORD *rec, int field ) { - DWORD sz = 0; + unsigned sz = 0; WCHAR *str; - UINT r; + unsigned r; if (MSI_RecordIsNull( rec, field )) return NULL; diff --git a/libmsi/select.c b/libmsi/select.c index e01dbc1..794172f 100644 --- a/libmsi/select.c +++ b/libmsi/select.c @@ -41,12 +41,12 @@ typedef struct tagMSISELECTVIEW MSIVIEW view; MSIDATABASE *db; MSIVIEW *table; - UINT num_cols; - UINT max_cols; - UINT cols[1]; + unsigned num_cols; + unsigned max_cols; + unsigned cols[1]; } MSISELECTVIEW; -static UINT SELECT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned SELECT_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -67,7 +67,7 @@ static UINT SELECT_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return sv->table->ops->fetch_int( sv->table, row, col, val ); } -static UINT SELECT_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm) +static unsigned SELECT_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, IStream **stm) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -88,7 +88,7 @@ static UINT SELECT_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **st return sv->table->ops->fetch_stream( sv->table, row, col, stm ); } -static UINT SELECT_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned SELECT_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSISELECTVIEW *sv = (MSISELECTVIEW *)view; @@ -100,10 +100,10 @@ static UINT SELECT_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) return msi_view_get_row(sv->db, view, row, rec); } -static UINT SELECT_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) +static unsigned SELECT_set_row( MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - UINT i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0; + unsigned i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0; MSIRECORD *expanded; TRACE("%p %d %p %08x\n", sv, row, rec, mask ); @@ -142,10 +142,10 @@ static UINT SELECT_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) return r; } -static UINT SELECT_insert_row( MSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary ) +static unsigned SELECT_insert_row( MSIVIEW *view, MSIRECORD *record, unsigned row, BOOL temporary ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - UINT i, table_cols, r; + unsigned i, table_cols, r; MSIRECORD *outrec; TRACE("%p %p\n", sv, record ); @@ -175,7 +175,7 @@ fail: return r; } -static UINT SELECT_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned SELECT_execute( MSIVIEW *view, MSIRECORD *record ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -187,7 +187,7 @@ static UINT SELECT_execute( MSIVIEW *view, MSIRECORD *record ) return sv->table->ops->execute( sv->table, record ); } -static UINT SELECT_close( MSIVIEW *view ) +static unsigned SELECT_close( MSIVIEW *view ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -199,7 +199,7 @@ static UINT SELECT_close( MSIVIEW *view ) return sv->table->ops->close( sv->table ); } -static UINT SELECT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned SELECT_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -214,8 +214,8 @@ static UINT SELECT_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return sv->table->ops->get_dimensions( sv->table, rows, NULL ); } -static UINT SELECT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned SELECT_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -240,10 +240,10 @@ static UINT SELECT_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, type, temporary, table_name ); } -static UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) +static unsigned msi_select_update(MSIVIEW *view, MSIRECORD *rec, unsigned row) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - UINT r, i, num_columns, col, type, val; + unsigned r, i, num_columns, col, type, val; const WCHAR *str; MSIRECORD *mod; @@ -297,8 +297,8 @@ done: return r; } -static UINT SELECT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned SELECT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -313,7 +313,7 @@ static UINT SELECT_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return sv->table->ops->modify( sv->table, eModifyMode, rec, row ); } -static UINT SELECT_delete( MSIVIEW *view ) +static unsigned SELECT_delete( MSIVIEW *view ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -328,8 +328,8 @@ static UINT SELECT_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT SELECT_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned SELECT_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -370,10 +370,10 @@ static const MSIVIEWOPS select_ops = NULL, }; -static UINT SELECT_AddColumn( MSISELECTVIEW *sv, const WCHAR *name, +static unsigned SELECT_AddColumn( MSISELECTVIEW *sv, const WCHAR *name, const WCHAR *table_name ) { - UINT r, n; + unsigned r, n; MSIVIEW *table; TRACE("%p adding %s.%s\n", sv, debugstr_w( table_name ), @@ -418,17 +418,17 @@ static int select_count_columns( const column_info *col ) return n; } -UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, +unsigned SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, const column_info *columns ) { MSISELECTVIEW *sv = NULL; - UINT count = 0, r = ERROR_SUCCESS; + unsigned count = 0, r = ERROR_SUCCESS; TRACE("%p\n", sv ); count = select_count_columns( columns ); - sv = msi_alloc_zero( sizeof *sv + count*sizeof (UINT) ); + sv = msi_alloc_zero( sizeof *sv + count*sizeof (unsigned) ); if( !sv ) return ERROR_FUNCTION_FAILED; diff --git a/libmsi/sql-parser.y b/libmsi/sql-parser.y index 221b9c1..888c5b6 100644 --- a/libmsi/sql-parser.y +++ b/libmsi/sql-parser.y @@ -44,8 +44,8 @@ typedef struct tag_SQL_input { MSIDATABASE *db; const WCHAR *command; - DWORD n, len; - UINT r; + unsigned n, len; + unsigned r; MSIVIEW **view; /* View structure for the resulting query. This value * tracks the view currently being created so we can free * this view on syntax error. @@ -53,7 +53,7 @@ typedef struct tag_SQL_input struct list *mem; } SQL_input; -static UINT SQL_getstring( void *info, const struct sql_str *strdata, WCHAR **str ); +static unsigned SQL_getstring( void *info, const struct sql_str *strdata, WCHAR **str ); static INT SQL_getint( void *info ); static int sql_lex( void *SQL_lval, SQL_input *info ); @@ -63,8 +63,8 @@ static column_info *parser_alloc_column( void *info, const WCHAR *table, const W static BOOL SQL_MarkPrimaryKeys( column_info **cols, column_info *keys); -static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ); -static struct expr * EXPR_unary( void *info, struct expr *l, UINT op ); +static struct expr * EXPR_complex( void *info, struct expr *l, unsigned op, struct expr *r ); +static struct expr * EXPR_unary( void *info, struct expr *l, unsigned op ); static struct expr * EXPR_column( void *info, const column_info *column ); static struct expr * EXPR_ival( void *info, int val ); static struct expr * EXPR_sval( void *info, const struct sql_str *str ); @@ -86,7 +86,7 @@ static struct expr * EXPR_wildcard( void *info ); column_info *column_list; MSIVIEW *query; struct expr *expr; - USHORT column_type; + uint16_t column_type; int integer; } @@ -176,7 +176,7 @@ onecreate: { SQL_input* sql = (SQL_input*) info; MSIVIEW *create = NULL; - UINT r; + unsigned r; if( !$5 ) YYABORT; @@ -295,7 +295,7 @@ onedrop: { SQL_input* sql = (SQL_input*) info; MSIVIEW* drop = NULL; - UINT r; + unsigned r; r = DROP_CreateView( sql->db, &drop, $3 ); if( r != ERROR_SUCCESS || !$$ ) @@ -416,7 +416,7 @@ oneselect: { SQL_input* sql = (SQL_input*) info; MSIVIEW* distinct = NULL; - UINT r; + unsigned r; r = DISTINCT_CreateView( sql->db, &distinct, $3 ); if (r != ERROR_SUCCESS) @@ -431,7 +431,7 @@ selectfrom: { SQL_input* sql = (SQL_input*) info; MSIVIEW* select = NULL; - UINT r; + unsigned r; if( $1 ) { @@ -475,7 +475,7 @@ from: { SQL_input* sql = (SQL_input*) info; MSIVIEW* table = NULL; - UINT r; + unsigned r; r = TABLE_CreateView( sql->db, $2, &table ); if( r != ERROR_SUCCESS || !$$ ) @@ -485,7 +485,7 @@ from: } | unorderdfrom TK_ORDER TK_BY collist { - UINT r; + unsigned r; if( $4 ) { @@ -504,7 +504,7 @@ unorderdfrom: { SQL_input* sql = (SQL_input*) info; MSIVIEW* where = NULL; - UINT r; + unsigned r; r = WHERE_CreateView( sql->db, &where, $2, NULL ); if( r != ERROR_SUCCESS ) @@ -516,7 +516,7 @@ unorderdfrom: { SQL_input* sql = (SQL_input*) info; MSIVIEW* where = NULL; - UINT r; + unsigned r; r = WHERE_CreateView( sql->db, &where, $2, $4 ); if( r != ERROR_SUCCESS ) @@ -755,7 +755,7 @@ number: static WCHAR *parser_add_table( void *info, const WCHAR *list, const WCHAR *table ) { static const WCHAR space[] = {' ',0}; - DWORD len = strlenW( list ) + strlenW( table ) + 2; + unsigned len = strlenW( list ) + strlenW( table ) + 2; WCHAR *ret; ret = parser_alloc( info, len * sizeof(WCHAR) ); @@ -821,10 +821,10 @@ static int sql_lex( void *SQL_lval, SQL_input *sql ) return token; } -UINT SQL_getstring( void *info, const struct sql_str *strdata, WCHAR **str ) +unsigned SQL_getstring( void *info, const struct sql_str *strdata, WCHAR **str ) { const WCHAR *p = strdata->data; - UINT len = strdata->len; + unsigned len = strdata->len; /* match quotes */ if( ( (p[0]=='`') && (p[len-1]!='`') ) || @@ -881,7 +881,7 @@ static struct expr * EXPR_wildcard( void *info ) return e; } -static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ) +static struct expr * EXPR_complex( void *info, struct expr *l, unsigned op, struct expr *r ) { struct expr *e = parser_alloc( info, sizeof *e ); if( e ) @@ -894,7 +894,7 @@ static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct e return e; } -static struct expr * EXPR_unary( void *info, struct expr *l, UINT op ) +static struct expr * EXPR_unary( void *info, struct expr *l, unsigned op ) { struct expr *e = parser_alloc( info, sizeof *e ); if( e ) @@ -998,7 +998,7 @@ static BOOL SQL_MarkPrimaryKeys( column_info **cols, return found; } -UINT MSI_ParseSQL( MSIDATABASE *db, const WCHAR *command, MSIVIEW **phview, +unsigned MSI_ParseSQL( MSIDATABASE *db, const WCHAR *command, MSIVIEW **phview, struct list *mem ) { SQL_input sql; diff --git a/libmsi/storages.c b/libmsi/storages.c index a0a548c..dae1a52 100644 --- a/libmsi/storages.c +++ b/libmsi/storages.c @@ -39,7 +39,7 @@ typedef struct tabSTORAGE { - UINT str_index; + unsigned str_index; IStorage *storage; } STORAGE; @@ -48,12 +48,12 @@ typedef struct tagMSISTORAGESVIEW MSIVIEW view; MSIDATABASE *db; STORAGE **storages; - UINT max_storages; - UINT num_rows; - UINT row_size; + unsigned max_storages; + unsigned num_rows; + unsigned row_size; } MSISTORAGESVIEW; -static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size) +static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, unsigned size) { if (size >= sv->max_storages) { @@ -83,7 +83,7 @@ static STORAGE *create_storage(MSISTORAGESVIEW *sv, const WCHAR *name, IStorage return storage; } -static UINT STORAGES_fetch_int(MSIVIEW *view, UINT row, UINT col, UINT *val) +static unsigned STORAGES_fetch_int(MSIVIEW *view, unsigned row, unsigned col, unsigned *val) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -100,7 +100,7 @@ static UINT STORAGES_fetch_int(MSIVIEW *view, UINT row, UINT col, UINT *val) return ERROR_SUCCESS; } -static UINT STORAGES_fetch_stream(MSIVIEW *view, UINT row, UINT col, IStream **stm) +static unsigned STORAGES_fetch_stream(MSIVIEW *view, unsigned row, unsigned col, IStream **stm) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -112,7 +112,7 @@ static UINT STORAGES_fetch_stream(MSIVIEW *view, UINT row, UINT col, IStream **s return ERROR_INVALID_DATA; } -static UINT STORAGES_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned STORAGES_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -127,7 +127,7 @@ static HRESULT stream_to_storage(IStream *stm, IStorage **stg) STATSTG stat; void *data; HRESULT hr; - DWORD size, read; + unsigned size, read; ULARGE_INTEGER offset; hr = IStream_Stat(stm, &stat, STATFLAG_NONAME); @@ -170,14 +170,14 @@ done: return hr; } -static UINT STORAGES_set_row(MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) +static unsigned STORAGES_set_row(MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; IStorage *stg, *substg = NULL; IStream *stm; WCHAR *name = NULL; HRESULT hr; - UINT r = ERROR_FUNCTION_FAILED; + unsigned r = ERROR_FUNCTION_FAILED; TRACE("(%p, %p)\n", view, rec); @@ -232,7 +232,7 @@ done: return r; } -static UINT STORAGES_insert_row(MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) +static unsigned STORAGES_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -247,25 +247,25 @@ static UINT STORAGES_insert_row(MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL te return STORAGES_set_row(view, row, rec, 0); } -static UINT STORAGES_delete_row(MSIVIEW *view, UINT row) +static unsigned STORAGES_delete_row(MSIVIEW *view, unsigned row) { FIXME("(%p %d): stub!\n", view, row); return ERROR_SUCCESS; } -static UINT STORAGES_execute(MSIVIEW *view, MSIRECORD *record) +static unsigned STORAGES_execute(MSIVIEW *view, MSIRECORD *record) { TRACE("(%p, %p)\n", view, record); return ERROR_SUCCESS; } -static UINT STORAGES_close(MSIVIEW *view) +static unsigned STORAGES_close(MSIVIEW *view) { TRACE("(%p)\n", view); return ERROR_SUCCESS; } -static UINT STORAGES_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) +static unsigned STORAGES_get_dimensions(MSIVIEW *view, unsigned *rows, unsigned *cols) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; @@ -277,8 +277,8 @@ static UINT STORAGES_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) return ERROR_SUCCESS; } -static UINT STORAGES_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned STORAGES_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); @@ -303,10 +303,10 @@ static UINT STORAGES_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return ERROR_SUCCESS; } -static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row) +static unsigned storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, unsigned *row) { const WCHAR *str; - UINT r, i, id, data; + unsigned r, i, id, data; str = MSI_RecordGetString(rec, 1); r = msi_string2idW(sv->db->strings, str, &id); @@ -327,10 +327,10 @@ static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row) return ERROR_FUNCTION_FAILED; } -static UINT storages_modify_update(MSIVIEW *view, MSIRECORD *rec) +static unsigned storages_modify_update(MSIVIEW *view, MSIRECORD *rec) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - UINT r, row; + unsigned r, row; r = storages_find_row(sv, rec, &row); if (r != ERROR_SUCCESS) @@ -339,10 +339,10 @@ static UINT storages_modify_update(MSIVIEW *view, MSIRECORD *rec) return STORAGES_set_row(view, row, rec, 0); } -static UINT storages_modify_assign(MSIVIEW *view, MSIRECORD *rec) +static unsigned storages_modify_assign(MSIVIEW *view, MSIRECORD *rec) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - UINT r, row; + unsigned r, row; r = storages_find_row(sv, rec, &row); if (r == ERROR_SUCCESS) @@ -351,9 +351,9 @@ static UINT storages_modify_assign(MSIVIEW *view, MSIRECORD *rec) return STORAGES_insert_row(view, rec, -1, FALSE); } -static UINT STORAGES_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) +static unsigned STORAGES_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, unsigned row) { - UINT r; + unsigned r; TRACE("%p %d %p\n", view, eModifyMode, rec); @@ -391,10 +391,10 @@ static UINT STORAGES_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec return r; } -static UINT STORAGES_delete(MSIVIEW *view) +static unsigned STORAGES_delete(MSIVIEW *view) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - UINT i; + unsigned i; TRACE("(%p)\n", view); @@ -412,11 +412,11 @@ static UINT STORAGES_delete(MSIVIEW *view) return ERROR_SUCCESS; } -static UINT STORAGES_find_matching_rows(MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle) +static unsigned STORAGES_find_matching_rows(MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle) { MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view; - UINT index = PtrToUlong(*handle); + unsigned index = PtrToUlong(*handle); TRACE("(%d, %d): %d\n", *row, col, val); @@ -464,13 +464,13 @@ static const MSIVIEWOPS storages_ops = NULL, }; -static INT add_storages_to_table(MSISTORAGESVIEW *sv) +static int add_storages_to_table(MSISTORAGESVIEW *sv) { STORAGE *storage = NULL; IEnumSTATSTG *stgenum = NULL; STATSTG stat; HRESULT hr; - UINT count = 0, size; + unsigned count = 0, size; hr = IStorage_EnumElements(sv->db->storage, 0, NULL, 0, &stgenum); if (FAILED(hr)) @@ -522,10 +522,10 @@ static INT add_storages_to_table(MSISTORAGESVIEW *sv) return count; } -UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view) +unsigned STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view) { MSISTORAGESVIEW *sv; - INT rows; + int rows; TRACE("(%p, %p)\n", db, view); diff --git a/libmsi/streams.c b/libmsi/streams.c index 6657693..9d2721b 100644 --- a/libmsi/streams.c +++ b/libmsi/streams.c @@ -38,7 +38,7 @@ typedef struct tabSTREAM { - UINT str_index; + unsigned str_index; IStream *stream; } STREAM; @@ -47,12 +47,12 @@ typedef struct tagMSISTREAMSVIEW MSIVIEW view; MSIDATABASE *db; STREAM **streams; - UINT max_streams; - UINT num_rows; - UINT row_size; + unsigned max_streams; + unsigned num_rows; + unsigned row_size; } MSISTREAMSVIEW; -static BOOL streams_set_table_size(MSISTREAMSVIEW *sv, UINT size) +static BOOL streams_set_table_size(MSISTREAMSVIEW *sv, unsigned size) { if (size >= sv->max_streams) { @@ -86,7 +86,7 @@ static STREAM *create_stream(MSISTREAMSVIEW *sv, const WCHAR *name, BOOL encoded return stream; } -static UINT STREAMS_fetch_int(MSIVIEW *view, UINT row, UINT col, UINT *val) +static unsigned STREAMS_fetch_int(MSIVIEW *view, unsigned row, unsigned col, unsigned *val) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -103,7 +103,7 @@ static UINT STREAMS_fetch_int(MSIVIEW *view, UINT row, UINT col, UINT *val) return ERROR_SUCCESS; } -static UINT STREAMS_fetch_stream(MSIVIEW *view, UINT row, UINT col, IStream **stm) +static unsigned STREAMS_fetch_stream(MSIVIEW *view, unsigned row, unsigned col, IStream **stm) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -118,7 +118,7 @@ static UINT STREAMS_fetch_stream(MSIVIEW *view, UINT row, UINT col, IStream **st return ERROR_SUCCESS; } -static UINT STREAMS_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned STREAMS_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -127,7 +127,7 @@ static UINT STREAMS_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) return msi_view_get_row( sv->db, view, row, rec ); } -static UINT STREAMS_set_row(MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) +static unsigned STREAMS_set_row(MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; STREAM *stream; @@ -135,10 +135,10 @@ static UINT STREAMS_set_row(MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) STATSTG stat; WCHAR *encname = NULL; WCHAR *name = NULL; - USHORT *data = NULL; + uint16_t *data = NULL; HRESULT hr; - ULONG count; - UINT r = ERROR_FUNCTION_FAILED; + unsigned count; + unsigned r = ERROR_FUNCTION_FAILED; TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask); @@ -214,10 +214,10 @@ done: return r; } -static UINT STREAMS_insert_row(MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) +static unsigned STREAMS_insert_row(MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT i; + unsigned i; TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary); @@ -236,25 +236,25 @@ static UINT STREAMS_insert_row(MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL tem return STREAMS_set_row(view, row, rec, 0); } -static UINT STREAMS_delete_row(MSIVIEW *view, UINT row) +static unsigned STREAMS_delete_row(MSIVIEW *view, unsigned row) { FIXME("(%p %d): stub!\n", view, row); return ERROR_SUCCESS; } -static UINT STREAMS_execute(MSIVIEW *view, MSIRECORD *record) +static unsigned STREAMS_execute(MSIVIEW *view, MSIRECORD *record) { TRACE("(%p, %p)\n", view, record); return ERROR_SUCCESS; } -static UINT STREAMS_close(MSIVIEW *view) +static unsigned STREAMS_close(MSIVIEW *view) { TRACE("(%p)\n", view); return ERROR_SUCCESS; } -static UINT STREAMS_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) +static unsigned STREAMS_get_dimensions(MSIVIEW *view, unsigned *rows, unsigned *cols) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -266,8 +266,8 @@ static UINT STREAMS_get_dimensions(MSIVIEW *view, UINT *rows, UINT *cols) return ERROR_SUCCESS; } -static UINT STREAMS_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned STREAMS_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); @@ -292,10 +292,10 @@ static UINT STREAMS_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return ERROR_SUCCESS; } -static UINT streams_find_row(MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row) +static unsigned streams_find_row(MSISTREAMSVIEW *sv, MSIRECORD *rec, unsigned *row) { const WCHAR *str; - UINT r, i, id, data; + unsigned r, i, id, data; str = MSI_RecordGetString(rec, 1); r = msi_string2idW(sv->db->strings, str, &id); @@ -316,10 +316,10 @@ static UINT streams_find_row(MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row) return ERROR_FUNCTION_FAILED; } -static UINT streams_modify_update(MSIVIEW *view, MSIRECORD *rec) +static unsigned streams_modify_update(MSIVIEW *view, MSIRECORD *rec) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT r, row; + unsigned r, row; r = streams_find_row(sv, rec, &row); if (r != ERROR_SUCCESS) @@ -328,10 +328,10 @@ static UINT streams_modify_update(MSIVIEW *view, MSIRECORD *rec) return STREAMS_set_row(view, row, rec, 0); } -static UINT streams_modify_assign(MSIVIEW *view, MSIRECORD *rec) +static unsigned streams_modify_assign(MSIVIEW *view, MSIRECORD *rec) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT r, row; + unsigned r, row; r = streams_find_row(sv, rec, &row); if (r == ERROR_SUCCESS) @@ -340,9 +340,9 @@ static UINT streams_modify_assign(MSIVIEW *view, MSIRECORD *rec) return STREAMS_insert_row(view, rec, -1, FALSE); } -static UINT STREAMS_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row) +static unsigned STREAMS_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, unsigned row) { - UINT r; + unsigned r; TRACE("%p %d %p\n", view, eModifyMode, rec); @@ -380,10 +380,10 @@ static UINT STREAMS_modify(MSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, return r; } -static UINT STREAMS_delete(MSIVIEW *view) +static unsigned STREAMS_delete(MSIVIEW *view) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT i; + unsigned i; TRACE("(%p)\n", view); @@ -403,11 +403,11 @@ static UINT STREAMS_delete(MSIVIEW *view) return ERROR_SUCCESS; } -static UINT STREAMS_find_matching_rows(MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle) +static unsigned STREAMS_find_matching_rows(MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT index = PtrToUlong(*handle); + unsigned index = PtrToUlong(*handle); TRACE("(%p, %d, %d, %p, %p)\n", view, col, val, row, handle); @@ -456,13 +456,13 @@ static const MSIVIEWOPS streams_ops = NULL, }; -static INT add_streams_to_table(MSISTREAMSVIEW *sv) +static int add_streams_to_table(MSISTREAMSVIEW *sv) { IEnumSTATSTG *stgenum = NULL; STATSTG stat; STREAM *stream = NULL; HRESULT hr; - UINT r, count = 0, size; + unsigned r, count = 0, size; WCHAR *encname; hr = IStorage_EnumElements(sv->db->storage, 0, NULL, 0, &stgenum); @@ -535,10 +535,10 @@ static INT add_streams_to_table(MSISTREAMSVIEW *sv) return count; } -UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) +unsigned STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) { MSISTREAMSVIEW *sv; - INT rows; + int rows; TRACE("(%p, %p)\n", db, view); diff --git a/libmsi/string.c b/libmsi/string.c index 5a32575..26ce375 100644 --- a/libmsi/string.c +++ b/libmsi/string.c @@ -41,22 +41,22 @@ struct msistring { - USHORT persistent_refcount; - USHORT nonpersistent_refcount; + uint16_t persistent_refcount; + uint16_t nonpersistent_refcount; WCHAR *str; }; struct string_table { - UINT maxcount; /* the number of strings */ - UINT freeslot; - UINT codepage; - UINT sortcount; + unsigned maxcount; /* the number of strings */ + unsigned freeslot; + unsigned codepage; + unsigned sortcount; struct msistring *strings; /* an array of strings */ - UINT *sorted; /* index */ + unsigned *sorted; /* index */ }; -static BOOL validate_codepage( UINT codepage ) +static BOOL validate_codepage( unsigned codepage ) { if (codepage != CP_ACP && !IsValidCodePage( codepage )) { @@ -66,7 +66,7 @@ static BOOL validate_codepage( UINT codepage ) return TRUE; } -static string_table *init_stringtable( int entries, UINT codepage ) +static string_table *init_stringtable( int entries, unsigned codepage ) { string_table *st; @@ -86,7 +86,7 @@ static string_table *init_stringtable( int entries, UINT codepage ) return NULL; } - st->sorted = msi_alloc( sizeof (UINT) * entries ); + st->sorted = msi_alloc( sizeof (unsigned) * entries ); if( !st->sorted ) { msi_free( st->strings ); @@ -104,7 +104,7 @@ static string_table *init_stringtable( int entries, UINT codepage ) VOID msi_destroy_stringtable( string_table *st ) { - UINT i; + unsigned i; for( i=0; imaxcount; i++ ) { @@ -119,7 +119,7 @@ VOID msi_destroy_stringtable( string_table *st ) static int st_find_free_entry( string_table *st ) { - UINT i, sz, *s; + unsigned i, sz, *s; struct msistring *p; TRACE("%p\n", st); @@ -142,7 +142,7 @@ static int st_find_free_entry( string_table *st ) if( !p ) return -1; - s = msi_realloc( st->sorted, sz*sizeof(UINT) ); + s = msi_realloc( st->sorted, sz*sizeof(unsigned) ); if( !s ) { msi_free( p ); @@ -160,7 +160,7 @@ static int st_find_free_entry( string_table *st ) return st->freeslot; } -static int find_insert_index( const string_table *st, UINT string_id ) +static int find_insert_index( const string_table *st, unsigned string_id ) { int i, c, low = 0, high = st->sortcount - 1; @@ -179,7 +179,7 @@ static int find_insert_index( const string_table *st, UINT string_id ) return high + 1; } -static void insert_string_sorted( string_table *st, UINT string_id ) +static void insert_string_sorted( string_table *st, unsigned string_id ) { int i; @@ -187,12 +187,12 @@ static void insert_string_sorted( string_table *st, UINT string_id ) if (i == -1) return; - memmove( &st->sorted[i] + 1, &st->sorted[i], (st->sortcount - i) * sizeof(UINT) ); + memmove( &st->sorted[i] + 1, &st->sorted[i], (st->sortcount - i) * sizeof(unsigned) ); st->sorted[i] = string_id; st->sortcount++; } -static void set_st_entry( string_table *st, UINT n, WCHAR *str, USHORT refcount, enum StringPersistence persistence ) +static void set_st_entry( string_table *st, unsigned n, WCHAR *str, uint16_t refcount, enum StringPersistence persistence ) { if (persistence == StringPersistent) { @@ -213,10 +213,10 @@ static void set_st_entry( string_table *st, UINT n, WCHAR *str, USHORT refcount, st->freeslot = n + 1; } -static UINT msi_string2idA( const string_table *st, const CHAR *buffer, UINT *id ) +static unsigned msi_string2idA( const string_table *st, const CHAR *buffer, unsigned *id ) { - DWORD sz; - UINT r = ERROR_INVALID_PARAMETER; + unsigned sz; + unsigned r = ERROR_INVALID_PARAMETER; WCHAR *str; TRACE("Finding string %s in string table\n", debugstr_a(buffer) ); @@ -241,7 +241,7 @@ static UINT msi_string2idA( const string_table *st, const CHAR *buffer, UINT *id return r; } -static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, USHORT refcount, enum StringPersistence persistence ) +static int msi_addstring( string_table *st, unsigned n, const CHAR *data, int len, uint16_t refcount, enum StringPersistence persistence ) { WCHAR *str; int sz; @@ -292,9 +292,9 @@ static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, U return n; } -int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence ) +int msi_addstringW( string_table *st, const WCHAR *data, int len, uint16_t refcount, enum StringPersistence persistence ) { - UINT n; + unsigned n; WCHAR *str; if( !data ) @@ -332,7 +332,7 @@ int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcoun } /* find the string identified by an id - return null if there's none */ -const WCHAR *msi_string_lookup_id( const string_table *st, UINT id ) +const WCHAR *msi_string_lookup_id( const string_table *st, unsigned id ) { if( id == 0 ) return szEmpty; @@ -357,9 +357,9 @@ const WCHAR *msi_string_lookup_id( const string_table *st, UINT id ) * * Returned string is not nul terminated. */ -static UINT msi_id2stringA( const string_table *st, UINT id, CHAR *buffer, UINT *sz ) +static unsigned msi_id2stringA( const string_table *st, unsigned id, CHAR *buffer, unsigned *sz ) { - UINT len, lenW; + unsigned len, lenW; const WCHAR *str; TRACE("Finding string %d of %d\n", id, st->maxcount); @@ -386,7 +386,7 @@ static UINT msi_id2stringA( const string_table *st, UINT id, CHAR *buffer, UINT * [in] str - string to find in the string table * [out] id - id of the string, if found */ -UINT msi_string2idW( const string_table *st, const WCHAR *str, UINT *id ) +unsigned msi_string2idW( const string_table *st, const WCHAR *str, unsigned *id ) { int i, c, low = 0, high = st->sortcount - 1; @@ -409,9 +409,9 @@ UINT msi_string2idW( const string_table *st, const WCHAR *str, UINT *id ) return ERROR_INVALID_PARAMETER; } -static void string_totalsize( const string_table *st, UINT *datasize, UINT *poolsize ) +static void string_totalsize( const string_table *st, unsigned *datasize, unsigned *poolsize ) { - UINT i, len, holesize; + unsigned i, len, holesize; if( st->strings[0].str || st->strings[0].persistent_refcount || st->strings[0].nonpersistent_refcount) ERR("oops. element 0 has a string\n"); @@ -447,8 +447,8 @@ static void string_totalsize( const string_table *st, UINT *datasize, UINT *pool HRESULT msi_init_string_table( IStorage *stg ) { - USHORT zero[2] = { 0, 0 }; - UINT ret; + uint16_t zero[2] = { 0, 0 }; + unsigned ret; /* create the StringPool stream... add the zero string to it*/ ret = write_stream_data(stg, szStringPool, zero, sizeof zero, TRUE); @@ -463,25 +463,25 @@ HRESULT msi_init_string_table( IStorage *stg ) return S_OK; } -string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) +string_table *msi_load_string_table( IStorage *stg, unsigned *bytes_per_strref ) { string_table *st = NULL; CHAR *data = NULL; - USHORT *pool = NULL; - UINT r, datasize = 0, poolsize = 0, codepage; - DWORD i, count, offset, len, n, refs; + uint16_t *pool = NULL; + unsigned r, datasize = 0, poolsize = 0, codepage; + unsigned i, count, offset, len, n, refs; - r = read_stream_data( stg, szStringPool, TRUE, (BYTE **)&pool, &poolsize ); + r = read_stream_data( stg, szStringPool, TRUE, (uint8_t **)&pool, &poolsize ); if( r != ERROR_SUCCESS) goto end; - r = read_stream_data( stg, szStringData, TRUE, (BYTE **)&data, &datasize ); + r = read_stream_data( stg, szStringData, TRUE, (uint8_t **)&data, &datasize ); if( r != ERROR_SUCCESS) goto end; if ( (poolsize > 4) && (pool[1] & 0x8000) ) *bytes_per_strref = LONG_STR_BYTES; else - *bytes_per_strref = sizeof(USHORT); + *bytes_per_strref = sizeof(uint16_t); count = poolsize/4; if( poolsize > 4 ) @@ -549,12 +549,12 @@ end: return st; } -UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref ) +unsigned msi_save_string_table( const string_table *st, IStorage *storage, unsigned *bytes_per_strref ) { - UINT i, datasize = 0, poolsize = 0, sz, used, r, codepage, n; - UINT ret = ERROR_FUNCTION_FAILED; + unsigned i, datasize = 0, poolsize = 0, sz, used, r, codepage, n; + unsigned ret = ERROR_FUNCTION_FAILED; CHAR *data = NULL; - USHORT *pool = NULL; + uint16_t *pool = NULL; TRACE("\n"); @@ -586,7 +586,7 @@ UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *byt *bytes_per_strref = LONG_STR_BYTES; } else - *bytes_per_strref = sizeof(USHORT); + *bytes_per_strref = sizeof(uint16_t); n = 1; for( i=1; imaxcount; i++ ) @@ -656,12 +656,12 @@ err: return ret; } -UINT msi_get_string_table_codepage( const string_table *st ) +unsigned msi_get_string_table_codepage( const string_table *st ) { return st->codepage; } -UINT msi_set_string_table_codepage( string_table *st, UINT codepage ) +unsigned msi_set_string_table_codepage( string_table *st, unsigned codepage ) { if (validate_codepage( codepage )) { diff --git a/libmsi/suminfo.c b/libmsi/suminfo.c index 92525d2..8c0e612 100644 --- a/libmsi/suminfo.c +++ b/libmsi/suminfo.c @@ -44,35 +44,35 @@ const CLSID FMTID_SummaryInformation = typedef struct { WORD wByteOrder; WORD wFormat; - DWORD dwOSVer; + unsigned dwOSVer; CLSID clsID; - DWORD reserved; + unsigned reserved; } PROPERTYSETHEADER; typedef struct { FMTID fmtid; - DWORD dwOffset; + unsigned dwOffset; } FORMATIDOFFSET; typedef struct { - DWORD cbSection; - DWORD cProperties; + unsigned cbSection; + unsigned cProperties; } PROPERTYSECTIONHEADER; typedef struct { - DWORD propid; - DWORD dwOffset; + unsigned propid; + unsigned dwOffset; } PROPERTYIDOFFSET; typedef struct { - DWORD type; + unsigned type; union { - INT i4; - SHORT i2; + int i4; + short i2; FILETIME ft; struct { - DWORD len; - BYTE str[1]; + unsigned len; + uint8_t str[1]; } str; } u; } PROPERTY_DATA; @@ -95,14 +95,14 @@ static void free_prop( PROPVARIANT *prop ) static void MSI_CloseSummaryInfo( MSIOBJECT *arg ) { MSISUMMARYINFO *si = (MSISUMMARYINFO *) arg; - DWORD i; + unsigned i; for( i = 0; i < MSI_MAX_PROPS; i++ ) free_prop( &si->property[i] ); IStorage_Release( si->storage ); } -static UINT get_type( UINT uiProperty ) +static unsigned get_type( unsigned uiProperty ) { switch( uiProperty ) { @@ -134,9 +134,9 @@ static UINT get_type( UINT uiProperty ) return VT_EMPTY; } -static UINT get_property_count( const PROPVARIANT *property ) +static unsigned get_property_count( const PROPVARIANT *property ) { - UINT i, n = 0; + unsigned i, n = 0; if( !property ) return n; @@ -146,7 +146,7 @@ static UINT get_property_count( const PROPVARIANT *property ) return n; } -static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VARTYPE vt) +static unsigned propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VARTYPE vt) { HRESULT hr; HMODULE propsys = LoadLibraryA("propsys.dll"); @@ -163,10 +163,10 @@ static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VART } /* FIXME: doesn't deal with endian conversion */ -static void read_properties_from_data( PROPVARIANT *prop, BYTE *data, DWORD sz ) +static void read_properties_from_data( PROPVARIANT *prop, uint8_t *data, unsigned sz ) { - UINT type; - DWORD i, size; + unsigned type; + unsigned i, size; PROPERTY_DATA *propdata; PROPVARIANT property; PROPVARIANT *ptr; @@ -196,10 +196,10 @@ static void read_properties_from_data( PROPVARIANT *prop, BYTE *data, DWORD sz ) propdata = (PROPERTY_DATA*) &data[ idofs[i].dwOffset ]; /* check we don't run off the end of the data */ - size = sz - idofs[i].dwOffset - sizeof(DWORD); - if( sizeof(DWORD) > size || + size = sz - idofs[i].dwOffset - sizeof(unsigned); + if( sizeof(unsigned) > size || ( propdata->type == VT_FILETIME && sizeof(FILETIME) > size ) || - ( propdata->type == VT_LPSTR && (propdata->u.str.len + sizeof(DWORD)) > size ) ) + ( propdata->type == VT_LPSTR && (propdata->u.str.len + sizeof(unsigned)) > size ) ) { ERR("not enough data\n"); break; @@ -233,15 +233,15 @@ static void read_properties_from_data( PROPVARIANT *prop, BYTE *data, DWORD sz ) } } -static UINT load_summary_info( MSISUMMARYINFO *si, IStream *stm ) +static unsigned load_summary_info( MSISUMMARYINFO *si, IStream *stm ) { - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; PROPERTYSETHEADER set_hdr; FORMATIDOFFSET format_hdr; PROPERTYSECTIONHEADER section_hdr; - BYTE *data = NULL; + uint8_t *data = NULL; LARGE_INTEGER ofs; - ULONG count, sz; + unsigned count, sz; HRESULT r; TRACE("%p %p\n", si, stm); @@ -303,7 +303,7 @@ static UINT load_summary_info( MSISUMMARYINFO *si, IStream *stm ) return ret; } -static DWORD write_dword( BYTE *data, DWORD ofs, DWORD val ) +static unsigned write_dword( uint8_t *data, unsigned ofs, unsigned val ) { if( data ) { @@ -315,25 +315,25 @@ static DWORD write_dword( BYTE *data, DWORD ofs, DWORD val ) return 4; } -static DWORD write_filetime( BYTE *data, DWORD ofs, const FILETIME *ft ) +static unsigned write_filetime( uint8_t *data, unsigned ofs, const FILETIME *ft ) { write_dword( data, ofs, ft->dwLowDateTime ); write_dword( data, ofs + 4, ft->dwHighDateTime ); return 8; } -static DWORD write_string( BYTE *data, DWORD ofs, const CHAR *str ) +static unsigned write_string( uint8_t *data, unsigned ofs, const CHAR *str ) { - DWORD len = lstrlenA( str ) + 1; + unsigned len = lstrlenA( str ) + 1; write_dword( data, ofs, len ); if( data ) memcpy( &data[ofs + 4], str, len ); return (7 + len) & ~3; } -static UINT write_property_to_data( const PROPVARIANT *prop, BYTE *data ) +static unsigned write_property_to_data( const PROPVARIANT *prop, uint8_t *data ) { - DWORD sz = 0; + unsigned sz = 0; if( prop->vt == VT_EMPTY ) return sz; @@ -358,15 +358,15 @@ static UINT write_property_to_data( const PROPVARIANT *prop, BYTE *data ) return sz; } -static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) +static unsigned save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) { - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; PROPERTYSETHEADER set_hdr; FORMATIDOFFSET format_hdr; PROPERTYSECTIONHEADER section_hdr; PROPERTYIDOFFSET idofs[MSI_MAX_PROPS]; - BYTE *data = NULL; - ULONG count, sz; + uint8_t *data = NULL; + unsigned count, sz; HRESULT r; int i; @@ -426,11 +426,11 @@ static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm ) return ERROR_SUCCESS; } -MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ) +MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, unsigned uiUpdateCount ) { IStream *stm = NULL; MSISUMMARYINFO *si; - DWORD grfMode; + unsigned grfMode; HRESULT r; TRACE("%p %d\n", stg, uiUpdateCount ); @@ -456,12 +456,12 @@ MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ) return si; } -UINT MsiGetSummaryInformationW( MSIOBJECT *hDatabase, - const WCHAR *szDatabase, UINT uiUpdateCount, MSIOBJECT **pHandle ) +unsigned MsiGetSummaryInformationW( MSIOBJECT *hDatabase, + const WCHAR *szDatabase, unsigned uiUpdateCount, MSIOBJECT **pHandle ) { MSISUMMARYINFO *si; MSIDATABASE *db; - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; TRACE("%d %s %d %p\n", hDatabase, debugstr_w(szDatabase), uiUpdateCount, pHandle); @@ -495,11 +495,11 @@ UINT MsiGetSummaryInformationW( MSIOBJECT *hDatabase, return ret; } -UINT MsiGetSummaryInformationA(MSIOBJECT *hDatabase, - const CHAR *szDatabase, UINT uiUpdateCount, MSIOBJECT **pHandle) +unsigned MsiGetSummaryInformationA(MSIOBJECT *hDatabase, + const CHAR *szDatabase, unsigned uiUpdateCount, MSIOBJECT **pHandle) { WCHAR *szwDatabase = NULL; - UINT ret; + unsigned ret; TRACE("%d %s %d %p\n", hDatabase, debugstr_a(szDatabase), uiUpdateCount, pHandle); @@ -518,7 +518,7 @@ UINT MsiGetSummaryInformationA(MSIOBJECT *hDatabase, return ret; } -UINT MsiSummaryInfoGetPropertyCount(MSIOBJECT *hSummaryInfo, UINT *pCount) +unsigned MsiSummaryInfoGetPropertyCount(MSIOBJECT *hSummaryInfo, unsigned *pCount) { MSISUMMARYINFO *si; @@ -535,12 +535,12 @@ UINT MsiSummaryInfoGetPropertyCount(MSIOBJECT *hSummaryInfo, UINT *pCount) return ERROR_SUCCESS; } -static UINT get_prop( MSIOBJECT *handle, UINT uiProperty, UINT *puiDataType, - INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf) +static unsigned get_prop( MSIOBJECT *handle, unsigned uiProperty, unsigned *puiDataType, + int *piValue, FILETIME *pftValue, awstring *str, unsigned *pcchValueBuf) { MSISUMMARYINFO *si; PROPVARIANT *prop; - UINT ret = ERROR_SUCCESS; + unsigned ret = ERROR_SUCCESS; TRACE("%d %d %p %p %p %p %p\n", handle, uiProperty, puiDataType, piValue, pftValue, str, pcchValueBuf); @@ -573,7 +573,7 @@ static UINT get_prop( MSIOBJECT *handle, UINT uiProperty, UINT *puiDataType, case VT_LPSTR: if( pcchValueBuf ) { - DWORD len = 0; + unsigned len = 0; if( str->unicode ) { @@ -605,7 +605,7 @@ static UINT get_prop( MSIOBJECT *handle, UINT uiProperty, UINT *puiDataType, return ret; } -WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) +WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si, unsigned uiProperty ) { PROPVARIANT *prop; @@ -617,7 +617,7 @@ WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) return strdupAtoW( prop->pszVal ); } -INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ) +int msi_suminfo_get_int32( MSISUMMARYINFO *si, unsigned uiProperty ) { PROPVARIANT *prop; @@ -645,9 +645,9 @@ WCHAR *msi_get_suminfo_product( IStorage *stg ) return prod; } -UINT MsiSummaryInfoGetPropertyA( - MSIOBJECT *handle, UINT uiProperty, UINT *puiDataType, INT *piValue, - FILETIME *pftValue, CHAR *szValueBuf, DWORD *pcchValueBuf) +unsigned MsiSummaryInfoGetPropertyA( + MSIOBJECT *handle, unsigned uiProperty, unsigned *puiDataType, int *piValue, + FILETIME *pftValue, CHAR *szValueBuf, unsigned *pcchValueBuf) { awstring str; @@ -661,9 +661,9 @@ UINT MsiSummaryInfoGetPropertyA( pftValue, &str, pcchValueBuf ); } -UINT MsiSummaryInfoGetPropertyW( - MSIOBJECT *handle, UINT uiProperty, UINT *puiDataType, INT *piValue, - FILETIME *pftValue, WCHAR *szValueBuf, DWORD *pcchValueBuf) +unsigned MsiSummaryInfoGetPropertyW( + MSIOBJECT *handle, unsigned uiProperty, unsigned *puiDataType, int *piValue, + FILETIME *pftValue, WCHAR *szValueBuf, unsigned *pcchValueBuf) { awstring str; @@ -677,11 +677,11 @@ UINT MsiSummaryInfoGetPropertyW( pftValue, &str, pcchValueBuf ); } -static UINT set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT type, - INT iValue, FILETIME* pftValue, awcstring *str ) +static unsigned set_prop( MSISUMMARYINFO *si, unsigned uiProperty, unsigned type, + int iValue, FILETIME* pftValue, awcstring *str ) { PROPVARIANT *prop; - UINT len; + unsigned len; TRACE("%p %u %u %i %p %p\n", si, uiProperty, type, iValue, pftValue, str ); @@ -732,12 +732,12 @@ static UINT set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT type, return ERROR_SUCCESS; } -UINT MsiSummaryInfoSetPropertyW( MSIOBJECT *handle, UINT uiProperty, - UINT uiDataType, INT iValue, FILETIME* pftValue, const WCHAR *szValue ) +unsigned MsiSummaryInfoSetPropertyW( MSIOBJECT *handle, unsigned uiProperty, + unsigned uiDataType, int iValue, FILETIME* pftValue, const WCHAR *szValue ) { awcstring str; MSISUMMARYINFO *si; - UINT type, ret; + unsigned type, ret; TRACE("%d %u %u %i %p %s\n", handle, uiProperty, uiDataType, iValue, pftValue, debugstr_w(szValue) ); @@ -764,12 +764,12 @@ UINT MsiSummaryInfoSetPropertyW( MSIOBJECT *handle, UINT uiProperty, return ret; } -UINT MsiSummaryInfoSetPropertyA( MSIOBJECT *handle, UINT uiProperty, - UINT uiDataType, INT iValue, FILETIME* pftValue, const CHAR *szValue ) +unsigned MsiSummaryInfoSetPropertyA( MSIOBJECT *handle, unsigned uiProperty, + unsigned uiDataType, int iValue, FILETIME* pftValue, const CHAR *szValue ) { awcstring str; MSISUMMARYINFO *si; - UINT type, ret; + unsigned type, ret; TRACE("%d %u %u %i %p %s\n", handle, uiProperty, uiDataType, iValue, pftValue, debugstr_a(szValue) ); @@ -796,11 +796,11 @@ UINT MsiSummaryInfoSetPropertyA( MSIOBJECT *handle, UINT uiProperty, return ret; } -static UINT suminfo_persist( MSISUMMARYINFO *si ) +static unsigned suminfo_persist( MSISUMMARYINFO *si ) { - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; IStream *stm = NULL; - DWORD grfMode; + unsigned grfMode; HRESULT r; grfMode = STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE; @@ -853,7 +853,7 @@ static void parse_filetime( const WCHAR *str, FILETIME *ft ) SystemTimeToFileTime( &utc, ft ); } -static UINT parse_prop( const WCHAR *prop, const WCHAR *value, UINT *pid, INT *int_value, +static unsigned parse_prop( const WCHAR *prop, const WCHAR *value, unsigned *pid, int *int_value, FILETIME *ft_value, awcstring *str_value ) { *pid = atoiW( prop ); @@ -894,10 +894,10 @@ static UINT parse_prop( const WCHAR *prop, const WCHAR *value, UINT *pid, INT *i return ERROR_SUCCESS; } -UINT msi_add_suminfo( MSIDATABASE *db, WCHAR ***records, int num_records, int num_columns ) +unsigned msi_add_suminfo( MSIDATABASE *db, WCHAR ***records, int num_records, int num_columns ) { - UINT r = ERROR_FUNCTION_FAILED; - DWORD i, j; + unsigned r = ERROR_FUNCTION_FAILED; + unsigned i, j; MSISUMMARYINFO *si; si = MSI_GetSummaryInformationW( db->storage, num_records * (num_columns / 2) ); @@ -911,8 +911,8 @@ UINT msi_add_suminfo( MSIDATABASE *db, WCHAR ***records, int num_records, int nu { for (j = 0; j < num_columns; j += 2) { - UINT pid; - INT int_value = 0; + unsigned pid; + int int_value = 0; FILETIME ft_value; awcstring str_value; @@ -934,10 +934,10 @@ end: return r; } -UINT MsiSummaryInfoPersist( MSIOBJECT *handle ) +unsigned MsiSummaryInfoPersist( MSIOBJECT *handle ) { MSISUMMARYINFO *si; - UINT ret; + unsigned ret; TRACE("%d\n", handle ); @@ -951,9 +951,9 @@ UINT MsiSummaryInfoPersist( MSIOBJECT *handle ) return ret; } -UINT MsiCreateTransformSummaryInfoA( MSIOBJECT *db, MSIOBJECT *db_ref, const CHAR *transform, int error, int validation ) +unsigned MsiCreateTransformSummaryInfoA( MSIOBJECT *db, MSIOBJECT *db_ref, const CHAR *transform, int error, int validation ) { - UINT r; + unsigned r; WCHAR *transformW = NULL; TRACE("%u, %u, %s, %d, %d\n", db, db_ref, debugstr_a(transform), error, validation); @@ -966,7 +966,7 @@ UINT MsiCreateTransformSummaryInfoA( MSIOBJECT *db, MSIOBJECT *db_ref, const CHA return r; } -UINT MsiCreateTransformSummaryInfoW( MSIOBJECT *db, MSIOBJECT *db_ref, const WCHAR *transform, int error, int validation ) +unsigned MsiCreateTransformSummaryInfoW( MSIOBJECT *db, MSIOBJECT *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; diff --git a/libmsi/table.c b/libmsi/table.c index dabe8a5..544bfa1 100644 --- a/libmsi/table.c +++ b/libmsi/table.c @@ -44,32 +44,32 @@ typedef struct tagMSICOLUMNHASHENTRY { struct tagMSICOLUMNHASHENTRY *next; - UINT value; - UINT row; + unsigned value; + unsigned row; } MSICOLUMNHASHENTRY; typedef struct tagMSICOLUMNINFO { const WCHAR *tablename; - UINT number; + unsigned number; const WCHAR *colname; - UINT type; - UINT offset; - INT ref_count; + unsigned type; + unsigned offset; + int ref_count; BOOL temporary; MSICOLUMNHASHENTRY **hash_table; } MSICOLUMNINFO; struct tagMSITABLE { - BYTE **data; + uint8_t **data; BOOL *data_persistent; - UINT row_count; + unsigned row_count; struct list entry; MSICOLUMNINFO *colinfo; - UINT col_count; + unsigned col_count; MSICONDITION persistent; - INT ref_count; + int ref_count; WCHAR name[1]; }; @@ -93,7 +93,7 @@ static const MSICOLUMNINFO _Tables_cols[1] = { #define MAX_STREAM_NAME 0x1f -static inline UINT bytes_per_column( MSIDATABASE *db, const MSICOLUMNINFO *col, UINT bytes_per_strref ) +static inline unsigned bytes_per_column( MSIDATABASE *db, const MSICOLUMNINFO *col, unsigned bytes_per_strref ) { if( MSITYPE_IS_BINARY(col->type) ) return 2; @@ -127,8 +127,8 @@ static int utf2mime(int x) WCHAR *encode_streamname(BOOL bTable, const WCHAR *in) { - DWORD count = MAX_STREAM_NAME; - DWORD ch, next; + unsigned count = MAX_STREAM_NAME; + unsigned ch, next; WCHAR *out; WCHAR *p; @@ -188,7 +188,7 @@ static int mime2utf(int x) BOOL decode_streamname(const WCHAR *in, WCHAR *out) { WCHAR ch; - DWORD count = 0; + unsigned count = 0; while ( (ch = *in++) ) { @@ -216,7 +216,7 @@ void enum_stream_names( IStorage *stg ) IEnumSTATSTG *stgenum = NULL; HRESULT r; STATSTG stat; - ULONG n, count; + unsigned n, count; WCHAR name[0x40]; r = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum ); @@ -240,13 +240,13 @@ void enum_stream_names( IStorage *stg ) IEnumSTATSTG_Release( stgenum ); } -UINT read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, - BYTE **pdata, UINT *psz ) +unsigned read_stream_data( IStorage *stg, const WCHAR *stname, BOOL table, + uint8_t **pdata, unsigned *psz ) { HRESULT r; - UINT ret = ERROR_FUNCTION_FAILED; + unsigned ret = ERROR_FUNCTION_FAILED; VOID *data; - ULONG sz, count; + unsigned sz, count; IStream *stm = NULL; STATSTG stat; WCHAR *encname; @@ -304,12 +304,12 @@ end: return ret; } -UINT write_stream_data( IStorage *stg, const WCHAR *stname, - const void *data, UINT sz, BOOL bTable ) +unsigned write_stream_data( IStorage *stg, const WCHAR *stname, + const void *data, unsigned sz, BOOL bTable ) { HRESULT r; - UINT ret = ERROR_FUNCTION_FAILED; - ULONG count; + unsigned ret = ERROR_FUNCTION_FAILED; + unsigned count; IStream *stm = NULL; ULARGE_INTEGER size; LARGE_INTEGER pos; @@ -364,15 +364,15 @@ end: return ret; } -static void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count ) +static void msi_free_colinfo( MSICOLUMNINFO *colinfo, unsigned count ) { - UINT i; + unsigned i; for (i = 0; i < count; i++) msi_free( colinfo[i].hash_table ); } static void free_table( MSITABLE *table ) { - UINT i; + unsigned i; for( i=0; irow_count; i++ ) msi_free( table->data[i] ); msi_free( table->data ); @@ -382,7 +382,7 @@ static void free_table( MSITABLE *table ) msi_free( table ); } -static UINT msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, UINT count, UINT bytes_per_strref ) +static unsigned msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, unsigned count, unsigned bytes_per_strref ) { const MSICOLUMNINFO *last_col; @@ -391,7 +391,7 @@ static UINT msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, if (bytes_per_strref != LONG_STR_BYTES) { - UINT i, size = 0; + unsigned i, size = 0; for (i = 0; i < count; i++) size += bytes_per_column( db, &cols[i], bytes_per_strref ); return size; } @@ -400,10 +400,10 @@ static UINT msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, } /* add this table to the list of cached tables in the database */ -static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg ) +static unsigned read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg ) { - BYTE *rawdata = NULL; - UINT rawsize = 0, i, j, row_size, row_size_mem; + uint8_t *rawdata = NULL; + unsigned rawsize = 0, i, j, row_size, row_size_mem; TRACE("%s\n",debugstr_w(t->name)); @@ -424,7 +424,7 @@ static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg } t->row_count = rawsize / row_size; - t->data = msi_alloc_zero( t->row_count * sizeof (USHORT*) ); + t->data = msi_alloc_zero( t->row_count * sizeof (uint16_t*) ); if( !t->data ) goto err; t->data_persistent = msi_alloc_zero( t->row_count * sizeof(BOOL)); @@ -435,7 +435,7 @@ static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg TRACE("Transposing data from %d rows\n", t->row_count ); for (i = 0; i < t->row_count; i++) { - UINT ofs = 0, ofs_mem = 0; + unsigned ofs = 0, ofs_mem = 0; t->data[i] = msi_alloc( row_size_mem ); if( !t->data[i] ) @@ -444,9 +444,9 @@ static UINT read_table_from_storage( MSIDATABASE *db, MSITABLE *t, IStorage *stg for (j = 0; j < t->col_count; j++) { - UINT m = bytes_per_column( db, &t->colinfo[j], LONG_STR_BYTES ); - UINT n = bytes_per_column( db, &t->colinfo[j], db->bytes_per_strref ); - UINT k; + unsigned m = bytes_per_column( db, &t->colinfo[j], LONG_STR_BYTES ); + unsigned n = bytes_per_column( db, &t->colinfo[j], db->bytes_per_strref ); + unsigned k; if ( n != 2 && n != 3 && n != 4 ) { @@ -502,9 +502,9 @@ static MSITABLE *find_cached_table( MSIDATABASE *db, const WCHAR *name ) return NULL; } -static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, DWORD count ) +static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, unsigned count ) { - DWORD i; + unsigned i; for (i = 0; colinfo && i < count; i++) { @@ -519,10 +519,10 @@ static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, } } -static UINT get_defaulttablecolumns( MSIDATABASE *db, const WCHAR *name, MSICOLUMNINFO *colinfo, UINT *sz ) +static unsigned get_defaulttablecolumns( MSIDATABASE *db, const WCHAR *name, MSICOLUMNINFO *colinfo, unsigned *sz ) { const MSICOLUMNINFO *p; - DWORD i, n; + unsigned i, n; TRACE("%s\n", debugstr_w(name)); @@ -548,11 +548,11 @@ static UINT get_defaulttablecolumns( MSIDATABASE *db, const WCHAR *name, MSICOLU return ERROR_SUCCESS; } -static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLUMNINFO *colinfo, UINT *sz ); +static unsigned get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLUMNINFO *colinfo, unsigned *sz ); -static UINT table_get_column_info( MSIDATABASE *db, const WCHAR *name, MSICOLUMNINFO **pcols, UINT *pcount ) +static unsigned table_get_column_info( MSIDATABASE *db, const WCHAR *name, MSICOLUMNINFO **pcols, unsigned *pcount ) { - UINT r, column_count = 0; + unsigned r, column_count = 0; MSICOLUMNINFO *columns; /* get the number of columns in this table */ @@ -583,10 +583,10 @@ static UINT table_get_column_info( MSIDATABASE *db, const WCHAR *name, MSICOLUMN return r; } -static UINT get_table( MSIDATABASE *db, const WCHAR *name, MSITABLE **table_ret ) +static unsigned get_table( MSIDATABASE *db, const WCHAR *name, MSITABLE **table_ret ) { MSITABLE *table; - UINT r; + unsigned r; /* first, see if the table is cached */ table = find_cached_table( db, name ); @@ -629,9 +629,9 @@ static UINT get_table( MSIDATABASE *db, const WCHAR *name, MSITABLE **table_ret return ERROR_SUCCESS; } -static UINT read_table_int( BYTE *const *data, UINT row, UINT col, UINT bytes ) +static unsigned read_table_int( uint8_t *const *data, unsigned row, unsigned col, unsigned bytes ) { - UINT ret = 0, i; + unsigned ret = 0, i; for (i = 0; i < bytes; i++) ret += data[row][col + i] << i * 8; @@ -639,9 +639,9 @@ static UINT read_table_int( BYTE *const *data, UINT row, UINT col, UINT bytes ) return ret; } -static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLUMNINFO *colinfo, UINT *sz ) +static unsigned get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLUMNINFO *colinfo, unsigned *sz ) { - UINT r, i, n = 0, table_id, count, maxcount = *sz; + unsigned r, i, n = 0, table_id, count, maxcount = *sz; MSITABLE *table = NULL; TRACE("%s\n", debugstr_w(szTableName)); @@ -677,8 +677,8 @@ static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLU if (read_table_int( table->data, i, 0, LONG_STR_BYTES) != table_id) continue; if (colinfo) { - UINT id = read_table_int( table->data, i, table->colinfo[2].offset, LONG_STR_BYTES ); - UINT col = read_table_int( table->data, i, table->colinfo[1].offset, sizeof(USHORT) ) - (1 << 15); + unsigned id = read_table_int( table->data, i, table->colinfo[2].offset, LONG_STR_BYTES ); + unsigned col = read_table_int( table->data, i, table->colinfo[1].offset, sizeof(uint16_t) ) - (1 << 15); /* check the column number is in range */ if (col < 1 || col > maxcount) @@ -696,7 +696,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLU colinfo[col - 1].number = col; colinfo[col - 1].colname = msi_string_lookup_id( db->strings, id ); colinfo[col - 1].type = read_table_int( table->data, i, table->colinfo[3].offset, - sizeof(USHORT) ) - (1 << 15); + sizeof(uint16_t) ) - (1 << 15); colinfo[col - 1].offset = 0; colinfo[col - 1].ref_count = 0; colinfo[col - 1].hash_table = NULL; @@ -716,16 +716,16 @@ static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, MSICOLU return ERROR_SUCCESS; } -UINT msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_info, +unsigned msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_info, MSICONDITION persistent ) { enum StringPersistence string_persistence = (persistent) ? StringPersistent : StringNonPersistent; - UINT r, nField; + unsigned r, nField; MSIVIEW *tv = NULL; MSIRECORD *rec = NULL; column_info *col; MSITABLE *table; - UINT i; + unsigned i; /* only add tables that don't exist already */ if( TABLE_Exists(db, name ) ) @@ -759,8 +759,8 @@ UINT msi_create_table( MSIDATABASE *db, const WCHAR *name, column_info *col_info for( i = 0, col = col_info; col; i++, col = col->next ) { - UINT table_id = msi_addstringW( db->strings, col->table, -1, 1, string_persistence ); - UINT col_id = msi_addstringW( db->strings, col->column, -1, 1, string_persistence ); + unsigned table_id = msi_addstringW( db->strings, col->table, -1, 1, string_persistence ); + unsigned col_id = msi_addstringW( db->strings, col->column, -1, 1, string_persistence ); table->colinfo[ i ].tablename = msi_string_lookup_id( db->strings, table_id ); table->colinfo[ i ].number = i + 1; @@ -869,11 +869,11 @@ err: return r; } -static UINT save_table( MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strref ) +static unsigned save_table( MSIDATABASE *db, const MSITABLE *t, unsigned bytes_per_strref ) { - BYTE *rawdata = NULL; - UINT rawsize, i, j, row_size, row_count; - UINT r = ERROR_FUNCTION_FAILED; + uint8_t *rawdata = NULL; + unsigned rawsize, i, j, row_size, row_count; + unsigned r = ERROR_FUNCTION_FAILED; /* Nothing to do for non-persistent tables */ if( t->persistent == MSICONDITION_FALSE ) @@ -902,15 +902,15 @@ static UINT save_table( MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strre rawsize = 0; for (i = 0; i < t->row_count; i++) { - UINT ofs = 0, ofs_mem = 0; + unsigned ofs = 0, ofs_mem = 0; if (!t->data_persistent[i]) break; for (j = 0; j < t->col_count; j++) { - UINT m = bytes_per_column( db, &t->colinfo[j], LONG_STR_BYTES ); - UINT n = bytes_per_column( db, &t->colinfo[j], bytes_per_strref ); - UINT k; + unsigned m = bytes_per_column( db, &t->colinfo[j], LONG_STR_BYTES ); + unsigned n = bytes_per_column( db, &t->colinfo[j], bytes_per_strref ); + unsigned k; if (n != 2 && n != 3 && n != 4) { @@ -919,7 +919,7 @@ static UINT save_table( MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strre } if (t->colinfo[j].type & MSITYPE_STRING && n < m) { - UINT id = read_table_int( t->data, i, ofs_mem, LONG_STR_BYTES ); + unsigned id = read_table_int( t->data, i, ofs_mem, LONG_STR_BYTES ); if (id > 1 << bytes_per_strref * 8) { ERR("string id %u out of range\n", id); @@ -947,8 +947,8 @@ err: static void msi_update_table_columns( MSIDATABASE *db, const WCHAR *name ) { MSITABLE *table; - UINT size, offset, old_count; - UINT n; + unsigned size, offset, old_count; + unsigned n; table = find_cached_table( db, name ); old_count = table->col_count; @@ -973,7 +973,7 @@ static void msi_update_table_columns( MSIDATABASE *db, const WCHAR *name ) /* try to find the table name in the _Tables table */ BOOL TABLE_Exists( MSIDATABASE *db, const WCHAR *name ) { - UINT r, table_id, i; + unsigned r, table_id, i; MSITABLE *table; if( !strcmpW( name, szTables ) || !strcmpW( name, szColumns ) || @@ -1011,15 +1011,15 @@ typedef struct tagMSITABLEVIEW MSIDATABASE *db; MSITABLE *table; MSICOLUMNINFO *columns; - UINT num_cols; - UINT row_size; + unsigned num_cols; + unsigned row_size; WCHAR name[1]; } MSITABLEVIEW; -static UINT TABLE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned TABLE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT offset, n; + unsigned offset, n; if( !tv->table ) return ERROR_INVALID_PARAMETER; @@ -1053,12 +1053,12 @@ static UINT TABLE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return ERROR_SUCCESS; } -static UINT msi_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname ) +static unsigned msi_stream_name( const MSITABLEVIEW *tv, unsigned row, WCHAR **pstname ) { WCHAR *p; WCHAR *stname = NULL; - UINT i, r, type, ival; - DWORD len; + unsigned i, r, type, ival; + unsigned len; const WCHAR *sval; MSIVIEW *view = (MSIVIEW *) tv; @@ -1097,7 +1097,7 @@ static UINT msi_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname ) else { static const WCHAR fmt[] = { '%','d',0 }; - UINT n = bytes_per_column( tv->db, &tv->columns[i], LONG_STR_BYTES ); + unsigned n = bytes_per_column( tv->db, &tv->columns[i], LONG_STR_BYTES ); switch( n ) { @@ -1145,10 +1145,10 @@ err: * the name of the stream in the same table, and the table name * which may not be available at higher levels of the query */ -static UINT TABLE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm ) +static unsigned TABLE_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, IStream **stm ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT r; + unsigned r; WCHAR *encname; WCHAR *full_name = NULL; @@ -1172,9 +1172,9 @@ static UINT TABLE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm return r; } -static UINT TABLE_set_int( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) +static unsigned TABLE_set_int( MSITABLEVIEW *tv, unsigned row, unsigned col, unsigned val ) { - UINT offset, n, i; + unsigned offset, n, i; if( !tv->table ) return ERROR_INVALID_PARAMETER; @@ -1209,7 +1209,7 @@ static UINT TABLE_set_int( MSITABLEVIEW *tv, UINT row, UINT col, UINT val ) return ERROR_SUCCESS; } -static UINT TABLE_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned TABLE_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; @@ -1219,7 +1219,7 @@ static UINT TABLE_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) return msi_view_get_row(tv->db, view, row, rec); } -static UINT msi_addstreamW( MSIDATABASE *db, const WCHAR *name, IStream *data ) +static unsigned msi_addstreamW( MSIDATABASE *db, const WCHAR *name, IStream *data ) { static const WCHAR insert[] = { 'I','N','S','E','R','T',' ','I','N','T','O',' ', @@ -1228,7 +1228,7 @@ static UINT msi_addstreamW( MSIDATABASE *db, const WCHAR *name, IStream *data ) 'V','A','L','U','E','S',' ','(','?',',','?',')',0}; MSIQUERY *query = NULL; MSIRECORD *rec; - UINT r; + unsigned r; TRACE("%p %s %p\n", db, debugstr_w(name), data); @@ -1256,10 +1256,10 @@ err: return r; } -static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT iField, UINT *pvalue ) +static unsigned get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, unsigned iField, unsigned *pvalue ) { MSICOLUMNINFO columninfo; - UINT r; + unsigned r; if ( (iField <= 0) || (iField > tv->num_cols) || @@ -1294,17 +1294,17 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT } else { - INT ival = MSI_RecordGetInteger( rec, iField ); + int ival = MSI_RecordGetInteger( rec, iField ); *pvalue = ival ^ 0x80000000; } return ERROR_SUCCESS; } -static UINT TABLE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) +static unsigned TABLE_set_row( MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT i, val, r = ERROR_SUCCESS; + unsigned i, val, r = ERROR_SUCCESS; if ( !tv->table ) return ERROR_INVALID_PARAMETER; @@ -1357,7 +1357,7 @@ static UINT TABLE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) } else if ( tv->columns[i].type & MSITYPE_STRING ) { - UINT x; + unsigned x; if ( r != ERROR_SUCCESS ) { @@ -1386,15 +1386,15 @@ static UINT TABLE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) return r; } -static UINT table_create_new_row( MSIVIEW *view, UINT *num, BOOL temporary ) +static unsigned table_create_new_row( MSIVIEW *view, unsigned *num, BOOL temporary ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - BYTE **p, *row; + uint8_t **p, *row; BOOL *b; - UINT sz; - BYTE ***data_ptr; + unsigned sz; + uint8_t ***data_ptr; BOOL **data_persist_ptr; - UINT *row_count; + unsigned *row_count; TRACE("%p %s\n", view, temporary ? "TRUE" : "FALSE"); @@ -1411,7 +1411,7 @@ static UINT table_create_new_row( MSIVIEW *view, UINT *num, BOOL temporary ) if (*num == -1) *num = tv->table->row_count; - sz = (*row_count + 1) * sizeof (BYTE*); + sz = (*row_count + 1) * sizeof (uint8_t*); if( *data_ptr ) p = msi_realloc( *data_ptr, sz ); else @@ -1445,7 +1445,7 @@ static UINT table_create_new_row( MSIVIEW *view, UINT *num, BOOL temporary ) return ERROR_SUCCESS; } -static UINT TABLE_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned TABLE_execute( MSIVIEW *view, MSIRECORD *record ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; @@ -1456,14 +1456,14 @@ static UINT TABLE_execute( MSIVIEW *view, MSIRECORD *record ) return ERROR_SUCCESS; } -static UINT TABLE_close( MSIVIEW *view ) +static unsigned TABLE_close( MSIVIEW *view ) { TRACE("%p\n", view ); return ERROR_SUCCESS; } -static UINT TABLE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols) +static unsigned TABLE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; @@ -1481,8 +1481,8 @@ static UINT TABLE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols) return ERROR_SUCCESS; } -static UINT TABLE_get_column_info( MSIVIEW *view, - UINT n, const WCHAR **name, UINT *type, BOOL *temporary, +static unsigned TABLE_get_column_info( MSIVIEW *view, + unsigned n, const WCHAR **name, unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; @@ -1515,11 +1515,11 @@ static UINT TABLE_get_column_info( MSIVIEW *view, return ERROR_SUCCESS; } -static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ); +static unsigned msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, unsigned *row, unsigned *column ); -static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) +static unsigned table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, unsigned *column ) { - UINT r, row, i; + unsigned r, row, i; /* check there's no null values where they're not allowed */ for( i = 0; i < tv->num_cols; i++ ) @@ -1542,7 +1542,7 @@ static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) } else { - UINT n; + unsigned n; n = MSI_RecordGetInteger( rec, i+1 ); if (n == MSI_NULL_INTEGER) @@ -1561,9 +1561,9 @@ static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column ) return ERROR_SUCCESS; } -static int compare_record( MSITABLEVIEW *tv, UINT row, MSIRECORD *rec ) +static int compare_record( MSITABLEVIEW *tv, unsigned row, MSIRECORD *rec ) { - UINT r, i, ivalue, x; + unsigned r, i, ivalue, x; for (i = 0; i < tv->num_cols; i++ ) { @@ -1619,10 +1619,10 @@ static int find_insert_index( MSITABLEVIEW *tv, MSIRECORD *rec ) return high + 1; } -static UINT TABLE_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary ) +static unsigned TABLE_insert_row( MSIVIEW *view, MSIRECORD *rec, unsigned row, BOOL temporary ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT i, r; + unsigned i, r; TRACE("%p %p %s\n", tv, rec, temporary ? "TRUE" : "FALSE" ); @@ -1652,10 +1652,10 @@ static UINT TABLE_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temp return TABLE_set_row( view, row, rec, (1<num_cols) - 1 ); } -static UINT TABLE_delete_row( MSIVIEW *view, UINT row ) +static unsigned TABLE_delete_row( MSIVIEW *view, unsigned row ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT r, num_rows, num_cols, i; + unsigned r, num_rows, num_cols, i; TRACE("%p %d\n", tv, row); @@ -1690,10 +1690,10 @@ static UINT TABLE_delete_row( MSIVIEW *view, UINT row ) return ERROR_SUCCESS; } -static UINT msi_table_update(MSIVIEW *view, MSIRECORD *rec, UINT row) +static unsigned msi_table_update(MSIVIEW *view, MSIRECORD *rec, unsigned row) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; - UINT r, new_row; + unsigned r, new_row; /* FIXME: MsiViewFetch should set rec index 0 to some ID that * sets the fetched record apart from other records @@ -1716,10 +1716,10 @@ static UINT msi_table_update(MSIVIEW *view, MSIRECORD *rec, UINT row) return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1); } -static UINT msi_table_assign(MSIVIEW *view, MSIRECORD *rec) +static unsigned msi_table_assign(MSIVIEW *view, MSIRECORD *rec) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; - UINT r, row; + unsigned r, row; if (!tv->table) return ERROR_INVALID_PARAMETER; @@ -1731,10 +1731,10 @@ static UINT msi_table_assign(MSIVIEW *view, MSIRECORD *rec) return TABLE_insert_row( view, rec, -1, FALSE ); } -static UINT modify_delete_row( MSIVIEW *view, MSIRECORD *rec ) +static unsigned modify_delete_row( MSIVIEW *view, MSIRECORD *rec ) { MSITABLEVIEW *tv = (MSITABLEVIEW *)view; - UINT row, r; + unsigned row, r; r = msi_table_find_row(tv, rec, &row, NULL); if (r != ERROR_SUCCESS) @@ -1743,10 +1743,10 @@ static UINT modify_delete_row( MSIVIEW *view, MSIRECORD *rec ) return TABLE_delete_row(view, row); } -static UINT msi_refresh_record( MSIVIEW *view, MSIRECORD *rec, UINT row ) +static unsigned msi_refresh_record( MSIVIEW *view, MSIRECORD *rec, unsigned row ) { MSIRECORD *curr; - UINT r, i, count; + unsigned r, i, count; r = TABLE_get_row(view, row - 1, &curr); if (r != ERROR_SUCCESS) @@ -1763,11 +1763,11 @@ static UINT msi_refresh_record( MSIVIEW *view, MSIRECORD *rec, UINT row ) return ERROR_SUCCESS; } -static UINT TABLE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row) +static unsigned TABLE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT r, frow, column; + unsigned r, frow, column; TRACE("%p %d %p\n", view, eModifyMode, rec ); @@ -1838,7 +1838,7 @@ static UINT TABLE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return r; } -static UINT TABLE_delete( MSIVIEW *view ) +static unsigned TABLE_delete( MSIVIEW *view ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; @@ -1852,8 +1852,8 @@ static UINT TABLE_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT TABLE_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned TABLE_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; const MSICOLUMNHASHENTRY *entry; @@ -1868,8 +1868,8 @@ static UINT TABLE_find_matching_rows( MSIVIEW *view, UINT col, if( !tv->columns[col-1].hash_table ) { - UINT i; - UINT num_rows = tv->table->row_count; + unsigned i; + unsigned num_rows = tv->table->row_count; MSICOLUMNHASHENTRY **hash_table; MSICOLUMNHASHENTRY *new_entry; @@ -1894,7 +1894,7 @@ static UINT TABLE_find_matching_rows( MSIVIEW *view, UINT col, for (i = 0; i < num_rows; i++, new_entry++) { - UINT row_value; + unsigned row_value; if (view->ops->fetch_int( view, i, col, &row_value ) != ERROR_SUCCESS) continue; @@ -1931,10 +1931,10 @@ static UINT TABLE_find_matching_rows( MSIVIEW *view, UINT col, return ERROR_SUCCESS; } -static UINT TABLE_add_ref(MSIVIEW *view) +static unsigned TABLE_add_ref(MSIVIEW *view) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - UINT i; + unsigned i; TRACE("%p %d\n", view, tv->table->ref_count); @@ -1947,12 +1947,12 @@ static UINT TABLE_add_ref(MSIVIEW *view) return InterlockedIncrement(&tv->table->ref_count); } -static UINT TABLE_remove_column(MSIVIEW *view, const WCHAR *table, UINT number) +static unsigned TABLE_remove_column(MSIVIEW *view, const WCHAR *table, unsigned number) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSIRECORD *rec = NULL; MSIVIEW *columns = NULL; - UINT row, r; + unsigned row, r; rec = MSI_CreateRecord(2); if (!rec) @@ -1981,11 +1981,11 @@ done: return r; } -static UINT TABLE_release(MSIVIEW *view) +static unsigned TABLE_release(MSIVIEW *view) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - INT ref = tv->table->ref_count; - UINT i, r; + int ref = tv->table->ref_count; + unsigned i, r; TRACE("%p %d\n", view, ref); @@ -2018,13 +2018,13 @@ static UINT TABLE_release(MSIVIEW *view) return ref; } -static UINT TABLE_add_column(MSIVIEW *view, const WCHAR *table, UINT number, - const WCHAR *column, UINT type, BOOL hold) +static unsigned TABLE_add_column(MSIVIEW *view, const WCHAR *table, unsigned number, + const WCHAR *column, unsigned type, BOOL hold) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSITABLE *msitable; MSIRECORD *rec; - UINT r, i; + unsigned r, i; rec = MSI_CreateRecord(4); if (!rec) @@ -2059,13 +2059,13 @@ done: return r; } -static UINT TABLE_drop(MSIVIEW *view) +static unsigned TABLE_drop(MSIVIEW *view) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSIVIEW *tables = NULL; MSIRECORD *rec = NULL; - UINT r, row; - INT i; + unsigned r, row; + int i; TRACE("dropping table %s\n", debugstr_w(tv->name)); @@ -2128,10 +2128,10 @@ static const MSIVIEWOPS table_ops = TABLE_drop, }; -UINT TABLE_CreateView( MSIDATABASE *db, const WCHAR *name, MSIVIEW **view ) +unsigned TABLE_CreateView( MSIDATABASE *db, const WCHAR *name, MSIVIEW **view ) { MSITABLEVIEW *tv ; - UINT r, sz; + unsigned r, sz; TRACE("%p %s %p\n", db, debugstr_w(name), view ); @@ -2170,9 +2170,9 @@ UINT TABLE_CreateView( MSIDATABASE *db, const WCHAR *name, MSIVIEW **view ) return ERROR_SUCCESS; } -UINT MSI_CommitTables( MSIDATABASE *db ) +unsigned MSI_CommitTables( MSIDATABASE *db ) { - UINT r, bytes_per_strref; + unsigned r, bytes_per_strref; HRESULT hr; MSITABLE *table = NULL; @@ -2208,7 +2208,7 @@ UINT MSI_CommitTables( MSIDATABASE *db ) MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, const WCHAR *table ) { MSITABLE *t; - UINT r; + unsigned r; TRACE("%p %s\n", db, debugstr_w(table)); @@ -2222,9 +2222,9 @@ MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, const WCHAR *table return t->persistent; } -static UINT read_raw_int(const BYTE *data, UINT col, UINT bytes) +static unsigned read_raw_int(const uint8_t *data, unsigned col, unsigned bytes) { - UINT ret = 0, i; + unsigned ret = 0, i; for (i = 0; i < bytes; i++) ret += (data[col + i] << i * 8); @@ -2232,13 +2232,13 @@ static UINT read_raw_int(const BYTE *data, UINT col, UINT bytes) return ret; } -static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR **pstname ) +static unsigned msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, WCHAR **pstname ) { WCHAR *stname = NULL; WCHAR *sval; WCHAR *p; - DWORD len; - UINT i, r; + unsigned len; + unsigned i, r; TRACE("%p %p\n", tv, rec); @@ -2294,10 +2294,10 @@ err: static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st, IStorage *stg, - const BYTE *rawdata, UINT bytes_per_strref ) + const uint8_t *rawdata, unsigned bytes_per_strref ) { - UINT i, val, ofs = 0; - USHORT mask; + unsigned i, val, ofs = 0; + uint16_t mask; MSICOLUMNINFO *columns = tv->columns; MSIRECORD *rec; @@ -2321,7 +2321,7 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string { WCHAR *encname; IStream *stm = NULL; - UINT r; + unsigned r; ofs += bytes_per_column( tv->db, &columns[i], bytes_per_strref ); @@ -2353,7 +2353,7 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string } else { - UINT n = bytes_per_column( tv->db, &columns[i], bytes_per_strref ); + unsigned n = bytes_per_column( tv->db, &columns[i], bytes_per_strref ); switch( n ) { case 2: @@ -2380,7 +2380,7 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string static void dump_record( MSIRECORD *rec ) { - UINT i, n; + unsigned i, n; n = MSI_RecordGetFieldCount( rec ); for( i=1; i<=n; i++ ) @@ -2396,10 +2396,10 @@ static void dump_record( MSIRECORD *rec ) } } -static void dump_table( const string_table *st, const USHORT *rawdata, UINT rawsize ) +static void dump_table( const string_table *st, const uint16_t *rawdata, unsigned rawsize ) { const WCHAR *sval; - UINT i; + unsigned i; for( i=0; i<(rawsize/2); i++ ) { @@ -2408,12 +2408,12 @@ static void dump_table( const string_table *st, const USHORT *rawdata, UINT raws } } -static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) +static unsigned* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) { const WCHAR *str; - UINT i, r, *data; + unsigned i, r, *data; - data = msi_alloc( tv->num_cols *sizeof (UINT) ); + data = msi_alloc( tv->num_cols *sizeof (unsigned) ); for( i=0; inum_cols; i++ ) { data[i] = 0; @@ -2455,9 +2455,9 @@ static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec ) return data; } -static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *column ) +static unsigned msi_row_matches( MSITABLEVIEW *tv, unsigned row, const unsigned *data, unsigned *column ) { - UINT i, r, x, ret = ERROR_FUNCTION_FAILED; + unsigned i, r, x, ret = ERROR_FUNCTION_FAILED; for( i=0; inum_cols; i++ ) { @@ -2484,9 +2484,9 @@ static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT return ret; } -static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column ) +static unsigned msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, unsigned *row, unsigned *column ) { - UINT i, r = ERROR_FUNCTION_FAILED, *data; + unsigned i, r = ERROR_FUNCTION_FAILED, *data; data = msi_record_to_row( tv, rec ); if( !data ) @@ -2510,13 +2510,13 @@ typedef struct WCHAR *name; } TRANSFORMDATA; -static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, +static unsigned msi_table_load_transform( MSIDATABASE *db, IStorage *stg, string_table *st, TRANSFORMDATA *transform, - UINT bytes_per_strref ) + unsigned bytes_per_strref ) { - BYTE *rawdata = NULL; + uint8_t *rawdata = NULL; MSITABLEVIEW *tv = NULL; - UINT r, n, sz, i, mask, num_cols, colcol = 0, rawsize = 0; + unsigned r, n, sz, i, mask, num_cols, colcol = 0, rawsize = 0; MSIRECORD *rec = NULL; WCHAR coltable[32]; const WCHAR *name; @@ -2599,7 +2599,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, if (n + sz > rawsize) { ERR("borked.\n"); - dump_table( st, (USHORT *)rawdata, rawsize ); + dump_table( st, (uint16_t *)rawdata, rawsize ); break; } @@ -2607,9 +2607,9 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, if (rec) { WCHAR table[32]; - DWORD sz = 32; - UINT number = MSI_NULL_INTEGER; - UINT row = 0; + unsigned sz = 32; + unsigned number = MSI_NULL_INTEGER; + unsigned row = 0; if (!strcmpW( name, szColumns )) { @@ -2692,7 +2692,7 @@ err: * * Enumerate the table transforms in a transform storage and apply each one. */ -UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) +unsigned msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) { struct list transforms; IEnumSTATSTG *stgenum = NULL; @@ -2701,8 +2701,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) HRESULT r; STATSTG stat; string_table *strings; - UINT ret = ERROR_FUNCTION_FAILED; - UINT bytes_per_strref; + unsigned ret = ERROR_FUNCTION_FAILED; + unsigned bytes_per_strref; TRACE("%p %p\n", db, stg ); @@ -2720,7 +2720,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) { MSITABLEVIEW *tv = NULL; WCHAR name[0x40]; - ULONG count = 0; + unsigned count = 0; r = IEnumSTATSTG_Next( stgenum, 1, &stat, &count ); if ( FAILED( r ) || !count ) diff --git a/libmsi/tokenize.c b/libmsi/tokenize.c index 8ae62a8..93f5115 100644 --- a/libmsi/tokenize.c +++ b/libmsi/tokenize.c @@ -94,13 +94,13 @@ static int compKeyword(const void *m1, const void *m2){ for (; *p; p++, q++) { CHAR c; - if ((USHORT) *p > 127) + if ((uint16_t) *p > 127) return 1; c = *p; if (c >= 'a' && c <= 'z') c ^= 'A' ^ 'a'; if (c != *q) - return (UINT)c - (UINT)*q; + return (unsigned)c - (unsigned)*q; } return (unsigned)*p - (unsigned)*q; diff --git a/libmsi/unicode.h b/libmsi/unicode.h index d113453..7b4e6f7 100644 --- a/libmsi/unicode.h +++ b/libmsi/unicode.h @@ -77,20 +77,20 @@ static inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src ) static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch ) { - do { if (*str == ch) return (WCHAR *)(ULONG_PTR)str; } while (*str++); + do { if (*str == ch) return (WCHAR *)(uintptr_t)str; } while (*str++); return NULL; } static inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch ) { WCHAR *ret = NULL; - do { if (*str == ch) ret = (WCHAR *)(ULONG_PTR)str; } while (*str++); + do { if (*str == ch) ret = (WCHAR *)(uintptr_t)str; } while (*str++); return ret; } static inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept ) { - for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)(ULONG_PTR)str; + for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)(uintptr_t)str; return NULL; } @@ -111,7 +111,7 @@ static inline size_t strcspnW( const WCHAR *str, const WCHAR *reject ) static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) { const WCHAR *end; - for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)(ULONG_PTR)ptr; + for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)(uintptr_t)ptr; return NULL; } @@ -119,7 +119,7 @@ static inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n ) { const WCHAR *end; WCHAR *ret = NULL; - for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = (WCHAR *)(ULONG_PTR)ptr; + for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = (WCHAR *)(uintptr_t)ptr; return ret; } diff --git a/libmsi/update.c b/libmsi/update.c index ffec789..5224212 100644 --- a/libmsi/update.c +++ b/libmsi/update.c @@ -44,7 +44,7 @@ typedef struct tagMSIUPDATEVIEW column_info *vals; } MSIUPDATEVIEW; -static UINT UPDATE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned UPDATE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; @@ -53,14 +53,14 @@ static UINT UPDATE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return ERROR_FUNCTION_FAILED; } -static UINT UPDATE_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned UPDATE_execute( MSIVIEW *view, MSIRECORD *record ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; - UINT i, r, col_count = 0, row_count = 0; + unsigned i, r, col_count = 0, row_count = 0; MSIRECORD *values = NULL; MSIRECORD *where = NULL; MSIVIEW *wv; - UINT cols_count, where_count; + unsigned cols_count, where_count; column_info *col = uv->vals; TRACE("%p %p\n", uv, record ); @@ -124,7 +124,7 @@ done: } -static UINT UPDATE_close( MSIVIEW *view ) +static unsigned UPDATE_close( MSIVIEW *view ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; MSIVIEW *wv; @@ -138,7 +138,7 @@ static UINT UPDATE_close( MSIVIEW *view ) return wv->ops->close( wv ); } -static UINT UPDATE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned UPDATE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; MSIVIEW *wv; @@ -152,8 +152,8 @@ static UINT UPDATE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return wv->ops->get_dimensions( wv, rows, cols ); } -static UINT UPDATE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned UPDATE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; MSIVIEW *wv; @@ -167,8 +167,8 @@ static UINT UPDATE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, return wv->ops->get_column_info( wv, n, name, type, temporary, table_name ); } -static UINT UPDATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned UPDATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; @@ -177,7 +177,7 @@ static UINT UPDATE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return ERROR_FUNCTION_FAILED; } -static UINT UPDATE_delete( MSIVIEW *view ) +static unsigned UPDATE_delete( MSIVIEW *view ) { MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view; MSIVIEW *wv; @@ -193,7 +193,7 @@ static UINT UPDATE_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT UPDATE_find_matching_rows( MSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned UPDATE_find_matching_rows( MSIVIEW *view, unsigned col, unsigned val, unsigned *row, MSIITERHANDLE *handle ) { TRACE("%p %d %d %p\n", view, col, val, *handle ); @@ -223,11 +223,11 @@ static const MSIVIEWOPS update_ops = NULL, }; -UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *table, +unsigned UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *table, column_info *columns, struct expr *expr ) { MSIUPDATEVIEW *uv = NULL; - UINT r; + unsigned r; MSIVIEW *sv = NULL, *wv = NULL; TRACE("%p\n", uv ); diff --git a/libmsi/where.c b/libmsi/where.c index 3bc841f..55d1909 100644 --- a/libmsi/where.c +++ b/libmsi/where.c @@ -40,22 +40,22 @@ typedef struct tagMSIROWENTRY { struct tagMSIWHEREVIEW *wv; /* used during sorting */ - UINT values[1]; + unsigned values[1]; } MSIROWENTRY; typedef struct tagJOINTABLE { struct tagJOINTABLE *next; MSIVIEW *view; - UINT col_count; - UINT row_count; - UINT table_index; + unsigned col_count; + unsigned row_count; + unsigned table_index; } JOINTABLE; typedef struct tagMSIORDERINFO { - UINT col_count; - UINT error; + unsigned col_count; + unsigned error; union ext_column columns[1]; } MSIORDERINFO; @@ -64,18 +64,18 @@ typedef struct tagMSIWHEREVIEW MSIVIEW view; MSIDATABASE *db; JOINTABLE *tables; - UINT row_count; - UINT col_count; - UINT table_count; + unsigned row_count; + unsigned col_count; + unsigned table_count; MSIROWENTRY **reorder; - UINT reorder_size; /* number of entries available in reorder */ + unsigned reorder_size; /* number of entries available in reorder */ struct expr *cond; - UINT rec_index; + unsigned rec_index; MSIORDERINFO *order_info; } MSIWHEREVIEW; -static UINT WHERE_evaluate( MSIWHEREVIEW *wv, const UINT rows[], - struct expr *cond, INT *val, MSIRECORD *record ); +static unsigned WHERE_evaluate( MSIWHEREVIEW *wv, const unsigned rows[], + struct expr *cond, int *val, MSIRECORD *record ); #define INITIAL_REORDER_SIZE 16 @@ -83,7 +83,7 @@ static UINT WHERE_evaluate( MSIWHEREVIEW *wv, const UINT rows[], static void free_reorder(MSIWHEREVIEW *wv) { - UINT i; + unsigned i; if (!wv->reorder) return; @@ -97,7 +97,7 @@ static void free_reorder(MSIWHEREVIEW *wv) wv->row_count = 0; } -static UINT init_reorder(MSIWHEREVIEW *wv) +static unsigned init_reorder(MSIWHEREVIEW *wv) { MSIROWENTRY **new = msi_alloc_zero(sizeof(MSIROWENTRY *) * INITIAL_REORDER_SIZE); if (!new) @@ -111,7 +111,7 @@ static UINT init_reorder(MSIWHEREVIEW *wv) return ERROR_SUCCESS; } -static inline UINT find_row(MSIWHEREVIEW *wv, UINT row, UINT *(values[])) +static inline unsigned find_row(MSIWHEREVIEW *wv, unsigned row, unsigned *(values[])) { if (row >= wv->row_count) return ERROR_NO_MORE_ITEMS; @@ -121,14 +121,14 @@ static inline UINT find_row(MSIWHEREVIEW *wv, UINT row, UINT *(values[])) return ERROR_SUCCESS; } -static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) +static unsigned add_row(MSIWHEREVIEW *wv, unsigned vals[]) { MSIROWENTRY *new; if (wv->reorder_size <= wv->row_count) { MSIROWENTRY **new_reorder; - UINT newsize = wv->reorder_size * 2; + unsigned newsize = wv->reorder_size * 2; new_reorder = msi_realloc_zero(wv->reorder, sizeof(MSIROWENTRY *) * newsize); if (!new_reorder) @@ -145,13 +145,13 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) wv->reorder[wv->row_count++] = new; - memcpy(new->values, vals, wv->table_count * sizeof(UINT)); + memcpy(new->values, vals, wv->table_count * sizeof(unsigned)); new->wv = wv; return ERROR_SUCCESS; } -static JOINTABLE *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col) +static JOINTABLE *find_table(MSIWHEREVIEW *wv, unsigned col, unsigned *table_col) { JOINTABLE *table = wv->tables; @@ -169,11 +169,11 @@ static JOINTABLE *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col) return table; } -static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, - UINT *column_type) +static unsigned parse_column(MSIWHEREVIEW *wv, union ext_column *column, + unsigned *column_type) { JOINTABLE *table = wv->tables; - UINT i, r; + unsigned i, r; do { @@ -211,12 +211,12 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, return ERROR_BAD_QUERY_SYNTAX; } -static UINT WHERE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) +static unsigned WHERE_fetch_int( MSIVIEW *view, unsigned row, unsigned col, unsigned *val ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table; - UINT *rows; - UINT r; + unsigned *rows; + unsigned r; TRACE("%p %d %d %p\n", wv, row, col, val ); @@ -234,12 +234,12 @@ static UINT WHERE_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val ) return table->view->ops->fetch_int(table->view, rows[table->table_index], col, val); } -static UINT WHERE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm ) +static unsigned WHERE_fetch_stream( MSIVIEW *view, unsigned row, unsigned col, IStream **stm ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table; - UINT *rows; - UINT r; + unsigned *rows; + unsigned r; TRACE("%p %d %d %p\n", wv, row, col, stm ); @@ -257,7 +257,7 @@ static UINT WHERE_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm return table->view->ops->fetch_stream( table->view, rows[table->table_index], col, stm ); } -static UINT WHERE_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) +static unsigned WHERE_get_row( MSIVIEW *view, unsigned row, MSIRECORD **rec ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; @@ -269,13 +269,13 @@ static UINT WHERE_get_row( MSIVIEW *view, UINT row, MSIRECORD **rec ) return msi_view_get_row( wv->db, view, row, rec ); } -static UINT WHERE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) +static unsigned WHERE_set_row( MSIVIEW *view, unsigned row, MSIRECORD *rec, unsigned mask ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - UINT i, r, offset = 0; + unsigned i, r, offset = 0; JOINTABLE *table = wv->tables; - UINT *rows; - UINT mask_copy = mask; + unsigned *rows; + unsigned mask_copy = mask; TRACE("%p %d %p %08x\n", wv, row, rec, mask ); @@ -292,7 +292,7 @@ static UINT WHERE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) do { for (i = 0; i < table->col_count; i++) { - UINT type; + unsigned type; if (!(mask_copy & (1 << i))) continue; @@ -311,10 +311,10 @@ static UINT WHERE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) do { - const UINT col_count = table->col_count; - UINT i; + const unsigned col_count = table->col_count; + unsigned i; MSIRECORD *reduced; - UINT reduced_mask = (mask >> offset) & ((1 << col_count) - 1); + unsigned reduced_mask = (mask >> offset) & ((1 << col_count) - 1); if (!reduced_mask) { @@ -344,11 +344,11 @@ static UINT WHERE_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) return r; } -static UINT WHERE_delete_row(MSIVIEW *view, UINT row) +static unsigned WHERE_delete_row(MSIVIEW *view, unsigned row) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; - UINT r; - UINT *rows; + unsigned r; + unsigned *rows; TRACE("(%p %d)\n", view, row); @@ -365,11 +365,11 @@ static UINT WHERE_delete_row(MSIVIEW *view, UINT row) return wv->tables->view->ops->delete_row(wv->tables->view, rows[0]); } -static INT INT_evaluate_binary( MSIWHEREVIEW *wv, const UINT rows[], - const struct complex_expr *expr, INT *val, MSIRECORD *record ) +static int INT_evaluate_binary( MSIWHEREVIEW *wv, const unsigned rows[], + const struct complex_expr *expr, int *val, MSIRECORD *record ) { - UINT rl, rr; - INT lval, rval; + unsigned rl, rr; + int lval, rval; rl = WHERE_evaluate(wv, rows, expr->left, &lval, record); if (rl != ERROR_SUCCESS && rl != ERROR_CONTINUE) @@ -441,7 +441,7 @@ static INT INT_evaluate_binary( MSIWHEREVIEW *wv, const UINT rows[], return ERROR_SUCCESS; } -static inline UINT expr_fetch_value(const union ext_column *expr, const UINT rows[], UINT *val) +static inline unsigned expr_fetch_value(const union ext_column *expr, const unsigned rows[], unsigned *val) { JOINTABLE *table = expr->parsed.table; @@ -455,11 +455,11 @@ static inline UINT expr_fetch_value(const union ext_column *expr, const UINT row } -static UINT INT_evaluate_unary( MSIWHEREVIEW *wv, const UINT rows[], - const struct complex_expr *expr, INT *val, MSIRECORD *record ) +static unsigned INT_evaluate_unary( MSIWHEREVIEW *wv, const unsigned rows[], + const struct complex_expr *expr, int *val, MSIRECORD *record ) { - UINT r; - UINT lval; + unsigned r; + unsigned lval; r = expr_fetch_value(&expr->left->u.column, rows, &lval); if(r != ERROR_SUCCESS) @@ -480,12 +480,12 @@ static UINT INT_evaluate_unary( MSIWHEREVIEW *wv, const UINT rows[], return ERROR_SUCCESS; } -static UINT STRING_evaluate( MSIWHEREVIEW *wv, const UINT rows[], +static unsigned STRING_evaluate( MSIWHEREVIEW *wv, const unsigned rows[], const struct expr *expr, const MSIRECORD *record, const WCHAR **str ) { - UINT val = 0, r = ERROR_SUCCESS; + unsigned val = 0, r = ERROR_SUCCESS; switch( expr->type ) { @@ -514,12 +514,12 @@ static UINT STRING_evaluate( MSIWHEREVIEW *wv, const UINT rows[], return r; } -static UINT STRCMP_Evaluate( MSIWHEREVIEW *wv, const UINT rows[], const struct complex_expr *expr, - INT *val, const MSIRECORD *record ) +static unsigned STRCMP_Evaluate( MSIWHEREVIEW *wv, const unsigned rows[], const struct complex_expr *expr, + int *val, const MSIRECORD *record ) { int sr; const WCHAR *l_str, *r_str; - UINT r; + unsigned r; *val = TRUE; r = STRING_evaluate(wv, rows, expr->left, record, &l_str); @@ -545,10 +545,10 @@ static UINT STRCMP_Evaluate( MSIWHEREVIEW *wv, const UINT rows[], const struct c return ERROR_SUCCESS; } -static UINT WHERE_evaluate( MSIWHEREVIEW *wv, const UINT rows[], - struct expr *cond, INT *val, MSIRECORD *record ) +static unsigned WHERE_evaluate( MSIWHEREVIEW *wv, const unsigned rows[], + struct expr *cond, int *val, MSIRECORD *record ) { - UINT r, tval; + unsigned r, tval; if( !cond ) { @@ -597,11 +597,11 @@ static UINT WHERE_evaluate( MSIWHEREVIEW *wv, const UINT rows[], return ERROR_SUCCESS; } -static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **tables, - UINT table_rows[] ) +static unsigned check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **tables, + unsigned table_rows[] ) { - UINT r = ERROR_FUNCTION_FAILED; - INT val; + unsigned r = ERROR_FUNCTION_FAILED; + int val; for (table_rows[(*tables)->table_index] = 0; table_rows[(*tables)->table_index] < (*tables)->row_count; @@ -638,7 +638,7 @@ static int compare_entry( const void *left, const void *right ) const MSIROWENTRY *re = *(const MSIROWENTRY**)right; const MSIWHEREVIEW *wv = le->wv; MSIORDERINFO *order = wv->order_info; - UINT i, j, r, l_val, r_val; + unsigned i, j, r, l_val, r_val; assert(le->wv == re->wv); @@ -698,10 +698,10 @@ static BOOL in_array( JOINTABLE **array, JOINTABLE *elem ) #define JOIN_TO_CONST_EXPR 0x10000 /* comparison to a table involved with a CONST_EXPR comaprison */ -static UINT reorder_check( const struct expr *expr, JOINTABLE **ordered_tables, +static unsigned reorder_check( const struct expr *expr, JOINTABLE **ordered_tables, BOOL process_joins, JOINTABLE **lastused ) { - UINT res = 0; + unsigned res = 0; switch (expr->type) { @@ -761,12 +761,12 @@ static JOINTABLE **ordertables( MSIWHEREVIEW *wv ) return tables; } -static UINT WHERE_execute( MSIVIEW *view, MSIRECORD *record ) +static unsigned WHERE_execute( MSIVIEW *view, MSIRECORD *record ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - UINT r; + unsigned r; JOINTABLE *table = wv->tables; - UINT *rows; + unsigned *rows; JOINTABLE **ordered_tables; int i = 0; @@ -817,7 +817,7 @@ static UINT WHERE_execute( MSIVIEW *view, MSIRECORD *record ) return r; } -static UINT WHERE_close( MSIVIEW *view ) +static unsigned WHERE_close( MSIVIEW *view ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table = wv->tables; @@ -834,7 +834,7 @@ static UINT WHERE_close( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT WHERE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) +static unsigned WHERE_get_dimensions( MSIVIEW *view, unsigned *rows, unsigned *cols ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; @@ -856,8 +856,8 @@ static UINT WHERE_get_dimensions( MSIVIEW *view, UINT *rows, UINT *cols ) return ERROR_SUCCESS; } -static UINT WHERE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, - UINT *type, BOOL *temporary, const WCHAR **table_name ) +static unsigned WHERE_get_column_info( MSIVIEW *view, unsigned n, const WCHAR **name, + unsigned *type, BOOL *temporary, const WCHAR **table_name ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table; @@ -875,10 +875,10 @@ static UINT WHERE_get_column_info( MSIVIEW *view, UINT n, const WCHAR **name, type, temporary, table_name); } -static UINT join_find_row( MSIWHEREVIEW *wv, MSIRECORD *rec, UINT *row ) +static unsigned join_find_row( MSIWHEREVIEW *wv, MSIRECORD *rec, unsigned *row ) { const WCHAR *str; - UINT r, i, id, data; + unsigned r, i, id, data; str = MSI_RecordGetString( rec, 1 ); r = msi_string2idW( wv->db->strings, str, &id ); @@ -899,10 +899,10 @@ static UINT join_find_row( MSIWHEREVIEW *wv, MSIRECORD *rec, UINT *row ) return ERROR_FUNCTION_FAILED; } -static UINT join_modify_update( MSIVIEW *view, MSIRECORD *rec ) +static unsigned join_modify_update( MSIVIEW *view, MSIRECORD *rec ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; - UINT r, row, i, mask = 0; + unsigned r, row, i, mask = 0; MSIRECORD *current; @@ -926,12 +926,12 @@ static UINT join_modify_update( MSIVIEW *view, MSIRECORD *rec ) return WHERE_set_row( view, row, rec, mask ); } -static UINT WHERE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, - MSIRECORD *rec, UINT row ) +static unsigned WHERE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, + MSIRECORD *rec, unsigned row ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table = wv->tables; - UINT r; + unsigned r; TRACE("%p %d %p\n", wv, eModifyMode, rec); @@ -940,7 +940,7 @@ static UINT WHERE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, if (!table->next) { - UINT *rows; + unsigned *rows; if (find_row(wv, row - 1, &rows) == ERROR_SUCCESS) row = rows[0] + 1; @@ -982,7 +982,7 @@ static UINT WHERE_modify( MSIVIEW *view, MSIMODIFY eModifyMode, return r; } -static UINT WHERE_delete( MSIVIEW *view ) +static unsigned WHERE_delete( MSIVIEW *view ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; JOINTABLE *table = wv->tables; @@ -1013,11 +1013,11 @@ static UINT WHERE_delete( MSIVIEW *view ) return ERROR_SUCCESS; } -static UINT WHERE_find_matching_rows( MSIVIEW *view, UINT col, - UINT val, UINT *row, MSIITERHANDLE *handle ) +static unsigned WHERE_find_matching_rows( MSIVIEW *view, unsigned col, + unsigned val, unsigned *row, MSIITERHANDLE *handle ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - UINT i, row_value; + unsigned i, row_value; TRACE("%p, %d, %u, %p\n", view, col, val, *handle); @@ -1043,13 +1043,13 @@ static UINT WHERE_find_matching_rows( MSIVIEW *view, UINT col, return ERROR_NO_MORE_ITEMS; } -static UINT WHERE_sort(MSIVIEW *view, column_info *columns) +static unsigned WHERE_sort(MSIVIEW *view, column_info *columns) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; JOINTABLE *table = wv->tables; column_info *column = columns; MSIORDERINFO *orderinfo; - UINT r, count = 0; + unsigned r, count = 0; int i; TRACE("%p %p\n", view, columns); @@ -1115,16 +1115,16 @@ static const MSIVIEWOPS where_ops = NULL, }; -static UINT WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, - UINT *valid ) +static unsigned WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, + unsigned *valid ) { - UINT r; + unsigned r; switch( cond->type ) { case EXPR_COLUMN: { - UINT type; + unsigned type; *valid = FALSE; @@ -1204,11 +1204,11 @@ static UINT WHERE_VerifyCondition( MSIWHEREVIEW *wv, struct expr *cond, return ERROR_SUCCESS; } -UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *tables, +unsigned WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, WCHAR *tables, struct expr *cond ) { MSIWHEREVIEW *wv = NULL; - UINT r, valid = 0; + unsigned r, valid = 0; WCHAR *ptr; TRACE("(%s)\n", debugstr_w(tables) ); diff --git a/tests/testdatabase.c b/tests/testdatabase.c index 66f751e..27483be 100644 --- a/tests/testdatabase.c +++ b/tests/testdatabase.c @@ -38,7 +38,7 @@ static void test_msidatabase(void) { MSIOBJECT *hdb = 0; MSIOBJECT *hdb2 = 0; - UINT res; + unsigned res; DeleteFile(msifile); @@ -143,10 +143,10 @@ static void test_msidatabase(void) ok( res == TRUE, "Failed to delete database\n" ); } -static UINT do_query(MSIOBJECT *hdb, const char *query, MSIOBJECT **phrec) +static unsigned do_query(MSIOBJECT *hdb, const char *query, MSIOBJECT **phrec) { MSIOBJECT *hview = 0; - UINT r, ret; + unsigned r, ret; if (phrec) *phrec = 0; @@ -168,10 +168,10 @@ static UINT do_query(MSIOBJECT *hdb, const char *query, MSIOBJECT **phrec) return ret; } -static UINT run_query( MSIOBJECT *hdb, MSIOBJECT *hrec, const char *query ) +static unsigned run_query( MSIOBJECT *hdb, MSIOBJECT *hrec, const char *query ) { MSIOBJECT *hview = 0; - UINT r; + unsigned r; r = MsiDatabaseOpenView(hdb, query, &hview); if( r != ERROR_SUCCESS ) @@ -184,10 +184,10 @@ static UINT run_query( MSIOBJECT *hdb, MSIOBJECT *hrec, const char *query ) return r; } -static UINT run_queryW( MSIOBJECT *hdb, MSIOBJECT *hrec, const WCHAR *query ) +static unsigned run_queryW( MSIOBJECT *hdb, MSIOBJECT *hrec, const WCHAR *query ) { MSIOBJECT *hview = 0; - UINT r; + unsigned r; r = MsiDatabaseOpenViewW(hdb, query, &hview); if( r != ERROR_SUCCESS ) @@ -200,7 +200,7 @@ static UINT run_queryW( MSIOBJECT *hdb, MSIOBJECT *hrec, const WCHAR *query ) return r; } -static UINT create_component_table( MSIOBJECT *hdb ) +static unsigned create_component_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `Component` ( " @@ -213,7 +213,7 @@ static UINT create_component_table( MSIOBJECT *hdb ) "PRIMARY KEY `Component`)" ); } -static UINT create_custom_action_table( MSIOBJECT *hdb ) +static unsigned create_custom_action_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `CustomAction` ( " @@ -224,7 +224,7 @@ static UINT create_custom_action_table( MSIOBJECT *hdb ) "PRIMARY KEY `Action`)" ); } -static UINT create_directory_table( MSIOBJECT *hdb ) +static unsigned create_directory_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `Directory` ( " @@ -234,7 +234,7 @@ static UINT create_directory_table( MSIOBJECT *hdb ) "PRIMARY KEY `Directory`)" ); } -static UINT create_feature_components_table( MSIOBJECT *hdb ) +static unsigned create_feature_components_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `FeatureComponents` ( " @@ -243,7 +243,7 @@ static UINT create_feature_components_table( MSIOBJECT *hdb ) "PRIMARY KEY `Feature_`, `Component_` )" ); } -static UINT create_std_dlls_table( MSIOBJECT *hdb ) +static unsigned create_std_dlls_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `StdDlls` ( " @@ -252,7 +252,7 @@ static UINT create_std_dlls_table( MSIOBJECT *hdb ) "PRIMARY KEY `File` )" ); } -static UINT create_binary_table( MSIOBJECT *hdb ) +static unsigned create_binary_table( MSIOBJECT *hdb ) { return run_query( hdb, 0, "CREATE TABLE `Binary` ( " @@ -262,11 +262,11 @@ static UINT create_binary_table( MSIOBJECT *hdb ) } #define make_add_entry(type, qtext) \ - static UINT add##_##type##_##entry( MSIOBJECT *hdb, const char *values ) \ + static unsigned add##_##type##_##entry( MSIOBJECT *hdb, const char *values ) \ { \ char insert[] = qtext; \ char *query; \ - UINT sz, r; \ + unsigned sz, r; \ sz = strlen(values) + sizeof insert; \ query = HeapAlloc(GetProcessHeap(),0,sz); \ sprintf(query,insert,values); \ @@ -300,10 +300,10 @@ static void test_msiinsert(void) MSIOBJECT *hview = 0; MSIOBJECT *hview2 = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; const char *query; char buf[80]; - DWORD sz; + unsigned sz; DeleteFile(msifile); @@ -455,15 +455,15 @@ static void test_msiinsert(void) ok(r == TRUE, "file didn't exist after commit\n"); } -static UINT try_query_param( MSIOBJECT *hdb, const CHAR *szQuery, MSIOBJECT *hrec ) +static unsigned try_query_param( MSIOBJECT *hdb, const CHAR *szQuery, MSIOBJECT *hrec ) { MSIOBJECT *htab = 0; - UINT res; + unsigned res; res = MsiDatabaseOpenView( hdb, szQuery, &htab ); if(res == ERROR_SUCCESS ) { - UINT r; + unsigned r; r = MsiViewExecute( htab, hrec ); if(r != ERROR_SUCCESS ) @@ -480,15 +480,15 @@ static UINT try_query_param( MSIOBJECT *hdb, const CHAR *szQuery, MSIOBJECT *hre return res; } -static UINT try_query( MSIOBJECT *hdb, const CHAR *szQuery ) +static unsigned try_query( MSIOBJECT *hdb, const CHAR *szQuery ) { return try_query_param( hdb, szQuery, 0 ); } -static UINT try_insert_query( MSIOBJECT *hdb, const CHAR *szQuery ) +static unsigned try_insert_query( MSIOBJECT *hdb, const CHAR *szQuery ) { MSIOBJECT *hrec = 0; - UINT r; + unsigned r; hrec = MsiCreateRecord( 1 ); MsiRecordSetString( hrec, 1, "Hello"); @@ -502,7 +502,7 @@ static UINT try_insert_query( MSIOBJECT *hdb, const CHAR *szQuery ) static void test_msibadqueries(void) { MSIOBJECT *hdb = 0; - UINT r; + unsigned r; DeleteFile(msifile); @@ -723,11 +723,11 @@ static void test_viewmodify(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; MSIDBERROR err; const char *query; char buffer[0x100]; - DWORD sz; + unsigned sz; DeleteFile(msifile); @@ -1073,7 +1073,7 @@ static void test_viewmodify(void) static MSIOBJECT *create_db(void) { MSIOBJECT *hdb = 0; - UINT res; + unsigned res; DeleteFile(msifile); @@ -1094,8 +1094,8 @@ static void test_getcolinfo(void) MSIOBJECT *hdb; MSIOBJECT *hview = 0; MSIOBJECT *rec = 0; - UINT r; - DWORD sz; + unsigned r; + unsigned sz; char buffer[0x20]; /* create an empty db */ @@ -1155,7 +1155,7 @@ static MSIOBJECT *get_column_info(MSIOBJECT *hdb, const char *query, MSICOLINFO { MSIOBJECT *hview = 0; MSIOBJECT *rec = 0; - UINT r; + unsigned r; r = MsiDatabaseOpenView(hdb, query, &hview); if( r != ERROR_SUCCESS ) @@ -1171,11 +1171,11 @@ static MSIOBJECT *get_column_info(MSIOBJECT *hdb, const char *query, MSICOLINFO return rec; } -static UINT get_columns_table_type(MSIOBJECT *hdb, const char *table, UINT field) +static unsigned get_columns_table_type(MSIOBJECT *hdb, const char *table, unsigned field) { MSIOBJECT *hview = 0; MSIOBJECT *rec = 0; - UINT r, type = 0; + unsigned r, type = 0; char query[0x100]; sprintf(query, "select * from `_Columns` where `Table` = '%s'", table ); @@ -1203,11 +1203,11 @@ static UINT get_columns_table_type(MSIOBJECT *hdb, const char *table, UINT field return type; } -static BOOL check_record( MSIOBJECT *rec, UINT field, const CHAR *val ) +static BOOL check_record( MSIOBJECT *rec, unsigned field, const CHAR *val ) { CHAR buffer[0x20]; - UINT r; - DWORD sz; + unsigned r; + unsigned sz; sz = sizeof buffer; r = MsiRecordGetString( rec, field, buffer, &sz ); @@ -1218,7 +1218,7 @@ static void test_viewgetcolumninfo(void) { MSIOBJECT *hdb = 0; MSIOBJECT *rec; - UINT r; + unsigned r; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -1325,13 +1325,13 @@ static void test_msiexport(void) { MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; - UINT r; + unsigned r; const char *query; char path[MAX_PATH]; const char file[] = "phone.txt"; HANDLE handle; char buffer[0x100]; - DWORD length; + unsigned length; const char expected[] = "id\tname\tnumber\r\n" "I2\tS32\tS32\r\n" @@ -1405,9 +1405,9 @@ static void test_longstrings(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - DWORD len; - UINT r; - const DWORD STRING_LENGTH = 0x10005; + unsigned len; + unsigned r; + const unsigned STRING_LENGTH = 0x10005; DeleteFile(msifile); /* just MsiOpenDatabase should not create a file */ @@ -1458,10 +1458,10 @@ static void test_longstrings(void) DeleteFile(msifile); } -static void create_file_data(const CHAR *name, const CHAR *data, DWORD size) +static void create_file_data(const CHAR *name, const CHAR *data, unsigned size) { HANDLE file; - DWORD written; + unsigned written; file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if (file == INVALID_HANDLE_VALUE) @@ -1489,8 +1489,8 @@ static void test_streamtable(void) MSIOBJECT *hsi; char file[MAX_PATH]; char buf[MAX_PATH]; - DWORD size; - UINT r; + unsigned size; + unsigned r; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -1727,9 +1727,9 @@ static void test_binary(void) MSIOBJECT *rec; char file[MAX_PATH]; char buf[MAX_PATH]; - DWORD size; + unsigned size; const CHAR *query; - UINT r; + unsigned r; /* insert a file into the Binary table */ r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb ); @@ -1811,7 +1811,7 @@ static void test_where_not_in_selected(void) MSIOBJECT *rec; MSIOBJECT *view; const CHAR *query; - UINT r; + unsigned r; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -1910,10 +1910,10 @@ static void test_where(void) MSIOBJECT *rec; MSIOBJECT *view; const CHAR *query; - UINT r; - DWORD size; + unsigned r; + unsigned size; CHAR buf[MAX_PATH]; - UINT count; + unsigned count; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -2099,7 +2099,7 @@ static const CHAR suminfo[] = "PropertyId\tValue\n" static void write_file(const CHAR *filename, const char *data, int data_size) { - DWORD size; + unsigned size; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); @@ -2108,9 +2108,9 @@ static void write_file(const CHAR *filename, const char *data, int data_size) CloseHandle(hf); } -static UINT add_table_to_db(MSIOBJECT *hdb, const CHAR *table_data) +static unsigned add_table_to_db(MSIOBJECT *hdb, const CHAR *table_data) { - UINT r; + unsigned r; write_file("temp_file", table_data, (lstrlen(table_data) - 1) * sizeof(char)); r = MsiDatabaseImportA(hdb, CURR_DIR, "temp_file"); @@ -2125,9 +2125,9 @@ static void test_suminfo_import(void) MSIOBJECT *hsi; MSIOBJECT *view = 0; const CHAR *query; - UINT r, count, size, type; + unsigned r, count, size, type; char str_value[50]; - INT int_value; + int int_value; FILETIME ft_value; GetCurrentDirectoryA(MAX_PATH, CURR_DIR); @@ -2250,7 +2250,7 @@ static void test_msiimport(void) MSIOBJECT *view; MSIOBJECT *rec; const CHAR *query; - UINT r, count; + unsigned r, count; signed int i; GetCurrentDirectoryA(MAX_PATH, CURR_DIR); @@ -2472,9 +2472,9 @@ static void test_binary_import(void) char file[MAX_PATH]; char buf[MAX_PATH]; char path[MAX_PATH]; - DWORD size; + unsigned size; const CHAR *query; - UINT r; + unsigned r; /* create files to import */ write_file("bin_import.idt", bin_import_dat, @@ -2523,7 +2523,7 @@ static void test_markers(void) MSIOBJECT *hdb; MSIOBJECT *rec; const CHAR *query; - UINT r; + unsigned r; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -2709,7 +2709,7 @@ static void test_handle_limit(void) int i; MSIOBJECT *hdb; MSIOBJECT *hviews[MY_NVIEWS]; - UINT r; + unsigned r; /* create an empty db */ hdb = create_db(); @@ -2812,7 +2812,7 @@ static const WCHAR data9[] = { /* Property */ static const struct { const WCHAR *name; const void *data; - DWORD size; + unsigned size; } table_transform_data[] = { { name1, data1, sizeof data1 }, @@ -2834,8 +2834,8 @@ static void generate_transform_manual(void) IStream *stm; WCHAR name[0x20]; HRESULT r; - DWORD i, count; - const DWORD mode = STGM_CREATE|STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE; + unsigned i, count; + const unsigned mode = STGM_CREATE|STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE; const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}}; @@ -2869,9 +2869,9 @@ static void generate_transform_manual(void) IStorage_Release(stg); } -static UINT set_summary_info(MSIOBJECT *hdb) +static unsigned set_summary_info(MSIOBJECT *hdb) { - UINT res; + unsigned res; MSIOBJECT *suminfo; /* build summary info */ @@ -2916,7 +2916,7 @@ static UINT set_summary_info(MSIOBJECT *hdb) static MSIOBJECT *create_package_db(const CHAR *filename) { MSIOBJECT *hdb = 0; - UINT res; + unsigned res; DeleteFile(msifile); @@ -2945,8 +2945,8 @@ static void test_try_transform(void) MSIOBJECT *hrec; MSIOBJECT *hpkg = 0; const CHAR *query; - UINT r; - DWORD sz; + unsigned r; + unsigned sz; char buffer[MAX_PATH]; DeleteFile(msifile); @@ -3148,12 +3148,12 @@ struct join_res_4col struct join_res_uint { - UINT one; - UINT two; - UINT three; - UINT four; - UINT five; - UINT six; + unsigned one; + unsigned two; + unsigned three; + unsigned four; + unsigned five; + unsigned six; }; static const struct join_res join_res_first[] = @@ -3231,8 +3231,8 @@ static void test_join(void) MSIOBJECT *hrec; const CHAR *query; CHAR buf[MAX_PATH]; - UINT r, count; - DWORD size, i; + unsigned r, count; + unsigned size, i; BOOL data_correct; hdb = create_db(); @@ -3870,9 +3870,9 @@ static void test_temporary_table(void) MSIOBJECT *view = 0; MSIOBJECT *rec; const char *query; - UINT r; + unsigned r; char buf[0x10]; - DWORD sz; + unsigned sz; cond = MsiDatabaseIsTablePersistent(0, NULL); ok( cond == MSICONDITION_ERROR, "wrong return condition\n"); @@ -3996,7 +3996,7 @@ static void test_alter(void) MSICONDITION cond; MSIOBJECT *hdb = 0; const char *query; - UINT r; + unsigned r; hdb = create_db(); ok( hdb, "failed to create db\n"); @@ -4173,9 +4173,9 @@ static void test_integers(void) MSIOBJECT *hdb = 0; MSIOBJECT *view = 0; MSIOBJECT *rec = 0; - DWORD count, i; + unsigned count, i; const char *query; - UINT r; + unsigned r; /* just MsiOpenDatabase should not create a file */ r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); @@ -4308,8 +4308,8 @@ static void test_update(void) MSIOBJECT *rec = 0; CHAR result[MAX_PATH]; const char *query; - DWORD size; - UINT r; + unsigned size; + unsigned r; /* just MsiOpenDatabase should not create a file */ r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); @@ -4626,7 +4626,7 @@ static void test_special_tables(void) { const char *query; MSIOBJECT *hdb = 0; - UINT r; + unsigned r; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); @@ -4666,9 +4666,9 @@ static void test_tables_order(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; char buffer[100]; - DWORD sz; + unsigned sz; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); @@ -4822,9 +4822,9 @@ static void test_rows_order(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; char buffer[100]; - DWORD sz; + unsigned sz; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); @@ -4988,10 +4988,10 @@ static void test_collation(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; char buffer[100]; WCHAR bufferW[100]; - DWORD sz; + unsigned sz; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n"); @@ -5129,8 +5129,8 @@ static void test_select_markers(void) MSIOBJECT *view; MSIOBJECT *res; const CHAR *query; - UINT r; - DWORD size; + unsigned r; + unsigned size; CHAR buf[MAX_PATH]; hdb = create_db(); @@ -5273,9 +5273,9 @@ static void test_viewmodify_update(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT i, test_max, offset, count; + unsigned i, test_max, offset, count; const char *query; - UINT r; + unsigned r; DeleteFile(msifile); @@ -5479,7 +5479,7 @@ static void test_viewmodify_update(void) count = 0; while (MsiViewFetch( hview, &hrec ) == ERROR_SUCCESS) { - UINT b = MsiRecordGetInteger( hrec, 2 ); + unsigned b = MsiRecordGetInteger( hrec, 2 ); r = MsiRecordSetInteger( hrec, 2, b + offset); ok(r == ERROR_SUCCESS, "Got %d\n", r); @@ -5508,8 +5508,8 @@ static void test_viewmodify_update(void) count = 0; while (MsiViewFetch( hview, &hrec ) == ERROR_SUCCESS) { - UINT a = MsiRecordGetInteger( hrec, 1 ); - UINT b = MsiRecordGetInteger( hrec, 2 ); + unsigned a = MsiRecordGetInteger( hrec, 1 ); + unsigned b = MsiRecordGetInteger( hrec, 2 ); ok( ( test_max - a + offset) == b, "Got (%d, %d), expected (%d, %d)\n", a, b, test_max - a + offset, b); @@ -5534,7 +5534,7 @@ static void test_viewmodify_assign(void) MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; const char *query; - UINT r; + unsigned r; /* setup database */ DeleteFile(msifile); @@ -5692,10 +5692,10 @@ static void test_stringtable(void) const char *query; char buffer[MAX_PATH]; WCHAR data[MAX_PATH]; - DWORD sz, read; - UINT r; + unsigned sz, read; + unsigned r; - static const DWORD mode = STGM_DIRECT | STGM_READ | STGM_SHARE_DENY_WRITE; + static const unsigned mode = STGM_DIRECT | STGM_READ | STGM_SHARE_DENY_WRITE; static const WCHAR stringdata[] = {0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0}; /* _StringData */ static const WCHAR stringpool[] = {0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0}; /* _StringPool */ static const WCHAR moo[] = {0x4840, 0x3e16, 0x4818, 0}; /* MOO */ @@ -5925,10 +5925,10 @@ static void test_viewmodify_delete(void) MSIOBJECT *hdb = 0; MSIOBJECT *hview = 0; MSIOBJECT *hrec = 0; - UINT r; + unsigned r; const char *query; char buffer[0x100]; - DWORD sz; + unsigned sz; DeleteFile(msifile); @@ -6032,7 +6032,7 @@ static const WCHAR data14[] = { /* _StringPool */ static const struct { const WCHAR *name; const void *data; - DWORD size; + unsigned size; } database_table_data[] = { {_Tables, NULL, 0}, @@ -6046,10 +6046,10 @@ static void enum_stream_names(IStorage *stg) IStream *stm; HRESULT hr; STATSTG stat; - ULONG n, count; - BYTE data[MAX_PATH]; - BYTE check[MAX_PATH]; - DWORD sz; + unsigned n, count; + uint8_t data[MAX_PATH]; + uint8_t check[MAX_PATH]; + unsigned sz; memset(check, 'a', MAX_PATH); @@ -6100,7 +6100,7 @@ static void enum_stream_names(IStorage *stg) static void test_defaultdatabase(void) { - UINT r; + unsigned r; HRESULT hr; MSIOBJECT *hdb; IStorage *stg = NULL; @@ -6132,7 +6132,7 @@ static void test_order(void) MSIOBJECT *hrec; CHAR buffer[MAX_PATH]; const CHAR *query; - UINT r, sz; + unsigned r, sz; int val; hdb = create_db(); @@ -6391,7 +6391,7 @@ static void test_viewmodify_delete_temporary(void) MSIOBJECT *hview; MSIOBJECT *hrec; const char *query; - UINT r; + unsigned r; DeleteFile(msifile); @@ -6510,8 +6510,8 @@ static void test_deleterow(void) MSIOBJECT *hrec; const char *query; char buf[MAX_PATH]; - UINT r; - DWORD size; + unsigned r; + unsigned size; DeleteFile(msifile); @@ -6579,8 +6579,8 @@ static void test_quotes(void) MSIOBJECT *hrec; const char *query; char buf[MAX_PATH]; - UINT r; - DWORD size; + unsigned r; + unsigned size; DeleteFile(msifile); @@ -6687,8 +6687,8 @@ static void test_carriagereturn(void) MSIOBJECT *hrec; const char *query; char buf[MAX_PATH]; - UINT r; - DWORD size; + unsigned r; + unsigned size; DeleteFile(msifile); @@ -6875,8 +6875,8 @@ static void test_noquotes(void) MSIOBJECT *hrec; const char *query; char buf[MAX_PATH]; - UINT r; - DWORD size; + unsigned r; + unsigned size; DeleteFile(msifile); @@ -7072,7 +7072,7 @@ static void test_noquotes(void) static void read_file_data(const CHAR *filename, CHAR *buffer) { HANDLE file; - DWORD read; + unsigned read; file = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); ZeroMemory(buffer, MAX_PATH); @@ -7085,7 +7085,7 @@ static void test_forcecodepage(void) MSIOBJECT *hdb; const char *query; char buffer[MAX_PATH]; - UINT r; + unsigned r; DeleteFile(msifile); GetCurrentDirectoryA(MAX_PATH, CURR_DIR); @@ -7157,8 +7157,8 @@ static void test_viewmodify_refresh(void) MSIOBJECT *hrec; const char *query; char buffer[MAX_PATH]; - UINT r; - DWORD size; + unsigned r; + unsigned size; DeleteFile(msifile); @@ -7248,7 +7248,7 @@ static void test_where_viewmodify(void) MSIOBJECT *hview; MSIOBJECT *hrec; const char *query; - UINT r; + unsigned r; DeleteFile(msifile); @@ -7351,7 +7351,7 @@ static BOOL create_storage(const CHAR *name) IStorage *stg; IStream *stm; HRESULT hr; - DWORD count; + unsigned count; BOOL res = FALSE; MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, MAX_PATH); @@ -7388,8 +7388,8 @@ static void test_storages_table(void) WCHAR name[MAX_PATH]; const CHAR *query; HRESULT hr; - DWORD size; - UINT r; + unsigned size; + unsigned r; hdb = create_db(); ok(hdb, "failed to create db\n"); @@ -7508,8 +7508,8 @@ static void test_droptable(void) MSIOBJECT *hrec; CHAR buf[MAX_PATH]; const CHAR *query; - DWORD size; - UINT r; + unsigned size; + unsigned r; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -7730,8 +7730,8 @@ static void test_dbmerge(void) MSIOBJECT *hrec; CHAR buf[MAX_PATH]; const CHAR *query; - DWORD size; - UINT r; + unsigned size; + unsigned r; r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -8358,7 +8358,7 @@ static void test_select_with_tablenames(void) MSIOBJECT *view; MSIOBJECT *rec; const CHAR *query; - UINT r; + unsigned r; int i; int vals[4][2] = { @@ -8429,7 +8429,7 @@ static void test_select_with_tablenames(void) DeleteFileA(msifile); } -static const UINT ordervals[6][3] = +static const unsigned ordervals[6][3] = { { MSI_NULL_INTEGER, 12, 13 }, { 1, 2, 3 }, @@ -8445,7 +8445,7 @@ static void test_insertorder(void) MSIOBJECT *view; MSIOBJECT *rec; const CHAR *query; - UINT r; + unsigned r; int i; hdb = create_db(); @@ -8586,8 +8586,8 @@ static void test_columnorder(void) MSIOBJECT *rec; char buf[MAX_PATH]; const CHAR *query; - DWORD sz; - UINT r; + unsigned sz; + unsigned r; hdb = create_db(); ok(hdb, "failed to create db\n"); @@ -9082,8 +9082,8 @@ static void test_createtable(void) MSIOBJECT *htab = 0; MSIOBJECT *hrec = 0; const CHAR *query; - UINT res; - DWORD size; + unsigned res; + unsigned size; char buffer[0x20]; hdb = create_db(); @@ -9197,7 +9197,7 @@ static void test_embedded_nulls(void) "s72\tL0\n" "Control\tDialog\n" "LicenseAgreementDlg\ttext\x11\x19text\0text"; - UINT r, sz; + unsigned r, sz; MSIOBJECT *hdb; MSIOBJECT *hrec; char buffer[32]; @@ -9232,7 +9232,7 @@ static void test_select_column_names(void) MSIOBJECT *rec2; MSIOBJECT *view; char buffer[32]; - UINT r, size; + unsigned r, size; DeleteFile(msifile); diff --git a/tests/testrecord.c b/tests/testrecord.c index d9008b4..2ee2c25 100644 --- a/tests/testrecord.c +++ b/tests/testrecord.c @@ -27,9 +27,9 @@ static const char *msifile = "winetest-record.msi"; static BOOL create_temp_file(char *name) { - UINT r; + unsigned r; unsigned char buffer[26], i; - DWORD sz; + unsigned sz; HANDLE handle; r = GetTempFileName(".", "msitest",0,name); @@ -48,8 +48,8 @@ static BOOL create_temp_file(char *name) static void test_msirecord(void) { - DWORD r, sz; - INT i; + unsigned r, sz; + int i; MSIOBJECT *h; char buf[10]; WCHAR bufW[10]; @@ -109,7 +109,7 @@ static void test_msirecord(void) r = MsiRecordIsNull(h,0); ok(r==0, "new record is null after setting an integer\n"); r = MsiRecordDataSize(h,0); - ok(r==sizeof(DWORD), "size of integer record is 4\n"); + ok(r==sizeof(unsigned), "size of integer record is 4\n"); r = MsiRecordSetInteger(h, 0, 1); ok(r == ERROR_SUCCESS, "Failed to set integer at 0 to 1\n"); r = MsiRecordSetInteger(h, 1, 1); @@ -385,8 +385,8 @@ static void test_MsiRecordGetString(void) { MSIOBJECT *rec; CHAR buf[MAX_PATH]; - DWORD sz; - UINT r; + unsigned sz; + unsigned r; rec = MsiCreateRecord(2); ok(rec != 0, "Expected a valid handle\n"); @@ -446,8 +446,8 @@ static void test_MsiRecordGetString(void) static void test_MsiRecordGetInteger(void) { MSIOBJECT *rec; - INT val; - UINT r; + int val; + unsigned r; rec = MsiCreateRecord(1); ok(rec != 0, "Expected a valid handle\n"); @@ -480,8 +480,8 @@ static void test_fieldzero(void) MSIOBJECT *rec; CHAR buf[MAX_PATH]; const CHAR *query; - DWORD sz; - UINT r; + unsigned sz; + unsigned r; rec = MsiCreateRecord(1); ok(rec != 0, "Expected a valid handle\n"); diff --git a/tests/testrecord.ok b/tests/testrecord.ok index 2b9aa76..70b6b8b 100644 --- a/tests/testrecord.ok +++ b/tests/testrecord.ok @@ -20,7 +20,7 @@ ok: sz==0 ok: buf[0]==0 ok: r == ERROR_SUCCESS ok: r==0 -ok: r==sizeof(DWORD) +ok: r==sizeof(unsigned) ok: r == ERROR_SUCCESS ok: r == ERROR_INVALID_PARAMETER ok: r == ERROR_INVALID_PARAMETER diff --git a/tests/testsuminfo.c b/tests/testsuminfo.c index 28f05bd..a816735 100644 --- a/tests/testsuminfo.c +++ b/tests/testsuminfo.c @@ -35,9 +35,9 @@ static void test_suminfo(void) { MSIOBJECT *hdb = 0; MSIOBJECT *hsuminfo; - UINT r, count, type; - DWORD sz; - INT val; + unsigned r, count, type; + unsigned sz; + int val; FILETIME ft; char buf[0x10]; @@ -252,7 +252,7 @@ static const WCHAR tb[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 }; /* _Tab static const WCHAR sd[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */ static const WCHAR sp[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */ -#define LOSE_CONST(x) ((char *)(UINT_PTR)(x)) +#define LOSE_CONST(x) ((char *)(uintptr_t)(x)) static void test_create_database_binary(void) { @@ -262,7 +262,7 @@ static void test_create_database_binary(void) { 0x13a, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46 } }; static const CLSID FMTID_SummaryInformation = { 0xf29f85e0, 0x4ff9, 0x1068, {0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9}}; - DWORD mode = STGM_CREATE | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE; + unsigned mode = STGM_CREATE | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE; IPropertySetStorage *pss = NULL; IPropertyStorage *ps = NULL; IStorage *stg = NULL; @@ -270,7 +270,7 @@ static void test_create_database_binary(void) HRESULT r; PROPSPEC propspec[10]; PROPVARIANT propvar[10]; - USHORT data[2] = { 0, 0 }; + uint16_t data[2] = { 0, 0 }; r = StgCreateDocfile( msifileW, mode, 0, &stg ); ok( r == S_OK, "failed to create database\n"); @@ -365,9 +365,9 @@ static void test_summary_binary(void) { MSIOBJECT *hdb = 0; MSIOBJECT *hsuminfo = 0; - UINT r, type, count; - INT ival; - DWORD sz; + unsigned r, type, count; + int ival; + unsigned sz; char sval[20]; DeleteFile( msifile ); -- cgit