Commit 96f6a22e authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

widl: Only write the buffer incrementing code for the marshaling and unmarshaling phases.

Only write the buffer incrementing code for the marshaling and unmarshaling phases - buffer sizing is handled elsewhere and freeing isn't applicable.
parent 226c8f6b
......@@ -1704,30 +1704,33 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
size = 0;
}
print_file(file, indent,
"_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + %u) & ~0x%x);\n",
size - 1, size - 1);
if (phase == PHASE_MARSHAL)
if (phase == PHASE_MARSHAL || phase == PHASE_UNMARSHAL)
{
print_file(file, indent, "*(");
write_type(file, var->type, NULL, var->tname);
fprintf(file, " *)_StubMsg.Buffer = *");
write_name(file, var);
fprintf(file, ";\n");
}
else if (phase == PHASE_UNMARSHAL)
{
print_file(file, indent, (pass == PASS_IN) ? "" : "*");
write_name(file, var);
fprintf(file, (pass == PASS_IN) ? " = (" : " = *(");
print_file(file, indent,
"_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + %u) & ~0x%x);\n",
size - 1, size - 1);
if (phase == PHASE_MARSHAL)
{
print_file(file, indent, "*(");
write_type(file, var->type, NULL, var->tname);
fprintf(file, " *)_StubMsg.Buffer = *");
write_name(file, var);
fprintf(file, ";\n");
}
else if (phase == PHASE_UNMARSHAL)
{
print_file(file, indent, (pass == PASS_IN) ? "" : "*");
write_name(file, var);
fprintf(file, (pass == PASS_IN) ? " = (" : " = *(");
write_type(file, var->type, NULL, var->tname);
fprintf(file, " *)_StubMsg.Buffer;\n");
}
print_file(file, indent, "_StubMsg.Buffer += sizeof(");
write_type(file, var->type, NULL, var->tname);
fprintf(file, " *)_StubMsg.Buffer;\n");
fprintf(file, ");\n");
}
print_file(file, indent, "_StubMsg.Buffer += sizeof(");
write_type(file, var->type, NULL, var->tname);
fprintf(file, ");\n");
}
else
{
......
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