Support size_is(*Length) attributes for strings.
Modified: trunk/reactos/tools/widl/ChangeLog
Modified: trunk/reactos/tools/widl/server.c
_____
Modified: trunk/reactos/tools/widl/ChangeLog
--- trunk/reactos/tools/widl/ChangeLog 2005-08-07 11:25:36 UTC (rev
17157)
+++ trunk/reactos/tools/widl/ChangeLog 2005-08-07 11:44:41 UTC (rev
17158)
@@ -1,5 +1,11 @@
ChangeLog
+2005-08-07 ekohl
+
+ tools/widl/server.c
+
+- Support size_is(*Length) attributes for strings.
+
2005-07-30 ekohl
tools/widl/client.c
_____
Modified: trunk/reactos/tools/widl/server.c
--- trunk/reactos/tools/widl/server.c 2005-08-07 11:25:36 UTC (rev
17157)
+++ trunk/reactos/tools/widl/server.c 2005-08-07 11:44:41 UTC (rev
17158)
@@ -833,7 +833,11 @@
var->type->type == RPC_FC_CHAR ||
var->type->type == RPC_FC_WCHAR)
{
- print_server("_StubMsg.MaxCount = %s;\n",
((var_t *)sizeis_attr)->name);
+ if (((var_t *)sizeis_attr)->ptr_level == 0)
+ print_server("_StubMsg.MaxCount =
%s;\n", ((var_t *)sizeis_attr)->name);
+ else
+ print_server("_StubMsg.MaxCount = %s ?
*%s : 0;\n",
+ ((var_t
*)sizeis_attr)->name, ((var_t *)sizeis_attr)->name);
fprintf(server, "\n");
print_server("NdrConformantStringBufferSize(\n");
indent++;
@@ -1232,7 +1236,11 @@
if (string_attr)
{
fprintf(server, "\n");
- print_server("_StubMsg.MaxCount = %s;\n",
((var_t *)sizeis_attr)->name);
+ if (((var_t *)sizeis_attr)->ptr_level == 0)
+ print_server("_StubMsg.MaxCount = %s;\n",
((var_t *)sizeis_attr)->name);
+ else
+ print_server("_StubMsg.MaxCount = %s ? *%s
: 0;\n",
+ ((var_t *)sizeis_attr)->name,
((var_t *)sizeis_attr)->name);
fprintf(server, "\n");
print_server("NdrConformantStringMarshall(\n");
indent++;
@@ -1452,7 +1460,11 @@
indent++;
if (string_attr)
{
- print_server("_StubMsg.MaxCount = %s;\n", ((var_t
*)sizeis_attr)->name);
+ if (((var_t *)sizeis_attr)->ptr_level == 0)
+ print_server("_StubMsg.MaxCount = %s;\n",
((var_t *)sizeis_attr)->name);
+ else
+ print_server("_StubMsg.MaxCount = %s ? *%s :
0;\n",
+ ((var_t *)sizeis_attr)->name,
((var_t *)sizeis_attr)->name);
fprintf(server, "\n");
print_server("NdrPointerFree(\n");
indent++;