[WINESYNC] msi: Make MsiViewGetColumnInfo() RPC-compatible.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id cea37419f1d16798ca24ad14712f14dac136f7d6 by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2022-03-12 15:11:55 +01:00 committed by Mark Jansen
parent ae286278fc
commit ec581d9fc9
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 42 additions and 2 deletions

View file

@ -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;
}

View file

@ -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 );

View file

@ -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);