4 * Copyright 2002 Ove Kaaven
5 * Copyright 2004 Mike McCormack
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/port.h"
40 #define END_OF_LIST(list) \
43 while (NEXT_LINK(list)) \
44 list = NEXT_LINK(list); \
49 static int indent
= 0;
51 /* FIXME: support generation of stubless proxies */
53 static void print_proxy( const char *format
, ... )
56 va_start( va
, format
);
57 print( proxy
, indent
, format
, va
);
61 static void write_stubdescproto(void)
63 print_proxy( "static const MIDL_STUB_DESC Object_StubDesc;\n");
67 static void write_stubdesc(int expr_eval_routines
)
69 print_proxy( "static const MIDL_STUB_DESC Object_StubDesc =\n{\n");
72 print_proxy( "NdrOleAllocate,\n");
73 print_proxy( "NdrOleFree,\n");
74 print_proxy( "{0}, 0, 0, %s, 0,\n", expr_eval_routines
? "ExprEvalRoutines" : "0");
75 print_proxy( "__MIDL_TypeFormatString.Format,\n");
76 print_proxy( "1, /* -error bounds_check flag */\n");
77 print_proxy( "0x10001, /* Ndr library version */\n");
79 print_proxy( "0x50100a4, /* MIDL Version 5.1.164 */\n");
81 print_proxy("%s,\n", list_empty(&user_type_list
) ? "0" : "UserMarshalRoutines");
82 print_proxy( "0, /* notify & notify_flag routine table */\n");
83 print_proxy( "1, /* Flags */\n");
84 print_proxy( "0, /* Reserved3 */\n");
85 print_proxy( "0, /* Reserved4 */\n");
86 print_proxy( "0 /* Reserved5 */\n");
92 static void init_proxy(const statement_list_t
*stmts
)
95 if(!(proxy
= fopen(proxy_name
, "w")))
96 error("Could not open %s for output\n", proxy_name
);
97 print_proxy( "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION
, input_name
);
99 print_proxy( "#ifndef __REDQ_RPCPROXY_H_VERSION__\n");
100 print_proxy( "#define __REQUIRED_RPCPROXY_H_VERSION__ 440\n");
101 print_proxy( "#endif /* __REDQ_RPCPROXY_H_VERSION__ */\n");
103 print_proxy( "#define __midl_proxy\n");
104 print_proxy( "#include \"objbase.h\"\n");
105 print_proxy( "#include \"rpcproxy.h\"\n");
106 print_proxy( "#ifndef __RPCPROXY_H_VERSION__\n");
107 print_proxy( "#error This code needs a newer version of rpcproxy.h\n");
108 print_proxy( "#endif /* __RPCPROXY_H_VERSION__ */\n");
110 print_proxy( "#include \"%s\"\n", header_name
);
112 write_formatstringsdecl(proxy
, indent
, stmts
, need_proxy
);
113 write_stubdescproto();
116 static void clear_output_vars( const var_list_t
*args
)
121 LIST_FOR_EACH_ENTRY( arg
, args
, const var_t
, entry
)
123 if (is_attr(arg
->attrs
, ATTR_OUT
) && !is_attr(arg
->attrs
, ATTR_IN
)) {
124 print_proxy( "if(%s)\n", arg
->name
);
126 print_proxy( "MIDL_memset( %s, 0, sizeof( *%s ));\n", arg
->name
, arg
->name
);
132 int is_var_ptr(const var_t
*v
)
134 return is_ptr(v
->type
);
137 int cant_be_null(const var_t
*v
)
139 /* Search backwards for the most recent pointer attribute. */
140 const attr_list_t
*attrs
= v
->attrs
;
141 const type_t
*type
= v
->type
;
151 int t
= get_attrv(attrs
, ATTR_POINTERTYPE
);
153 if (t
== RPC_FC_FP
|| t
== RPC_FC_OP
|| t
== RPC_FC_UP
)
168 return 1; /* Default is RPC_FC_RP. */
171 static void proxy_check_pointers( const var_list_t
*args
)
176 LIST_FOR_EACH_ENTRY( arg
, args
, const var_t
, entry
)
178 if (is_var_ptr(arg
) && cant_be_null(arg
)) {
179 print_proxy( "if(!%s)\n", arg
->name
);
181 print_proxy( "RpcRaiseException(RPC_X_NULL_REF_POINTER);\n");
187 static void free_variable( const var_t
*arg
)
189 unsigned int type_offset
= arg
->type
->typestring_offset
;
191 type_t
*type
= arg
->type
;
192 expr_t
*size
= get_size_is_expr(type
, arg
->name
);
196 print_proxy( "_StubMsg.MaxCount = " );
197 write_expr(proxy
, size
, 0, 1, NULL
, NULL
);
198 fprintf(proxy
, ";\n\n");
199 print_proxy( "NdrClearOutParameters( &_StubMsg, ");
200 fprintf(proxy
, "&__MIDL_TypeFormatString.Format[%u], ", type_offset
);
201 fprintf(proxy
, "(void*)%s );\n", arg
->name
);
221 iid
= get_attrp( arg
->attrs
, ATTR_IIDIS
);
224 print_proxy( "_StubMsg.MaxCount = (unsigned long) " );
225 write_expr(proxy
, iid
, 1, 1, NULL
, NULL
);
226 print_proxy( ";\n\n" );
228 print_proxy( "NdrClearOutParameters( &_StubMsg, ");
229 fprintf(proxy
, "&__MIDL_TypeFormatString.Format[%u], ", type_offset
);
230 fprintf(proxy
, "(void*)%s );\n", arg
->name
);
234 print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__
, arg
->name
, type
->type
);
238 static void proxy_free_variables( var_list_t
*args
)
243 LIST_FOR_EACH_ENTRY( arg
, args
, const var_t
, entry
)
244 if (is_attr(arg
->attrs
, ATTR_OUT
))
246 free_variable( arg
);
247 fprintf(proxy
, "\n");
251 static void gen_proxy(type_t
*iface
, const func_t
*cur
, int idx
,
252 unsigned int proc_offset
)
254 var_t
*def
= cur
->def
;
255 int has_ret
= !is_void(get_func_return_type(cur
));
256 int has_full_pointer
= is_full_pointer_function(cur
);
257 const char *callconv
= get_attrp(def
->type
->attrs
, ATTR_CALLCONV
);
258 if (!callconv
) callconv
= "";
261 write_type_decl_left(proxy
, get_func_return_type(cur
));
262 print_proxy( " %s %s_", callconv
, iface
->name
);
263 write_name(proxy
, def
);
264 print_proxy( "_Proxy(\n");
265 write_args(proxy
, cur
->args
, iface
->name
, 1, TRUE
);
269 /* local variables */
272 write_type_decl_left(proxy
, get_func_return_type(cur
));
274 /* Initialize _RetVal properly in order to avoid compiler warnings */
275 if (is_ptr(get_func_return_type(cur
)) || is_array(get_func_return_type(cur
)))
276 print_proxy(" _RetVal = NULL;\n");
278 print_proxy(" _RetVal = 0;\n");
280 print_proxy( "RPC_MESSAGE _RpcMessage;\n" );
281 print_proxy( "MIDL_STUB_MESSAGE _StubMsg;\n" );
283 if (decl_indirect(get_func_return_type(cur
)))
284 print_proxy("void *_p_%s = &%s;\n",
285 "_RetVal", "_RetVal");
289 if (has_full_pointer
)
290 write_full_pointer_init(proxy
, indent
, cur
, FALSE
);
293 clear_output_vars( cur
->args
);
295 print_proxy( "RpcTryExcept\n" );
296 print_proxy( "{\n" );
298 print_proxy( "NdrProxyInitialize(This, &_RpcMessage, &_StubMsg, &Object_StubDesc, %d);\n", idx
);
299 proxy_check_pointers( cur
->args
);
301 print_proxy( "RpcTryFinally\n" );
302 print_proxy( "{\n" );
305 write_remoting_arguments(proxy
, indent
, cur
, PASS_IN
, PHASE_BUFFERSIZE
);
307 print_proxy( "NdrProxyGetBuffer(This, &_StubMsg);\n" );
309 write_remoting_arguments(proxy
, indent
, cur
, PASS_IN
, PHASE_MARSHAL
);
311 print_proxy( "NdrProxySendReceive(This, &_StubMsg);\n" );
312 fprintf(proxy
, "\n");
313 print_proxy( "_StubMsg.BufferStart = _RpcMessage.Buffer;\n" );
314 print_proxy( "_StubMsg.BufferEnd = _StubMsg.BufferStart + _RpcMessage.BufferLength;\n\n" );
316 print_proxy("if ((_RpcMessage.DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
318 print_proxy("NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset
);
320 fprintf(proxy
, "\n");
322 write_remoting_arguments(proxy
, indent
, cur
, PASS_OUT
, PHASE_UNMARSHAL
);
326 if (decl_indirect(get_func_return_type(cur
)))
327 print_proxy("MIDL_memset(&%s, 0, sizeof(%s));\n", "_RetVal", "_RetVal");
328 else if (is_ptr(get_func_return_type(cur
)) || is_array(get_func_return_type(cur
)))
329 print_proxy("%s = 0;\n", "_RetVal");
330 write_remoting_arguments(proxy
, indent
, cur
, PASS_RETURN
, PHASE_UNMARSHAL
);
335 print_proxy( "RpcFinally\n" );
336 print_proxy( "{\n" );
338 if (has_full_pointer
)
339 write_full_pointer_free(proxy
, indent
, cur
);
340 print_proxy( "NdrProxyFreeBuffer(This, &_StubMsg);\n" );
343 print_proxy( "RpcEndFinally\n" );
345 print_proxy( "}\n" );
346 print_proxy( "RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)\n" );
347 print_proxy( "{\n" );
350 proxy_free_variables( cur
->args
);
351 print_proxy( "_RetVal = NdrProxyErrorHandler(RpcExceptionCode());\n" );
354 print_proxy( "}\n" );
355 print_proxy( "RpcEndExcept\n" );
358 print_proxy( "return _RetVal;\n" );
365 static void gen_stub(type_t
*iface
, const func_t
*cur
, const char *cas
,
366 unsigned int proc_offset
)
368 var_t
*def
= cur
->def
;
370 int has_ret
= !is_void(get_func_return_type(cur
));
371 int has_full_pointer
= is_full_pointer_function(cur
);
374 print_proxy( "void __RPC_STUB %s_", iface
->name
);
375 write_name(proxy
, def
);
376 print_proxy( "_Stub(\n");
378 print_proxy( "IRpcStubBuffer* This,\n");
379 print_proxy( "IRpcChannelBuffer *_pRpcChannelBuffer,\n");
380 print_proxy( "PRPC_MESSAGE _pRpcMessage,\n");
381 print_proxy( "DWORD* _pdwStubPhase)\n");
385 print_proxy("%s * _This = (%s*)((CStdStubBuffer*)This)->pvServerObject;\n", iface
->name
, iface
->name
);
386 print_proxy("MIDL_STUB_MESSAGE _StubMsg;\n");
387 declare_stub_args( proxy
, indent
, cur
);
388 fprintf(proxy
, "\n");
392 print_proxy("NdrStubInitialize(_pRpcMessage, &_StubMsg, &Object_StubDesc, _pRpcChannelBuffer);\n");
393 fprintf(proxy
, "\n");
395 write_parameters_init(proxy
, indent
, cur
);
397 print_proxy("RpcTryFinally\n");
400 if (has_full_pointer
)
401 write_full_pointer_init(proxy
, indent
, cur
, TRUE
);
402 print_proxy("if ((_pRpcMessage->DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
404 print_proxy("NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset
);
406 fprintf(proxy
, "\n");
408 write_remoting_arguments(proxy
, indent
, cur
, PASS_IN
, PHASE_UNMARSHAL
);
409 fprintf(proxy
, "\n");
411 assign_stub_out_args( proxy
, indent
, cur
);
413 print_proxy("*_pdwStubPhase = STUB_CALL_SERVER;\n");
414 fprintf(proxy
, "\n");
416 if (has_ret
) fprintf(proxy
, "_RetVal = ");
417 if (cas
) fprintf(proxy
, "%s_%s_Stub", iface
->name
, cas
);
420 fprintf(proxy
, "_This->lpVtbl->");
421 write_name(proxy
, def
);
423 fprintf(proxy
, "(_This");
427 LIST_FOR_EACH_ENTRY( arg
, cur
->args
, const var_t
, entry
)
429 fprintf(proxy
, ", ");
430 if (arg
->type
->declarray
)
432 write_name(proxy
, arg
);
435 fprintf(proxy
, ");\n");
436 fprintf(proxy
, "\n");
437 print_proxy("*_pdwStubPhase = STUB_MARSHAL;\n");
438 fprintf(proxy
, "\n");
440 write_remoting_arguments(proxy
, indent
, cur
, PASS_OUT
, PHASE_BUFFERSIZE
);
442 if (!is_void(get_func_return_type(cur
)))
443 write_remoting_arguments(proxy
, indent
, cur
, PASS_RETURN
, PHASE_BUFFERSIZE
);
445 print_proxy("NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);\n");
447 write_remoting_arguments(proxy
, indent
, cur
, PASS_OUT
, PHASE_MARSHAL
);
448 fprintf(proxy
, "\n");
450 /* marshall the return value */
451 if (!is_void(get_func_return_type(cur
)))
452 write_remoting_arguments(proxy
, indent
, cur
, PASS_RETURN
, PHASE_MARSHAL
);
456 print_proxy("RpcFinally\n");
459 write_remoting_arguments(proxy
, indent
+1, cur
, PASS_OUT
, PHASE_FREE
);
461 if (has_full_pointer
)
462 write_full_pointer_free(proxy
, indent
, cur
);
465 print_proxy("RpcEndFinally\n");
467 print_proxy("_pRpcMessage->BufferLength = _StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer;\n");
474 static int write_proxy_methods(type_t
*iface
, int skip
)
479 if (iface
->ref
) i
= write_proxy_methods(iface
->ref
, iface
->ref
->ref
!= NULL
);
480 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( cur
, iface
->funcs
, const func_t
, entry
) {
481 var_t
*def
= cur
->def
;
482 if (!is_callas(def
->attrs
)) {
483 if (i
) fprintf(proxy
, ",\n");
484 print_proxy( "%s%s_", skip
? "0\t/* " : "", iface
->name
);
485 write_name(proxy
, def
);
486 fprintf(proxy
, "_Proxy%s", skip
? " */" : "");
493 static int write_stub_methods(type_t
*iface
, int skip
)
498 if (iface
->ref
) i
= write_stub_methods(iface
->ref
, TRUE
);
499 else return i
; /* skip IUnknown */
501 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( cur
, iface
->funcs
, const func_t
, entry
) {
502 var_t
*def
= cur
->def
;
503 if (!is_local(def
->attrs
)) {
505 print_proxy("STUB_FORWARDING_FUNCTION,\n");
507 if (i
) fprintf(proxy
,",\n");
508 print_proxy( "%s_", iface
->name
);
509 write_name(proxy
, def
);
510 fprintf(proxy
, "_Stub");
518 static void write_proxy(type_t
*iface
, unsigned int *proc_offset
)
520 int midx
= -1, stubs
;
523 if (!iface
->funcs
) return;
525 /* FIXME: check for [oleautomation], shouldn't generate proxies/stubs if specified */
527 fprintf(proxy
, "/*****************************************************************************\n");
528 fprintf(proxy
, " * %s interface\n", iface
->name
);
529 fprintf(proxy
, " */\n");
530 LIST_FOR_EACH_ENTRY( cur
, iface
->funcs
, const func_t
, entry
)
532 const var_t
*def
= cur
->def
;
533 if (!is_local(def
->attrs
)) {
534 const var_t
*cas
= is_callas(def
->attrs
);
535 const char *cname
= cas
? cas
->name
: NULL
;
539 LIST_FOR_EACH_ENTRY( m
, iface
->funcs
, const func_t
, entry
)
540 if (!strcmp(m
->def
->name
, cname
))
546 gen_proxy(iface
, cur
, idx
, *proc_offset
);
547 gen_stub(iface
, cur
, cname
, *proc_offset
);
548 *proc_offset
+= get_size_procformatstring_func( cur
);
549 if (midx
== -1) midx
= idx
;
550 else if (midx
!= idx
) error("method index mismatch in write_proxy\n");
556 print_proxy( "static const CINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n", midx
, iface
->name
);
559 print_proxy( "{\n", iface
->name
);
561 print_proxy( "&IID_%s,\n", iface
->name
);
563 print_proxy( "},\n");
566 write_proxy_methods(iface
, FALSE
);
567 fprintf(proxy
, "\n");
571 print_proxy( "};\n");
572 fprintf(proxy
, "\n\n");
575 print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface
->name
);
578 stubs
= write_stub_methods(iface
, FALSE
);
579 fprintf(proxy
, "\n");
581 fprintf(proxy
, "};\n");
583 print_proxy( "static const CInterfaceStubVtbl _%sStubVtbl =\n", iface
->name
);
588 print_proxy( "&IID_%s,\n", iface
->name
);
589 print_proxy( "0,\n");
590 print_proxy( "%d,\n", stubs
+3);
591 print_proxy( "&%s_table[-3],\n", iface
->name
);
593 print_proxy( "},\n", iface
->name
);
596 print_proxy( "CStdStubBuffer_METHODS\n");
600 print_proxy( "};\n");
604 static int does_any_iface(const statement_list_t
*stmts
, type_pred_t pred
)
606 const statement_t
*stmt
;
609 LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
611 if (stmt
->type
== STMT_LIBRARY
)
613 if (does_any_iface(stmt
->u
.lib
->stmts
, pred
))
616 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
618 if (pred(stmt
->u
.type
))
626 int need_proxy(const type_t
*iface
)
628 return is_object(iface
->attrs
) && !is_local(iface
->attrs
);
631 int need_stub(const type_t
*iface
)
633 return !is_object(iface
->attrs
) && !is_local(iface
->attrs
);
636 int need_proxy_file(const statement_list_t
*stmts
)
638 return does_any_iface(stmts
, need_proxy
);
641 int need_stub_files(const statement_list_t
*stmts
)
643 return does_any_iface(stmts
, need_stub
);
646 static void write_proxy_stmts(const statement_list_t
*stmts
, unsigned int *proc_offset
)
648 const statement_t
*stmt
;
649 if (stmts
) LIST_FOR_EACH_ENTRY( stmt
, stmts
, const statement_t
, entry
)
651 if (stmt
->type
== STMT_LIBRARY
)
652 write_proxy_stmts(stmt
->u
.lib
->stmts
, proc_offset
);
653 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
655 if (need_proxy(stmt
->u
.type
))
656 write_proxy(stmt
->u
.type
, proc_offset
);
661 static void write_proxy_iface_name_format(const statement_list_t
*stmts
, const char *format
)
663 const statement_t
*stmt
;
664 if (stmts
) LIST_FOR_EACH_ENTRY( stmt
, stmts
, const statement_t
, entry
)
666 if (stmt
->type
== STMT_LIBRARY
)
667 write_proxy_iface_name_format(stmt
->u
.lib
->stmts
, format
);
668 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
670 type_t
*iface
= stmt
->u
.type
;
671 if (iface
->ref
&& iface
->funcs
&& need_proxy(iface
))
672 fprintf(proxy
, format
, iface
->name
);
677 static void write_iid_lookup(const statement_list_t
*stmts
, const char *file_id
, int *c
)
679 const statement_t
*stmt
;
680 if (stmts
) LIST_FOR_EACH_ENTRY( stmt
, stmts
, const statement_t
, entry
)
682 if (stmt
->type
== STMT_LIBRARY
)
683 write_iid_lookup(stmt
->u
.lib
->stmts
, file_id
, c
);
684 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
686 type_t
*iface
= stmt
->u
.type
;
687 if(iface
->ref
&& iface
->funcs
&& need_proxy(iface
))
689 fprintf(proxy
, " if (!_%s_CHECK_IID(%d))\n", file_id
, *c
);
690 fprintf(proxy
, " {\n");
691 fprintf(proxy
, " *pIndex = %d;\n", *c
);
692 fprintf(proxy
, " return 1;\n");
693 fprintf(proxy
, " }\n");
700 void write_proxies(const statement_list_t
*stmts
)
702 int expr_eval_routines
;
703 char *file_id
= proxy_token
;
705 unsigned int proc_offset
= 0;
707 if (!do_proxies
) return;
708 if (do_everything
&& !need_proxy_file(stmts
)) return;
713 write_proxy_stmts(stmts
, &proc_offset
);
715 expr_eval_routines
= write_expr_eval_routines(proxy
, proxy_token
);
716 if (expr_eval_routines
)
717 write_expr_eval_routine_list(proxy
, proxy_token
);
718 write_user_quad_list(proxy
);
719 write_stubdesc(expr_eval_routines
);
721 print_proxy( "#if !defined(__RPC_WIN32__)\n");
722 print_proxy( "#error Currently only Wine and WIN32 are supported.\n");
723 print_proxy( "#endif\n");
725 write_procformatstring(proxy
, stmts
, need_proxy
);
726 write_typeformatstring(proxy
, stmts
, need_proxy
);
728 fprintf(proxy
, "static const CInterfaceProxyVtbl* const _%s_ProxyVtblList[] =\n", file_id
);
729 fprintf(proxy
, "{\n");
730 write_proxy_iface_name_format(stmts
, " (const CInterfaceProxyVtbl*)&_%sProxyVtbl,\n");
731 fprintf(proxy
, " 0\n");
732 fprintf(proxy
, "};\n");
733 fprintf(proxy
, "\n");
735 fprintf(proxy
, "static const CInterfaceStubVtbl* const _%s_StubVtblList[] =\n", file_id
);
736 fprintf(proxy
, "{\n");
737 write_proxy_iface_name_format(stmts
, " (const CInterfaceStubVtbl*)&_%sStubVtbl,\n");
738 fprintf(proxy
, " 0\n");
739 fprintf(proxy
, "};\n");
740 fprintf(proxy
, "\n");
742 fprintf(proxy
, "static PCInterfaceName const _%s_InterfaceNamesList[] =\n", file_id
);
743 fprintf(proxy
, "{\n");
744 write_proxy_iface_name_format(stmts
, " \"%s\",\n");
745 fprintf(proxy
, " 0\n");
746 fprintf(proxy
, "};\n");
747 fprintf(proxy
, "\n");
749 fprintf(proxy
, "#define _%s_CHECK_IID(n) IID_GENERIC_CHECK_IID(_%s, pIID, n)\n", file_id
, file_id
);
750 fprintf(proxy
, "\n");
751 fprintf(proxy
, "int __stdcall _%s_IID_Lookup(const IID* pIID, int* pIndex)\n", file_id
);
752 fprintf(proxy
, "{\n");
754 write_iid_lookup(stmts
, file_id
, &c
);
755 fprintf(proxy
, " return 0;\n");
756 fprintf(proxy
, "}\n");
757 fprintf(proxy
, "\n");
759 fprintf(proxy
, "const ExtendedProxyFileInfo %s_ProxyFileInfo =\n", file_id
);
760 fprintf(proxy
, "{\n");
761 fprintf(proxy
, " (const PCInterfaceProxyVtblList*)&_%s_ProxyVtblList,\n", file_id
);
762 fprintf(proxy
, " (const PCInterfaceStubVtblList*)&_%s_StubVtblList,\n", file_id
);
763 fprintf(proxy
, " _%s_InterfaceNamesList,\n", file_id
);
764 fprintf(proxy
, " 0,\n");
765 fprintf(proxy
, " &_%s_IID_Lookup,\n", file_id
);
766 fprintf(proxy
, " %d,\n", c
);
767 fprintf(proxy
, " 1,\n");
768 fprintf(proxy
, " 0,\n");
769 fprintf(proxy
, " 0,\n");
770 fprintf(proxy
, " 0,\n");
771 fprintf(proxy
, " 0\n");
772 fprintf(proxy
, "};\n");