widl: iid_is should take expressions, not just identifiers.

This commit is contained in:
Rob Shearman 2007-12-10 13:30:48 +00:00 committed by Alexandre Julliard
parent 72d9569cc4
commit 85e87ae829
3 changed files with 23 additions and 17 deletions

View File

@ -470,7 +470,7 @@ attribute: { $$ = NULL; }
| tHIDDEN { $$ = make_attr(ATTR_HIDDEN); }
| tID '(' expr_const ')' { $$ = make_attrp(ATTR_ID, $3); }
| tIDEMPOTENT { $$ = make_attr(ATTR_IDEMPOTENT); }
| tIIDIS '(' ident ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIIDIS '(' expr ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIMMEDIATEBIND { $$ = make_attr(ATTR_IMMEDIATEBIND); }
| tIMPLICITHANDLE '(' tHANDLET aIDENTIFIER ')' { $$ = make_attrp(ATTR_IMPLICIT_HANDLE, $4); }
| tIN { $$ = make_attr(ATTR_IN); }

View File

@ -188,7 +188,7 @@ static void proxy_check_pointers( const var_list_t *args )
static void free_variable( const var_t *arg )
{
unsigned int type_offset = arg->type->typestring_offset;
var_t *constraint;
expr_t *iid;
type_t *type = arg->type;
expr_t *size = get_size_is_expr(type, arg->name);
@ -219,9 +219,13 @@ static void free_variable( const var_t *arg )
case RPC_FC_FP:
case RPC_FC_IP:
constraint = get_attrp( arg->attrs, ATTR_IIDIS );
if( constraint )
print_proxy( "_StubMsg.MaxCount = (unsigned long) ( %s );\n",constraint->name);
iid = get_attrp( arg->attrs, ATTR_IIDIS );
if( iid )
{
print_proxy( "_StubMsg.MaxCount = (unsigned long) " );
write_expr(proxy, iid, 1);
print_proxy( ";\n\n" );
}
print_proxy( "NdrClearOutParameters( &_StubMsg, ");
fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
fprintf(proxy, "(void*)%s );\n", arg->name );

View File

@ -1972,20 +1972,14 @@ static size_t write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
{
size_t i;
size_t start_offset = *typeformat_offset;
const var_t *iid = get_attrp(attrs, ATTR_IIDIS);
expr_t *iid = get_attrp(attrs, ATTR_IIDIS);
if (iid)
{
expr_t expr;
expr.type = EXPR_IDENTIFIER;
expr.ref = NULL;
expr.u.sval = iid->name;
expr.is_const = FALSE;
print_file(file, 2, "0x2f, /* FC_IP */\n");
print_file(file, 2, "0x5c, /* FC_PAD */\n");
*typeformat_offset
+= write_conf_or_var_desc(file, NULL, 0, type, &expr) + 2;
+= write_conf_or_var_desc(file, NULL, 0, type, iid) + 2;
}
else
{
@ -2839,9 +2833,13 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
}
else
{
const var_t *iid;
expr_t *iid;
if ((iid = get_attrp( var->attrs, ATTR_IIDIS )))
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long)%s;\n", iid->name );
{
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long) " );
write_expr( file, iid, 1 );
fprintf( file, ";\n\n" );
}
print_phase_function(file, indent, "Pointer", phase, var, start_offset);
}
break;
@ -2862,11 +2860,15 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
}
else
{
const var_t *iid;
expr_t *iid;
expr_t *sx = get_size_is_expr(type, var->name);
if ((iid = get_attrp( var->attrs, ATTR_IIDIS )))
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long)%s;\n", iid->name );
{
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long) " );
write_expr( file, iid, 1 );
fprintf( file, ";\n\n" );
}
else if (sx)
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long) ");