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@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
965ca1b4de
commit
c494570d89
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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[];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue