mirror of
https://github.com/reactos/wine.git
synced 2024-12-02 08:46:29 +00:00
widl: De-reference parameters' types before deciding what to do with them.
De-reference parameters' types before deciding what to do with them. Also dereference string parameters since they are immediately dispatched to write_string_tfs when the string attribute is detected without any further processing done on them.
This commit is contained in:
parent
4b5386e2cd
commit
4edcf2de35
@ -706,6 +706,9 @@ static size_t write_string_tfs(FILE *file, const attr_t *attrs,
|
|||||||
if (!get_attrp(attrs, ATTR_SIZEIS))
|
if (!get_attrp(attrs, ATTR_SIZEIS))
|
||||||
flags |= RPC_FC_P_SIMPLEPOINTER;
|
flags |= RPC_FC_P_SIMPLEPOINTER;
|
||||||
|
|
||||||
|
while (type_has_ref(type))
|
||||||
|
type = type->ref;
|
||||||
|
|
||||||
if ((type->type != RPC_FC_BYTE) && (type->type != RPC_FC_CHAR) && (type->type != RPC_FC_WCHAR))
|
if ((type->type != RPC_FC_BYTE) && (type->type != RPC_FC_CHAR) && (type->type != RPC_FC_WCHAR))
|
||||||
{
|
{
|
||||||
error("write_string_tfs: Unimplemented for type 0x%x of name: %s\n", type->type, name);
|
error("write_string_tfs: Unimplemented for type 0x%x of name: %s\n", type->type, name);
|
||||||
@ -1425,6 +1428,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
||||||
for (; var; *type_offset += get_size_typeformatstring_var(var), var = PREV_LINK(var))
|
for (; var; *type_offset += get_size_typeformatstring_var(var), var = PREV_LINK(var))
|
||||||
{
|
{
|
||||||
|
const type_t *type = var->type;
|
||||||
length_is = get_attrp(var->attrs, ATTR_LENGTHIS);
|
length_is = get_attrp(var->attrs, ATTR_LENGTHIS);
|
||||||
size_is = get_attrp(var->attrs, ATTR_SIZEIS);
|
size_is = get_attrp(var->attrs, ATTR_SIZEIS);
|
||||||
has_length = length_is && (length_is->type != EXPR_VOID);
|
has_length = length_is && (length_is->type != EXPR_VOID);
|
||||||
@ -1453,6 +1457,9 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (type_has_ref(type))
|
||||||
|
type = type->ref;
|
||||||
|
|
||||||
if (is_string_type(var->attrs, var->ptr_level, var->array))
|
if (is_string_type(var->attrs, var->ptr_level, var->array))
|
||||||
{
|
{
|
||||||
if (var->array && var->array->is_const)
|
if (var->array && var->array->is_const)
|
||||||
@ -1545,11 +1552,11 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
array_type, function_from_phase(phase), var->name,
|
array_type, function_from_phase(phase), var->name,
|
||||||
*type_offset);
|
*type_offset);
|
||||||
}
|
}
|
||||||
else if (var->ptr_level == 0 && is_base_type(var->type->type))
|
else if (var->ptr_level == 0 && is_base_type(type->type))
|
||||||
{
|
{
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int alignment = 0;
|
unsigned int alignment = 0;
|
||||||
switch (var->type->type)
|
switch (type->type)
|
||||||
{
|
{
|
||||||
case RPC_FC_BYTE:
|
case RPC_FC_BYTE:
|
||||||
case RPC_FC_CHAR:
|
case RPC_FC_CHAR:
|
||||||
@ -1586,7 +1593,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: 0)\n", var->name, var->type->type);
|
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: 0)\n", var->name, type->type);
|
||||||
size = 0;
|
size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1623,7 +1630,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
{
|
{
|
||||||
const char *ndrtype;
|
const char *ndrtype;
|
||||||
|
|
||||||
switch (var->type->type)
|
switch (type->type)
|
||||||
{
|
{
|
||||||
case RPC_FC_STRUCT:
|
case RPC_FC_STRUCT:
|
||||||
ndrtype = "SimpleStruct";
|
ndrtype = "SimpleStruct";
|
||||||
@ -1640,7 +1647,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: %d)\n",
|
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: %d)\n",
|
||||||
var->name, var->type->type, var->ptr_level);
|
var->name, type->type, var->ptr_level);
|
||||||
ndrtype = NULL;
|
ndrtype = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1650,10 +1657,10 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((var->ptr_level == 1) && (pointer_type == RPC_FC_RP) && is_base_type(var->type->type))
|
if ((var->ptr_level == 1) && (pointer_type == RPC_FC_RP) && is_base_type(type->type))
|
||||||
{
|
{
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
switch (var->type->type)
|
switch (type->type)
|
||||||
{
|
{
|
||||||
case RPC_FC_BYTE:
|
case RPC_FC_BYTE:
|
||||||
case RPC_FC_CHAR:
|
case RPC_FC_CHAR:
|
||||||
@ -1686,7 +1693,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: 0)\n", var->name, var->type->type);
|
error("write_remoting_arguments: Unsupported type: %s (0x%02x, ptr_level: 1)\n", var->name, type->type);
|
||||||
size = 0;
|
size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user