Commit b919443a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: The type referred to by the wire_marshal attribute in server.idl must be a pointer.

Therefore, declare the structure as user_bstr_t and make wire_bstr_t be a typedef to a pointer of this type.
parent b06f8820
......@@ -990,27 +990,27 @@ us_t_UserFree(ULONG *flags, us_t *pus)
ULONG __RPC_USER
bstr_t_UserSize(ULONG *flags, ULONG start, bstr_t *b)
{
return start + FIELD_OFFSET(wire_bstr_t, data[(*b)[-1]]);
return start + FIELD_OFFSET(user_bstr_t, data[(*b)[-1]]);
}
unsigned char * __RPC_USER
bstr_t_UserMarshal(ULONG *flags, unsigned char *buffer, bstr_t *b)
{
wire_bstr_t *wb = (wire_bstr_t *) buffer;
wire_bstr_t wb = (wire_bstr_t) buffer;
wb->n = (*b)[-1];
memcpy(&wb->data, *b, wb->n * sizeof wb->data[0]);
return buffer + FIELD_OFFSET(wire_bstr_t, data[wb->n]);
return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
}
unsigned char * __RPC_USER
bstr_t_UserUnmarshal(ULONG *flags, unsigned char *buffer, bstr_t *b)
{
wire_bstr_t *wb = (wire_bstr_t *) buffer;
wire_bstr_t wb = (wire_bstr_t) buffer;
short *data = HeapAlloc(GetProcessHeap(), 0, (wb->n + 1) * sizeof *data);
data[0] = wb->n;
memcpy(&data[1], wb->data, wb->n * sizeof data[1]);
*b = &data[1];
return buffer + FIELD_OFFSET(wire_bstr_t, data[wb->n]);
return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
}
void __RPC_USER
......
......@@ -299,8 +299,9 @@ cpp_quote("#endif")
{
short n;
[size_is(n)] short data[];
} wire_bstr_t;
} user_bstr_t;
typedef [unique] user_bstr_t *wire_bstr_t;
typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
unsigned hash_bstr(bstr_t s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment