https://git.reactos.org/?p=reactos.git;a=commitdiff;h=14478462ccfdaf2933624…
commit 14478462ccfdaf29336243dd5b29dfa3f2456698
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 00:08:18 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:05 2022 +0100
[WINESYNC] msi: Fix the remote case for MsiViewModify(MSIMODIFY_UPDATE).
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45972
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id c494570d89f270c9240519c625c5c757a4e8ff23 by Hans Leidekker
<hans(a)codeweavers.com>
---
dll/win32/msi/msipriv.h | 2 +-
dll/win32/msi/msiquery.c | 4 ++--
dll/win32/msi/record.c | 11 ++++++-----
dll/win32/msi/winemsi.idl | 2 ++
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h
index 05eff8e7271..304dab049e4 100644
--- a/dll/win32/msi/msipriv.h
+++ b/dll/win32/msi/msipriv.h
@@ -141,8 +141,8 @@ typedef struct tagMSIFIELD
typedef struct tagMSIRECORD
{
MSIOBJECTHDR hdr;
- MSIQUERY *query;
UINT count; /* as passed to MsiCreateRecord */
+ UINT64 cookie;
MSIFIELD fields[1]; /* nb. array size is count+1 */
} MSIRECORD;
diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c
index 5c686a37be0..6ecbbcdf63c 100644
--- a/dll/win32/msi/msiquery.c
+++ b/dll/win32/msi/msiquery.c
@@ -379,7 +379,7 @@ UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
if (r == ERROR_SUCCESS)
{
query->row ++;
- (*prec)->query = query;
+ (*prec)->cookie = (UINT64)(ULONG_PTR)query;
MSI_RecordSetInteger(*prec, 0, 1);
}
@@ -693,7 +693,7 @@ UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec
)
if ( !view || !view->ops->modify)
return ERROR_FUNCTION_FAILED;
- if ( mode == MSIMODIFY_UPDATE && rec->query != query )
+ if ( mode == MSIMODIFY_UPDATE && rec->cookie != (UINT64)(ULONG_PTR)query
)
return ERROR_FUNCTION_FAILED;
r = view->ops->modify( view, mode, rec, query->row );
diff --git a/dll/win32/msi/record.c b/dll/win32/msi/record.c
index a7d55888a9d..cca63083d18 100644
--- a/dll/win32/msi/record.c
+++ b/dll/win32/msi/record.c
@@ -1064,6 +1064,7 @@ UINT copy_remote_record(const struct wire_record *in, MSIHANDLE
out)
if (!(rec = msihandle2msiinfo(out, MSIHANDLETYPE_RECORD)))
return ERROR_INVALID_HANDLE;
+ rec->cookie = in->cookie;
for (i = 0; i <= in->count; i++)
{
switch (in->fields[i].type)
@@ -1114,17 +1115,17 @@ UINT unmarshal_record(const struct wire_record *in, MSIHANDLE
*out)
struct wire_record *marshal_record(MSIHANDLE handle)
{
struct wire_record *ret;
- unsigned int i, count;
+ unsigned int i;
MSIRECORD *rec;
if (!(rec = msihandle2msiinfo(handle, MSIHANDLETYPE_RECORD)))
return NULL;
- count = MSI_RecordGetFieldCount(rec);
- ret = midl_user_allocate(sizeof(*ret) + count * sizeof(ret->fields[0]));
- ret->count = count;
+ ret = midl_user_allocate(sizeof(*ret) + rec->count * sizeof(ret->fields[0]));
+ ret->count = rec->count;
+ ret->cookie = rec->cookie;
- for (i = 0; i <= count; i++)
+ for (i = 0; i <= rec->count; i++)
{
switch (rec->fields[i].type)
{
diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl
index ebbca82a16d..16586036949 100644
--- a/dll/win32/msi/winemsi.idl
+++ b/dll/win32/msi/winemsi.idl
@@ -51,8 +51,10 @@ struct wire_field {
int len;
};
+/* compatible with MSIRECORD minus header */
struct wire_record {
unsigned int count;
+ UINT64 cookie;
[size_is(count+1)] struct wire_field fields[];
};