Commit 767a1f26 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Handle top-level conformance for complex arrays.

parent dbfabf68
...@@ -357,6 +357,16 @@ s_sum_padded2(padded_t ps[2]) ...@@ -357,6 +357,16 @@ s_sum_padded2(padded_t ps[2])
} }
int int
s_sum_padded_conf(padded_t *ps, int n)
{
int sum = 0;
int i;
for (i = 0; i < n; ++i)
sum += s_sum_padded(&ps[i]);
return sum;
}
int
s_sum_bogus(bogus_t *b) s_sum_bogus(bogus_t *b)
{ {
return *b->h.p1 + *b->p2 + *b->p3 + b->c; return *b->h.p1 + *b->p2 + *b->p3 + b->c;
...@@ -501,6 +511,11 @@ basic_tests(void) ...@@ -501,6 +511,11 @@ basic_tests(void)
padded2[1].i = 3; padded2[1].i = 3;
padded2[1].c = 7; padded2[1].c = 7;
ok(sum_padded2(padded2) == 6, "RPC sum_padded2\n"); ok(sum_padded2(padded2) == 6, "RPC sum_padded2\n");
padded2[0].i = -5;
padded2[0].c = 1;
padded2[1].i = 3;
padded2[1].c = 7;
ok(sum_padded_conf(padded2, 2) == 6, "RPC sum_padded_conf\n");
i1 = 14; i1 = 14;
i2 = -7; i2 = -7;
......
...@@ -208,6 +208,7 @@ interface IServer ...@@ -208,6 +208,7 @@ interface IServer
int sum_padded(padded_t *p); int sum_padded(padded_t *p);
int sum_padded2(padded_t ps[2]); int sum_padded2(padded_t ps[2]);
int sum_padded_conf([size_is(n)] padded_t *ps, int n);
typedef struct typedef struct
{ {
......
...@@ -2580,11 +2580,9 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func, ...@@ -2580,11 +2580,9 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
else if (is_array(type)) else if (is_array(type))
{ {
unsigned char tc = type->type; unsigned char tc = type->type;
const char *array_type; const char *array_type = "FixedArray";
if (tc == RPC_FC_SMFARRAY || tc == RPC_FC_LGFARRAY) if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY)
array_type = "FixedArray";
else if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY)
{ {
if (is_size_needed_for_phase(phase)) if (is_size_needed_for_phase(phase))
{ {
...@@ -2605,22 +2603,28 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func, ...@@ -2605,22 +2603,28 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
} }
array_type = "ConformantArray"; array_type = "ConformantArray";
} }
else if (tc == RPC_FC_CVARRAY) else if (tc == RPC_FC_CVARRAY || tc == RPC_FC_BOGUS_ARRAY)
{ {
if (is_size_needed_for_phase(phase)) if (is_size_needed_for_phase(phase))
{ {
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)"); if (type->size_is)
write_expr(file, type->size_is, 1); {
fprintf(file, ";\n"); print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */ write_expr(file, type->size_is, 1);
print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)"); fprintf(file, ";\n");
write_expr(file, type->length_is, 1); }
fprintf(file, ";\n\n"); if (type->length_is)
{
print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */
print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)");
write_expr(file, type->length_is, 1);
fprintf(file, ";\n\n");
}
} }
array_type = "ConformantVaryingArray"; array_type = (tc == RPC_FC_BOGUS_ARRAY
? "ComplexArray"
: "ConformantVaryingArray");
} }
else
array_type = "ComplexArray";
if (!in_attr && phase == PHASE_FREE) if (!in_attr && phase == PHASE_FREE)
{ {
......
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