Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/msiquery.c | 16 ++++++++++++++-- dlls/msi/tests/custom.c | 3 +++ dlls/msi/winemsi.idl | 1 + 3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index 6eddf7a..682881e 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -440,8 +440,15 @@ UINT WINAPI MsiViewClose(MSIHANDLE hView) TRACE("%d\n", hView );
query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); - if( !query ) - return ERROR_INVALID_HANDLE; + if (!query) + { + MSIHANDLE remote; + + if (!(remote = msi_get_remote(hView))) + return ERROR_INVALID_HANDLE; + + return remote_ViewClose(remote); + }
ret = MSI_ViewClose( query ); msiobj_release( &query->hdr ); @@ -1055,6 +1062,11 @@ MSICONDITION WINAPI MsiDatabaseIsTablePersistentW( return r; }
+UINT __cdecl remote_ViewClose(MSIHANDLE view) +{ + return MsiViewClose(view); +} + UINT __cdecl remote_ViewExecute(MSIHANDLE view, struct wire_record *remote_rec) { MSIHANDLE rec = 0; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 479cb93..3d7ebb9 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -316,6 +316,9 @@ static void test_db(MSIHANDLE hinst) ok(hinst, r == ERROR_NO_MORE_ITEMS, "got %u\n", r); ok(hinst, !rec2, "got %u\n", rec2);
+ r = MsiViewClose(view); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(view); ok(hinst, !r, "got %u\n", r);
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index b892f34..74b5923 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -56,6 +56,7 @@ struct wire_record { ] interface IWineMsiRemote { + UINT remote_ViewClose( [in] MSIHANDLE view ); UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record ); UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record );
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/msiquery.c | 30 ++++++++++++++++++++++++++++-- dlls/msi/tests/custom.c | 12 ++++++++++++ dlls/msi/winemsi.idl | 2 ++ 3 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index 682881e..e73701f 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -603,8 +603,23 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR return ERROR_INVALID_PARAMETER;
query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); - if( !query ) - return ERROR_INVALID_HANDLE; + if (!query) + { + struct wire_record *wire_rec = NULL; + MSIHANDLE remote; + + if (!(remote = msi_get_remote(hView))) + return ERROR_INVALID_HANDLE; + + r = remote_ViewGetColumnInfo(remote, info, &wire_rec); + if (!r) + { + r = unmarshal_record(wire_rec, hRec); + free_remote_record(wire_rec); + } + + return r; + }
r = MSI_ViewGetColumnInfo( query, info, &rec ); if ( r == ERROR_SUCCESS ) @@ -1091,3 +1106,14 @@ UINT __cdecl remote_ViewFetch(MSIHANDLE view, struct wire_record **rec) MsiCloseHandle(handle); return r; } + +UINT __cdecl remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct wire_record **rec) +{ + MSIHANDLE handle; + UINT r = MsiViewGetColumnInfo(view, info, &handle); + *rec = NULL; + if (!r) + *rec = marshal_record(handle); + MsiCloseHandle(handle); + return r; +} diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 3d7ebb9..d6b186c 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -263,6 +263,18 @@ static void test_db(MSIHANDLE hinst) r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test`", &view); ok(hinst, !r, "got %u\n", r);
+ r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec2); + ok(hinst, !r, "got %u\n", r); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec2, 1, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer); + + r = MsiCloseHandle(rec2); + ok(hinst, !r, "got %u\n", r); + r = MsiViewExecute(view, 0); ok(hinst, !r, "got %u\n", r);
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 74b5923..628091b 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -27,6 +27,7 @@ typedef int INSTALLMESSAGE; typedef int MSICONDITION; typedef int MSIRUNMODE; typedef int INSTALLSTATE; +typedef int MSICOLINFO;
#define MSIFIELD_NULL 0 #define MSIFIELD_INT 1 @@ -59,6 +60,7 @@ interface IWineMsiRemote UINT remote_ViewClose( [in] MSIHANDLE view ); UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record ); UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record ); + UINT remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record );
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys );
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=37849
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This is the simplest solution with regard to memory allocation.
dlls/msi/msipriv.h | 1 + dlls/msi/msiquery.c | 49 +++++++++++++++++++++++++++++++++++++++++++------ dlls/msi/record.c | 31 +++++++++++++++++++------------ dlls/msi/tests/custom.c | 29 +++++++++++++++++++++++++++++ dlls/msi/winemsi.idl | 3 +++ 5 files changed, 95 insertions(+), 18 deletions(-)
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index f386f90..aede960 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -833,6 +833,7 @@ extern void dump_record(MSIRECORD *) DECLSPEC_HIDDEN; extern UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN; extern struct wire_record *marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN; extern void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN; +extern UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle) DECLSPEC_HIDDEN;
/* stream internals */ extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN; diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index e73701f..e3bcfd8 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -666,17 +666,36 @@ UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode,
TRACE("%d %x %d\n", hView, eModifyMode, hRecord);
- query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); - if( !query ) + rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); + + if (!rec) return ERROR_INVALID_HANDLE;
- rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); + query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); + if (!query) + { + struct wire_record *wire_refreshed = NULL; + MSIHANDLE remote; + + if (!(remote = msi_get_remote(hView))) + return ERROR_INVALID_HANDLE; + + r = remote_ViewModify(remote, eModifyMode, + (struct wire_record *)&rec->count, &wire_refreshed); + if (!r && (eModifyMode == MSIMODIFY_REFRESH || eModifyMode == MSIMODIFY_SEEK)) + { + r = copy_remote_record(wire_refreshed, hRecord); + free_remote_record(wire_refreshed); + } + + msiobj_release(&rec->hdr); + return r; + } + r = MSI_ViewModify( query, eModifyMode, rec );
msiobj_release( &query->hdr ); - if( rec ) - msiobj_release( &rec->hdr ); - + msiobj_release(&rec->hdr); return r; }
@@ -1117,3 +1136,21 @@ UINT __cdecl remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct wi MsiCloseHandle(handle); return r; } + +UINT __cdecl remote_ViewModify(MSIHANDLE view, MSIMODIFY mode, + struct wire_record *remote_rec, struct wire_record **remote_refreshed) +{ + MSIHANDLE handle = 0; + UINT r; + + if ((r = unmarshal_record(remote_rec, &handle))) + return r; + + r = MsiViewModify(view, mode, handle); + *remote_refreshed = NULL; + if (!r && (mode == MSIMODIFY_REFRESH || mode == MSIMODIFY_SEEK)) + *remote_refreshed = marshal_record(handle); + + MsiCloseHandle(handle); + return r; +} diff --git a/dlls/msi/record.c b/dlls/msi/record.c index 91892d7..5804046 100644 --- a/dlls/msi/record.c +++ b/dlls/msi/record.c @@ -1055,26 +1055,22 @@ void dump_record(MSIRECORD *rec) TRACE("]\n"); }
-UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) +UINT copy_remote_record(const struct wire_record *in, MSIHANDLE out) { MSIRECORD *rec; unsigned int i; UINT r;
- if (!in) - { - *out = 0; - return ERROR_SUCCESS; - } - - rec = MSI_CreateRecord(in->count); - if (!rec) return ERROR_OUTOFMEMORY; + if (!(rec = msihandle2msiinfo(out, MSIHANDLETYPE_RECORD))) + return ERROR_INVALID_HANDLE;
for (i = 0; i <= in->count; i++) { switch (in->fields[i].type) { case MSIFIELD_NULL: + MSI_FreeField(&rec->fields[i]); + rec->fields[i].type = MSIFIELD_NULL; break; case MSIFIELD_INT: r = MSI_RecordSetInteger(rec, i, in->fields[i].u.iVal); @@ -1097,13 +1093,24 @@ UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) } }
- *out = alloc_msihandle(&rec->hdr); - if (!*out) return ERROR_OUTOFMEMORY; - msiobj_release(&rec->hdr); return ERROR_SUCCESS; }
+UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) +{ + if (!in) + { + *out = 0; + return ERROR_SUCCESS; + } + + *out = MsiCreateRecord(in->count); + if (!*out) return ERROR_OUTOFMEMORY; + + return copy_remote_record(in, *out); +} + struct wire_record *marshal_record(MSIHANDLE handle) { struct wire_record *ret; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index d6b186c..79d90f0 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -321,6 +321,35 @@ static void test_db(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n");
+ r = MsiViewModify(view, MSIMODIFY_REFRESH, 0); + ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r); + + r = MsiRecordSetStringA(rec2, 1, "three"); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordSetInteger(rec2, 2, 3); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordSetInteger(rec2, 3, 3); + ok(hinst, !r, "got %u\n", r); + + r = MsiViewModify(view, MSIMODIFY_REFRESH, rec2); + ok(hinst, !r, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec2, 1, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer); + + r = MsiRecordGetInteger(rec2, 2); + ok(hinst, r == 2, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordReadStream(rec2, 3, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n"); + r = MsiCloseHandle(rec2); ok(hinst, !r, "got %u\n", r);
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 628091b..3fbd6d2 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -28,6 +28,7 @@ typedef int MSICONDITION; typedef int MSIRUNMODE; typedef int INSTALLSTATE; typedef int MSICOLINFO; +typedef int MSIMODIFY;
#define MSIFIELD_NULL 0 #define MSIFIELD_INT 1 @@ -61,6 +62,8 @@ interface IWineMsiRemote UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record ); UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record ); UINT remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record ); + UINT remote_ViewModify( [in] MSIHANDLE view, [in] MSIMODIFY mode, + [in] struct wire_record *record, [out] struct wire_record **refreshed );
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys );
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=37850
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/tests/db.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 3cbb9b3..e2328ab 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -9701,6 +9701,46 @@ static void test_select_column_names(void) ok(r == ERROR_SUCCESS , "failed to close database: %u\n", r); }
+static void test_primary_keys(void) +{ + MSIHANDLE hdb, keys; + UINT r; + + hdb = create_db(); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "T", &keys); + ok(r == ERROR_INVALID_TABLE, "got %u\n", r); + + r = run_query(hdb, 0, "CREATE TABLE `T` (`A` SHORT, `B` SHORT, `C` SHORT PRIMARY KEY `A`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "T", &keys); + ok(!r, "got %u\n", r); + + r = MsiRecordGetFieldCount(keys); + ok(r == 1, "got %d\n", r); + ok(check_record(keys, 0, "T"), "expected 'T'"); + ok(check_record(keys, 1, "A"), "expected 'A'"); + + MsiCloseHandle(keys); + + r = run_query(hdb, 0, "CREATE TABLE `U` (`A` SHORT, `B` SHORT, `C` SHORT PRIMARY KEY `B`, `C`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "U", &keys); + ok(!r, "got %u\n", r); + + r = MsiRecordGetFieldCount(keys); + ok(r == 2, "got %d\n", r); + ok(check_record(keys, 0, "U"), "expected 'U'"); + ok(check_record(keys, 1, "B"), "expected 'B'"); + ok(check_record(keys, 2, "C"), "expected 'C'"); + + MsiCloseHandle(keys); + MsiCloseHandle(hdb); + DeleteFileA(msifile); +} + START_TEST(db) { test_msidatabase(); @@ -9756,4 +9796,5 @@ START_TEST(db) test_collation(); test_embedded_nulls(); test_select_column_names(); + test_primary_keys(); }
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/database.c | 11 ++++++++--- dlls/msi/msiquery.c | 15 ++++++--------- dlls/msi/tests/custom.c | 22 ++++++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c index c1cf493..7c0c4a9 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -1911,10 +1911,15 @@ MSICONDITION __cdecl remote_DatabaseIsTablePersistent(MSIHANDLE db, LPCWSTR tabl return MsiDatabaseIsTablePersistentW(db, table); }
-HRESULT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, MSIHANDLE *keys) +UINT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, struct wire_record **rec) { - UINT r = MsiDatabaseGetPrimaryKeysW(db, table, keys); - return HRESULT_FROM_WIN32(r); + MSIHANDLE handle; + UINT r = MsiDatabaseGetPrimaryKeysW(db, table, &handle); + *rec = NULL; + if (!r) + *rec = marshal_record(handle); + MsiCloseHandle(handle); + return r; }
HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index e3bcfd8..42ee8c7 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -998,23 +998,20 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb, db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE ); if( !db ) { + struct wire_record *wire_rec = NULL; MSIHANDLE remote; - HRESULT hr;
if (!(remote = msi_get_remote(hdb))) return ERROR_INVALID_HANDLE;
- hr = remote_DatabaseGetPrimaryKeys(remote, table, phRec); - - if (FAILED(hr)) + r = remote_DatabaseGetPrimaryKeys(remote, table, &wire_rec); + if (!r) { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; + r = unmarshal_record(wire_rec, phRec); + free_remote_record(wire_rec); }
- return ERROR_SUCCESS; + return r; }
r = MSI_DatabaseGetPrimaryKeys( db, table, &rec ); diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 79d90f0..cdefefd 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -391,6 +391,28 @@ static void test_db(MSIHANDLE hinst) r = MsiCloseHandle(view); ok(hinst, !r, "got %u\n", r);
+ /* test MsiDatabaseGetPrimaryKeys() */ + r = MsiDatabaseGetPrimaryKeysA(hdb, "Test", &rec); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordGetFieldCount(rec); + ok(hinst, r == 1, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec, 0, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "Test"), "got '%s'\n", buffer); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec, 1, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer); + + r = MsiCloseHandle(rec); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(hdb); ok(hinst, !r, "got %u\n", r); } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 3fbd6d2..28c3ab1 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -66,7 +66,7 @@ interface IWineMsiRemote [in] struct wire_record *record, [out] struct wire_record **refreshed );
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); - HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys ); + UINT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in, string] LPCWSTR table, [out] struct wire_record **keys ); HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view );
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=37852
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/database.c | 5 ++--- dlls/msi/suminfo.c | 17 +++++------------ dlls/msi/tests/custom.c | 11 ++++++++++- dlls/msi/winemsi.idl | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c index 7c0c4a9..4a05593 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -1922,10 +1922,9 @@ UINT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, struct w return r; }
-HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) +UINT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) { - UINT r = MsiGetSummaryInformationW(db, NULL, updatecount, suminfo); - return HRESULT_FROM_WIN32(r); + return MsiGetSummaryInformationW(db, NULL, updatecount, suminfo); }
UINT __cdecl remote_DatabaseOpenView(MSIHANDLE db, LPCWSTR query, MSIHANDLE *view) diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c index 782ad6e..288ba40 100644 --- a/dlls/msi/suminfo.c +++ b/dlls/msi/suminfo.c @@ -523,23 +523,16 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE ); if( !db ) { - MSIHANDLE remote; - HRESULT hr; + MSIHANDLE remote, remote_suminfo;
if (!(remote = msi_get_remote(hDatabase))) return ERROR_INVALID_HANDLE;
- hr = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, pHandle); + ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, &remote_suminfo); + if (!ret) + *pHandle = alloc_msi_remote_handle(remote_suminfo);
- if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return ret; } }
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index cdefefd..e782311 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -243,7 +243,7 @@ static void test_props(MSIHANDLE hinst)
static void test_db(MSIHANDLE hinst) { - MSIHANDLE hdb, view, rec, rec2; + MSIHANDLE hdb, view, rec, rec2, suminfo; char buffer[10]; DWORD sz; UINT r; @@ -413,6 +413,15 @@ static void test_db(MSIHANDLE hinst) r = MsiCloseHandle(rec); ok(hinst, !r, "got %u\n", r);
+ r = MsiGetSummaryInformationA(hdb, NULL, 1, NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiGetSummaryInformationA(hdb, NULL, 1, &suminfo); + ok(hinst, !r, "got %u\n", r); + + r = MsiCloseHandle(suminfo); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(hdb); ok(hinst, !r, "got %u\n", r); } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 28c3ab1..7613fd3 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -67,7 +67,7 @@ interface IWineMsiRemote
MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); UINT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in, string] LPCWSTR table, [out] struct wire_record **keys ); - HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); + UINT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view );
MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst );
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=37853
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=37848
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally