Commit 2fa83d94 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Make structures with FC_ENUM16 fields complex.

Structures containing enum fields without the v1_enum attribute must be treated as complex because of the range check and memory/wire size differences. This includes a test which didn't pass before and now passes on Wine and Windows.
parent 629a29d8
...@@ -333,6 +333,12 @@ s_square_encu(encu_t *eu) ...@@ -333,6 +333,12 @@ s_square_encu(encu_t *eu)
} }
} }
void
s_check_se2(se_t *s)
{
ok(s->f == E2, "check_se2\n");
}
int int
s_sum_parr(int *a[3]) s_sum_parr(int *a[3])
{ {
...@@ -705,6 +711,7 @@ basic_tests(void) ...@@ -705,6 +711,7 @@ basic_tests(void)
str_struct_t ss = {string}; str_struct_t ss = {string};
wstr_struct_t ws = {wstring}; wstr_struct_t ws = {wstring};
str_t str; str_t str;
se_t se;
ok(int_return() == INT_CODE, "RPC int_return\n"); ok(int_return() == INT_CODE, "RPC int_return\n");
...@@ -774,6 +781,9 @@ basic_tests(void) ...@@ -774,6 +781,9 @@ basic_tests(void)
ok(enum_ord(E3) == 3, "RPC enum_ord\n"); ok(enum_ord(E3) == 3, "RPC enum_ord\n");
ok(enum_ord(E4) == 4, "RPC enum_ord\n"); ok(enum_ord(E4) == 4, "RPC enum_ord\n");
se.f = E2;
check_se2(&se);
memset(&aligns, 0, sizeof(aligns)); memset(&aligns, 0, sizeof(aligns));
aligns.c = 3; aligns.c = 3;
aligns.i = 4; aligns.i = 4;
......
...@@ -209,11 +209,17 @@ cpp_quote("#endif") ...@@ -209,11 +209,17 @@ cpp_quote("#endif")
case E2: float f2; case E2: float f2;
} encue_t; } encue_t;
typedef struct
{
e_t f;
} se_t;
double square_encu(encu_t *eu); double square_encu(encu_t *eu);
int sum_parr(int *a[3]); int sum_parr(int *a[3]);
int sum_pcarr([size_is(n)] int *a[], int n); int sum_pcarr([size_is(n)] int *a[], int n);
int enum_ord(e_t e); int enum_ord(e_t e);
double square_encue(encue_t *eue); double square_encue(encue_t *eue);
void check_se2(se_t *s);
int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n); int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c); int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
......
...@@ -1856,7 +1856,6 @@ static int get_struct_type(var_list_t *fields) ...@@ -1856,7 +1856,6 @@ static int get_struct_type(var_list_t *fields)
case RPC_FC_FLOAT: case RPC_FC_FLOAT:
case RPC_FC_DOUBLE: case RPC_FC_DOUBLE:
case RPC_FC_STRUCT: case RPC_FC_STRUCT:
case RPC_FC_ENUM16:
case RPC_FC_ENUM32: case RPC_FC_ENUM32:
break; break;
...@@ -1907,6 +1906,7 @@ static int get_struct_type(var_list_t *fields) ...@@ -1907,6 +1906,7 @@ static int get_struct_type(var_list_t *fields)
case RPC_FC_ENCAPSULATED_UNION: case RPC_FC_ENCAPSULATED_UNION:
case RPC_FC_NON_ENCAPSULATED_UNION: case RPC_FC_NON_ENCAPSULATED_UNION:
case RPC_FC_BOGUS_STRUCT: case RPC_FC_BOGUS_STRUCT:
case RPC_FC_ENUM16:
return RPC_FC_BOGUS_STRUCT; return RPC_FC_BOGUS_STRUCT;
} }
} }
......
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