54 print_proxy(
"static const MIDL_STUB_DESC Object_StubDesc;\n");
60 print_proxy(
"static const MIDL_STUB_DESC Object_StubDesc =\n{\n");
67 print_proxy(
"1, /* -error bounds_check flag */\n");
70 print_proxy(
"0x50100a4, /* MIDL Version 5.1.164 */\n");
73 print_proxy(
"0, /* notify & notify_flag routine table */\n");
155 unsigned int type_offset =
arg->typestring_offset;
174 print_proxy(
"NdrClearOutParameters( &__frame->_StubMsg, ");
175 fprintf(
proxy,
"&__MIDL_TypeFormatString.Format[%u], ", type_offset );
198 unsigned int proc_offset)
205 if (!callconv) callconv =
"STDMETHODCALLTYPE";
218 print_proxy(
"static void __finally_%s_%s_Proxy( struct __proxy_frame *__frame )\n",
223 print_proxy(
"NdrProxyFreeBuffer( __frame->This, &__frame->_StubMsg );\n" );
234 print_proxy(
"struct __proxy_frame __f, * const __frame = &__f;\n" );
251 if (has_full_pointer)
260 print_proxy(
"NdrProxyInitialize(This, &_RpcMessage, &__frame->_StubMsg, &Object_StubDesc, %d);\n",
idx);
269 print_proxy(
"NdrProxyGetBuffer(This, &__frame->_StubMsg);\n" );
273 print_proxy(
"NdrProxySendReceive(This, &__frame->_StubMsg);\n" );
275 print_proxy(
"__frame->_StubMsg.BufferStart = _RpcMessage.Buffer;\n" );
276 print_proxy(
"__frame->_StubMsg.BufferEnd = __frame->_StubMsg.BufferStart + _RpcMessage.BufferLength;\n\n" );
278 print_proxy(
"if ((_RpcMessage.DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
280 print_proxy(
"NdrConvert( &__frame->_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset );
306 print_proxy(
"RpcExcept(__frame->_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)\n" );
311 print_proxy(
"_RetVal = NdrProxyErrorHandler(RpcExceptionCode());\n" );
326 unsigned int proc_offset)
348 if (has_full_pointer)
356 print_proxy(
"IRpcChannelBuffer *_pRpcChannelBuffer,\n");
362 print_proxy(
"struct __frame_%s_%s_Stub __f, * const __frame = &__f;\n\n",
365 print_proxy(
"__frame->_This = (%s*)((CStdStubBuffer*)This)->pvServerObject;\n\n", iface->
name);
369 print_proxy(
"NdrStubInitialize(_pRpcMessage, &__frame->_StubMsg, &Object_StubDesc, _pRpcChannelBuffer);\n");
378 if (has_full_pointer)
380 print_proxy(
"if ((_pRpcMessage->DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
382 print_proxy(
"NdrConvert( &__frame->_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset );
391 print_proxy(
"*_pdwStubPhase = STUB_CALL_SERVER;\n");
393 print_proxy(
"%s", has_ret ?
"__frame->_RetVal = " :
"" );
413 print_proxy(
"NdrStubGetBuffer(This, _pRpcChannelBuffer, &__frame->_StubMsg);\n");
432 print_proxy(
"_pRpcMessage->BufferLength = __frame->_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer;\n");
446 print_proxy(
"void __RPC_API %s_%s_Thunk( PMIDL_STUB_MESSAGE pStubMsg )\n",
451 "*pParamStruct = (struct _PARAM_STRUCT *)pStubMsg->StackTop", has_ret );
453 has_ret ?
"pParamStruct->_RetVal = " :
"", iface->
name, callas->
name );
617 int needs_stub_thunks = 0;
623 fprintf(
proxy,
"/*****************************************************************************\n");
630 const char *cname = cas ? cas->
name :
NULL;
631 int idx =
func->type->details.function->idx;
638 idx =
m->type->details.function->idx;
643 func->procstring_offset = *proc_offset;
648 needs_stub_thunks = 1;
657 print_proxy(
"static const unsigned short %s_FormatStringOffsetTable[] =\n", iface->
name );
674 print_proxy(
"static const MIDL_STUBLESS_PROXY_INFO %s_ProxyInfo =\n", iface->
name );
678 print_proxy(
"__MIDL_ProcFormatString.Format,\n" );
688 print_proxy(
"static %sCINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n",
708 if (needs_stub_thunks)
710 print_proxy(
"static const STUB_THUNK %s_StubThunkTable[] =\n", iface->
name);
719 print_proxy(
"static const MIDL_SERVER_INFO %s_ServerInfo =\n", iface->
name );
724 print_proxy(
"__MIDL_ProcFormatString.Format,\n" );
726 if (needs_stub_thunks)
737 if (needs_inline_stubs)
739 print_proxy(
"static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->
name);
754 print_proxy(
"static %sCInterfaceStubVtbl _%sStubVtbl =\n",
770 iface->
details.
iface->async_iface == iface ?
"CStdAsyncStubBuffer" :
"CStdStubBuffer",
788 if (pred(stmt->
u.
type))
878static int cmp_iid(
const void *ptr1,
const void *ptr2 )
880 const type_t *
const *iface1 = ptr1;
881 const type_t *
const *iface2 = ptr2;
899 *ifaces =
xrealloc( *ifaces, (*
count + 1) *
sizeof(**ifaces) );
900 (*ifaces)[(*count)++] = iface;
904 *ifaces =
xrealloc( *ifaces, (*
count + 1) *
sizeof(**ifaces) );
905 (*ifaces)[(*count)++] = iface;
925 unsigned int proc_offset = 0;
927 int i,
count, have_baseiid = 0;
928 unsigned int table_version;
930 const type_t * delegate_to;
932 print_proxy(
"#ifndef __REDQ_RPCPROXY_H_VERSION__\n");
939 print_proxy(
"#error This code needs a newer version of rpcproxy.h\n");
940 print_proxy(
"#endif /* __RPCPROXY_H_VERSION__ */\n");
956 print_proxy(
"static int __proxy_filter( struct __proxy_frame *__frame )\n");
958 print_proxy(
" return (__frame->_StubMsg.dwStubPhase != PROXY_SENDRECEIVE);\n");
974 print_proxy(
"#error Invalid build platform for this proxy.\n");
981 fprintf(
proxy,
"static const CInterfaceProxyVtbl* const _%s_ProxyVtblList[] =\n", file_id);
984 fprintf(
proxy,
" (const CInterfaceProxyVtbl*)&_%sProxyVtbl,\n", interfaces[
i]->
name);
989 fprintf(
proxy,
"static const CInterfaceStubVtbl* const _%s_StubVtblList[] =\n", file_id);
997 fprintf(
proxy,
"static PCInterfaceName const _%s_InterfaceNamesList[] =\n", file_id);
1010 fprintf(
proxy,
"static const IID * _%s_BaseIIDList[] =\n", file_id);
1024 fprintf(
proxy,
"static int __stdcall _%s_IID_Lookup(const IID* pIID, int* pIndex)\n", file_id);
1031 fprintf(
proxy,
" int res = IID_GENERIC_CHECK_IID(_%s, pIID, pos);\n", file_id);
1032 fprintf(
proxy,
" if (!res) { *pIndex = pos; return 1; }\n");
1043 if (interfaces[
i]->
details.iface->async_iface != interfaces[
i])
continue;
1044 if (table_version != 6)
1046 fprintf(
proxy,
"static const IID *_AsyncInterfaceTable[] =\n");
1053 if (table_version == 6)
1060 fprintf(
proxy,
"const ExtendedProxyFileInfo %s_ProxyFileInfo DECLSPEC_HIDDEN =\n", file_id);
1062 fprintf(
proxy,
" (const PCInterfaceProxyVtblList*)_%s_ProxyVtblList,\n", file_id);
1063 fprintf(
proxy,
" (const PCInterfaceStubVtblList*)_%s_StubVtblList,\n", file_id);
1065 if (have_baseiid)
fprintf(
proxy,
" _%s_BaseIIDList,\n", file_id);
1070 fprintf(
proxy,
" %s,\n", table_version == 6 ?
"_AsyncInterfaceTable" :
"0");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void * xrealloc(void *oldmem, size_t size)
static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
static int list_empty(struct list_entry *head)
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
void write_expr(FILE *h, const expr_t *e, int brackets, int toplevel, const char *toplevel_prefix, const type_t *cont_type, const char *local_var_prefix)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
static unsigned char get_struct_fc(ITypeInfo *typeinfo, TYPEATTR *attr)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
union _statement_t::@5026 u
union _type_t::@5025 details
struct iface_details * iface
void write_pointer_checks(FILE *file, int indent, const var_t *func)
void declare_stub_args(FILE *file, int indent, const var_t *func)
enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *attrs, unsigned int flags)
void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred_t pred)
void write_parameters_init(FILE *file, int indent, const var_t *func, const char *local_var_prefix)
static struct list expr_eval_routines
void write_user_quad_list(FILE *file)
void write_full_pointer_init(FILE *file, int indent, const var_t *func, int is_server)
void write_func_param_struct(FILE *file, const type_t *iface, const type_t *func, const char *var_decl, int add_retval)
void write_expr_eval_routine_list(FILE *file, const char *iface)
int decl_indirect(const type_t *t)
void write_typeformatstring(FILE *file, const statement_list_t *stmts, type_pred_t pred)
void write_exceptions(FILE *file)
void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix, enum pass pass, enum remoting_phase phase)
int is_full_pointer_function(const var_t *func)
unsigned int get_size_procformatstring_func(const type_t *iface, const var_t *func)
void write_client_call_routine(FILE *file, const type_t *iface, const var_t *func, const char *prefix, unsigned int proc_offset)
int is_interpreted_func(const type_t *iface, const var_t *func)
int write_expr_eval_routines(FILE *file, const char *iface)
void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local_var_prefix, enum remoting_phase phase, const var_t *var, int valid_variance)
void write_full_pointer_free(FILE *file, int indent, const var_t *func)
void write_formatstringsdecl(FILE *f, int indent, const statement_list_t *stmts, type_pred_t pred)
void assign_stub_out_args(FILE *file, int indent, const var_t *func, const char *local_var_prefix)
int(* type_pred_t)(const type_t *)
static int type_array_is_decl_as_ptr(const type_t *type)
static enum type_type type_get_type(const type_t *type)
static type_t * type_function_get_rettype(const type_t *type)
static int type_array_has_conformance(const type_t *type)
static var_t * type_function_get_retval(const type_t *type)
static expr_t * type_array_get_conformance(const type_t *type)
static type_t * type_iface_get_inherit(const type_t *type)
static statement_list_t * type_iface_get_stmts(const type_t *type)
static type_t * type_pointer_get_ref(const type_t *type)
unsigned int pointer_size
enum stub_mode get_stub_mode(void)
static var_list_t * type_get_function_args(const type_t *func_type)
#define STATEMENTS_FOR_EACH_FUNC(stmt, stmts)