[PATCH 2/6] msi: Make MsiViewGetColumnInfo() RPC-compatible.

Zebediah Figura z.figura12 at gmail.com
Thu Apr 19 23:44:14 CDT 2018


Signed-off-by: Zebediah Figura <z.figura12 at 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 );
-- 
2.7.4




More information about the wine-devel mailing list