ReactOS 0.4.16-dev-1946-g52006dd
ndr_stubless.c
Go to the documentation of this file.
1/*
2 * NDR -Oi,-Oif,-Oicf Interpreter
3 *
4 * Copyright 2001 Ove Kåven, TransGaming Technologies
5 * Copyright 2003-5 Robert Shearman (for CodeWeavers)
6 *
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.
11 *
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.
16 *
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
20 *
21 * TODO:
22 * - Pipes
23 * - Some types of binding handles
24 */
25
26#include <stdarg.h>
27#include <stdio.h>
28#include <string.h>
29
30#include "windef.h"
31#include "winbase.h"
32#include "winerror.h"
33
34#include "objbase.h"
35#include "rpc.h"
36#include "rpcproxy.h"
37
38#include "wine/exception.h"
39#include "wine/asm.h"
40#include "wine/debug.h"
41
42#include "cpsf.h"
43#include "ndr_misc.h"
44#include "ndr_stubless.h"
45
47
48#define NDR_TABLE_MASK 127
49
50static inline BOOL is_oicf_stubdesc(const PMIDL_STUB_DESC pStubDesc)
51{
52 return pStubDesc->Version >= 0x20000;
53}
54
55static inline void call_buffer_sizer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory,
56 const NDR_PARAM_OIF *param)
57{
58 PFORMAT_STRING pFormat;
60
61 if (param->attr.IsBasetype)
62 {
63 pFormat = &param->u.type_format_char;
64 if (param->attr.IsSimpleRef) pMemory = *(unsigned char **)pMemory;
65 }
66 else
67 {
68 pFormat = &pStubMsg->StubDesc->pFormatTypes[param->u.type_offset];
69 if (!param->attr.IsByValue) pMemory = *(unsigned char **)pMemory;
70 }
71
72 m = NdrBufferSizer[pFormat[0] & NDR_TABLE_MASK];
73 if (m) m(pStubMsg, pMemory, pFormat);
74 else
75 {
76 FIXME("format type 0x%x not implemented\n", pFormat[0]);
78 }
79}
80
81static inline unsigned char *call_marshaller(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory,
82 const NDR_PARAM_OIF *param)
83{
84 PFORMAT_STRING pFormat;
86
87 if (param->attr.IsBasetype)
88 {
89 pFormat = &param->u.type_format_char;
90 if (param->attr.IsSimpleRef) pMemory = *(unsigned char **)pMemory;
91 }
92 else
93 {
94 pFormat = &pStubMsg->StubDesc->pFormatTypes[param->u.type_offset];
95 if (!param->attr.IsByValue) pMemory = *(unsigned char **)pMemory;
96 }
97
98 m = NdrMarshaller[pFormat[0] & NDR_TABLE_MASK];
99 if (m) return m(pStubMsg, pMemory, pFormat);
100 else
101 {
102 FIXME("format type 0x%x not implemented\n", pFormat[0]);
104 return NULL;
105 }
106}
107
108static inline unsigned char *call_unmarshaller(PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory,
109 const NDR_PARAM_OIF *param, unsigned char fMustAlloc)
110{
111 PFORMAT_STRING pFormat;
113
114 if (param->attr.IsBasetype)
115 {
116 pFormat = &param->u.type_format_char;
117 if (param->attr.IsSimpleRef) ppMemory = (unsigned char **)*ppMemory;
118 }
119 else
120 {
121 pFormat = &pStubMsg->StubDesc->pFormatTypes[param->u.type_offset];
122 if (!param->attr.IsByValue) ppMemory = (unsigned char **)*ppMemory;
123 }
124
125 m = NdrUnmarshaller[pFormat[0] & NDR_TABLE_MASK];
126 if (m) return m(pStubMsg, ppMemory, pFormat, fMustAlloc);
127 else
128 {
129 FIXME("format type 0x%x not implemented\n", pFormat[0]);
131 return NULL;
132 }
133}
134
135static inline void call_freer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory,
136 const NDR_PARAM_OIF *param)
137{
138 PFORMAT_STRING pFormat;
139 NDR_FREE m;
140
141 if (param->attr.IsBasetype) return; /* nothing to do */
142 pFormat = &pStubMsg->StubDesc->pFormatTypes[param->u.type_offset];
143 if (!param->attr.IsByValue) pMemory = *(unsigned char **)pMemory;
144
145 m = NdrFreer[pFormat[0] & NDR_TABLE_MASK];
146 if (m) m(pStubMsg, pMemory, pFormat);
147}
148
150{
151 DWORD size;
152 switch(*pFormat)
153 {
154 case FC_RP:
155 if (pFormat[1] & FC_SIMPLE_POINTER)
156 {
157 size = 0;
158 break;
159 }
160 size = calc_arg_size(pStubMsg, &pFormat[2] + *(const SHORT*)&pFormat[2]);
161 break;
162 case FC_STRUCT:
163 case FC_PSTRUCT:
164 size = *(const WORD*)(pFormat + 2);
165 break;
166 case FC_BOGUS_STRUCT:
167 size = *(const WORD*)(pFormat + 2);
168 if(*(const WORD*)(pFormat + 4))
169 FIXME("Unhandled conformant description\n");
170 break;
171 case FC_CARRAY:
172 case FC_CVARRAY:
173 size = *(const WORD*)(pFormat + 2);
174 ComputeConformance(pStubMsg, NULL, pFormat + 4, 0);
175 size *= pStubMsg->MaxCount;
176 break;
177 case FC_SMFARRAY:
178 case FC_SMVARRAY:
179 size = *(const WORD*)(pFormat + 2);
180 break;
181 case FC_LGFARRAY:
182 case FC_LGVARRAY:
183 size = *(const DWORD*)(pFormat + 2);
184 break;
185 case FC_BOGUS_ARRAY:
186 pFormat = ComputeConformance(pStubMsg, NULL, pFormat + 4, *(const WORD*)&pFormat[2]);
187 TRACE("conformance = %Id\n", pStubMsg->MaxCount);
188 pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount);
189 size = ComplexStructSize(pStubMsg, pFormat);
190 size *= pStubMsg->MaxCount;
191 break;
192 case FC_USER_MARSHAL:
193 size = *(const WORD*)(pFormat + 4);
194 break;
195 case FC_CSTRING:
196 size = *(const WORD*)(pFormat + 2);
197 break;
198 case FC_WSTRING:
199 size = *(const WORD*)(pFormat + 2) * sizeof(WCHAR);
200 break;
201 case FC_C_CSTRING:
202 case FC_C_WSTRING:
203 if (*pFormat == FC_C_CSTRING)
204 size = sizeof(CHAR);
205 else
206 size = sizeof(WCHAR);
207 if (pFormat[1] == FC_STRING_SIZED)
208 ComputeConformance(pStubMsg, NULL, pFormat + 2, 0);
209 else
210 pStubMsg->MaxCount = 0;
211 size *= pStubMsg->MaxCount;
212 break;
214 {
215 DWORD offset = *(const WORD *)(pFormat + 6 + pStubMsg->CorrDespIncrement);
216 size = *(const WORD *)(pFormat + 8 + pStubMsg->CorrDespIncrement + offset);
217 break;
218 }
219 default:
220 FIXME("Unhandled type %02x\n", *pFormat);
221 /* fallthrough */
222 case FC_UP:
223 case FC_OP:
224 case FC_FP:
225 case FC_IP:
226 size = sizeof(void *);
227 break;
228 }
229 return size;
230}
231
233{
234#if 0 /* these functions are not defined yet */
235 pMessage->pfnAllocate = NdrRpcSmClientAllocate;
236 pMessage->pfnFree = NdrRpcSmClientFree;
237#endif
238}
239
240static const char *debugstr_PROC_PF(PARAM_ATTRIBUTES param_attributes)
241{
242 char buffer[160];
243
244 buffer[0] = 0;
245 if (param_attributes.MustSize) strcat(buffer, " MustSize");
246 if (param_attributes.MustFree) strcat(buffer, " MustFree");
247 if (param_attributes.IsPipe) strcat(buffer, " IsPipe");
248 if (param_attributes.IsIn) strcat(buffer, " IsIn");
249 if (param_attributes.IsOut) strcat(buffer, " IsOut");
250 if (param_attributes.IsReturn) strcat(buffer, " IsReturn");
251 if (param_attributes.IsBasetype) strcat(buffer, " IsBasetype");
252 if (param_attributes.IsByValue) strcat(buffer, " IsByValue");
253 if (param_attributes.IsSimpleRef) strcat(buffer, " IsSimpleRef");
254 if (param_attributes.IsDontCallFreeInst) strcat(buffer, " IsDontCallFreeInst");
255 if (param_attributes.SaveForAsyncFinish) strcat(buffer, " SaveForAsyncFinish");
256 if (param_attributes.ServerAllocSize)
257 sprintf( buffer + strlen(buffer), " ServerAllocSize = %d", param_attributes.ServerAllocSize * 8);
258 return buffer[0] ? wine_dbg_sprintf( "%s", buffer + 1 ) : "";
259}
260
262{
263 char buffer[160];
264
265 buffer[0] = 0;
266 if (Oi2Flags.ServerMustSize) strcat(buffer, " ServerMustSize");
267 if (Oi2Flags.ClientMustSize) strcat(buffer, " ClientMustSize");
268 if (Oi2Flags.HasReturn) strcat(buffer, " HasReturn");
269 if (Oi2Flags.HasPipes) strcat(buffer, " HasPipes");
270 if (Oi2Flags.Unused) strcat(buffer, " Unused");
271 if (Oi2Flags.HasAsyncUuid) strcat(buffer, " HasAsyncUuid");
272 if (Oi2Flags.HasExtensions) strcat(buffer, " HasExtensions");
273 if (Oi2Flags.HasAsyncHandle) strcat(buffer, " HasAsyncHandle");
274 return buffer[0] ? wine_dbg_sprintf( "%s", buffer + 1 ) : "";
275}
276
277#define ARG_FROM_OFFSET(args, offset) ((args) + (offset))
278
280{
281 if (!proc_header->handle_type)
282 {
284 return sizeof(NDR_EHD_PRIMITIVE);
285 else if (*format == FC_BIND_GENERIC)
286 return sizeof(NDR_EHD_GENERIC);
287 else if (*format == FC_BIND_CONTEXT)
288 return sizeof(NDR_EHD_CONTEXT);
289 }
290 return 0;
291}
292
294 const NDR_PROC_HEADER *pProcHeader, const PFORMAT_STRING pFormat)
295{
296 /* binding */
297 switch (pProcHeader->handle_type)
298 {
299 /* explicit binding: parse additional section */
300 case 0:
301 switch (*pFormat) /* handle_type */
302 {
303 case FC_BIND_PRIMITIVE: /* explicit primitive */
304 {
305 const NDR_EHD_PRIMITIVE *pDesc = (const NDR_EHD_PRIMITIVE *)pFormat;
306
307 TRACE("Explicit primitive handle @ %d\n", pDesc->offset);
308
309 if (pDesc->flag) /* pointer to binding */
310 return **(handle_t **)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
311 else
312 return *(handle_t *)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
313 }
314 case FC_BIND_GENERIC: /* explicit generic */
315 {
316 const NDR_EHD_GENERIC *pDesc = (const NDR_EHD_GENERIC *)pFormat;
317 void *pObject = NULL;
318 void *pArg;
319 const GENERIC_BINDING_ROUTINE_PAIR *pGenPair;
320
321 TRACE("Explicit generic binding handle #%d\n", pDesc->binding_routine_pair_index);
322
324 pArg = *(void **)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
325 else
326 pArg = ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
327 memcpy(&pObject, pArg, pDesc->flag_and_size & 0xf);
328 pGenPair = &pStubMsg->StubDesc->aGenericBindingRoutinePairs[pDesc->binding_routine_pair_index];
329 return pGenPair->pfnBind(pObject);
330 }
331 case FC_BIND_CONTEXT: /* explicit context */
332 {
333 const NDR_EHD_CONTEXT *pDesc = (const NDR_EHD_CONTEXT *)pFormat;
334 NDR_CCONTEXT context_handle;
335 TRACE("Explicit bind context\n");
336 if (pDesc->flags & HANDLE_PARAM_IS_VIA_PTR)
337 {
338 TRACE("\tHANDLE_PARAM_IS_VIA_PTR\n");
339 context_handle = **(NDR_CCONTEXT **)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
340 }
341 else
342 context_handle = *(NDR_CCONTEXT *)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
343
344 if (context_handle) return NDRCContextBinding(context_handle);
346 {
347 ERR("null context handle isn't allowed\n");
349 }
350 /* FIXME: should we store this structure in stubMsg.pContext? */
351 return NULL;
352 }
353 default:
354 ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
356 }
357 break;
358 case FC_BIND_GENERIC: /* implicit generic */
359 FIXME("FC_BIND_GENERIC\n");
360 RpcRaiseException(RPC_X_BAD_STUB_DATA); /* FIXME: remove when implemented */
361 break;
362 case FC_BIND_PRIMITIVE: /* implicit primitive */
363 TRACE("Implicit primitive handle\n");
364 return *pStubMsg->StubDesc->IMPLICIT_HANDLE_INFO.pPrimitiveHandle;
365 case FC_CALLBACK_HANDLE: /* implicit callback */
366 TRACE("FC_CALLBACK_HANDLE\n");
367 /* server calls callback procedures only in response to remote call, and most recent
368 binding handle is used. Calling back to a client can potentially result in another
369 callback with different current handle. */
371 case FC_AUTO_HANDLE: /* implicit auto handle */
372 /* strictly speaking, it isn't necessary to set hBinding here
373 * since it isn't actually used (hence the automatic in its name),
374 * but then why does MIDL generate a valid entry in the
375 * MIDL_STUB_DESC for it? */
376 TRACE("Implicit auto handle\n");
377 return *pStubMsg->StubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle;
378 default:
379 ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
381 }
382 return NULL;
383}
384
386 PMIDL_STUB_MESSAGE pStubMsg, const NDR_PROC_HEADER *pProcHeader,
388{
389 /* binding */
390 switch (pProcHeader->handle_type)
391 {
392 /* explicit binding: parse additional section */
393 case 0:
394 switch (*pFormat) /* handle_type */
395 {
396 case FC_BIND_GENERIC: /* explicit generic */
397 {
398 const NDR_EHD_GENERIC *pDesc = (const NDR_EHD_GENERIC *)pFormat;
399 void *pObject = NULL;
400 void *pArg;
401 const GENERIC_BINDING_ROUTINE_PAIR *pGenPair;
402
403 TRACE("Explicit generic binding handle #%d\n", pDesc->binding_routine_pair_index);
404
406 pArg = *(void **)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
407 else
408 pArg = ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset);
409 memcpy(&pObject, pArg, pDesc->flag_and_size & 0xf);
410 pGenPair = &pStubMsg->StubDesc->aGenericBindingRoutinePairs[pDesc->binding_routine_pair_index];
411#ifdef __REACTOS__
412 if (hBinding) pGenPair->pfnUnbind(pObject, hBinding);
413#else
414 pGenPair->pfnUnbind(pObject, hBinding);
415#endif
416 break;
417 }
418 case FC_BIND_CONTEXT: /* explicit context */
419 case FC_BIND_PRIMITIVE: /* explicit primitive */
420 break;
421 default:
422 ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
424 }
425 break;
426 case FC_BIND_GENERIC: /* implicit generic */
427 FIXME("FC_BIND_GENERIC\n");
428 RpcRaiseException(RPC_X_BAD_STUB_DATA); /* FIXME: remove when implemented */
429 break;
430 case FC_CALLBACK_HANDLE: /* implicit callback */
431 case FC_BIND_PRIMITIVE: /* implicit primitive */
432 case FC_AUTO_HANDLE: /* implicit auto handle */
433 break;
434 default:
435 ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
437 }
438}
439
441{
442 return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue;
443}
444
446{
447 return attr.IsOut && !attr.IsIn && attr.IsBasetype && attr.IsSimpleRef;
448}
449
450static size_t basetype_arg_size( unsigned char fc )
451{
452 switch (fc)
453 {
454 case FC_BYTE:
455 case FC_CHAR:
456 case FC_SMALL:
457 case FC_USMALL:
458 return sizeof(char);
459 case FC_WCHAR:
460 case FC_SHORT:
461 case FC_USHORT:
462 return sizeof(short);
463 case FC_LONG:
464 case FC_ULONG:
465 case FC_ENUM16:
466 case FC_ENUM32:
468 return sizeof(int);
469 case FC_FLOAT:
470 return sizeof(float);
471 case FC_HYPER:
472 return sizeof(LONGLONG);
473 case FC_DOUBLE:
474 return sizeof(double);
475 case FC_INT3264:
476 case FC_UINT3264:
477 return sizeof(INT_PTR);
478 default:
479 FIXME("Unhandled basetype %#x.\n", fc);
480 return 0;
481 }
482}
483
485 BOOLEAN fpu_args, unsigned short number_of_params, unsigned char *pRetVal )
486{
487 const NDR_PARAM_OIF *params = (const NDR_PARAM_OIF *)pFormat;
488 unsigned int i;
489
490 for (i = 0; i < number_of_params; i++)
491 {
492 unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
493 PFORMAT_STRING pTypeFormat = (PFORMAT_STRING)&pStubMsg->StubDesc->pFormatTypes[params[i].u.type_offset];
494
495#ifndef __i386__ /* floats are passed as doubles through varargs functions */
496 float f;
497
498 if (params[i].attr.IsBasetype &&
499 params[i].u.type_format_char == FC_FLOAT &&
500 !params[i].attr.IsSimpleRef &&
501 !fpu_args)
502 {
503 f = *(double *)pArg;
504 pArg = (unsigned char *)&f;
505 }
506#endif
507
508 TRACE("param[%d]: %p type %02x %s\n", i, pArg,
509 params[i].attr.IsBasetype ? params[i].u.type_format_char : *pTypeFormat,
511
512 switch (phase)
513 {
514 case STUBLESS_INITOUT:
515 if (*(unsigned char **)pArg)
516 {
518 memset( *(unsigned char **)pArg, 0, calc_arg_size( pStubMsg, pTypeFormat ));
520 memset( *(unsigned char **)pArg, 0, basetype_arg_size( params[i].u.type_format_char ));
521 }
522 break;
524 if (params[i].attr.IsSimpleRef && !*(unsigned char **)pArg)
526 if (params[i].attr.IsIn) call_buffer_sizer(pStubMsg, pArg, &params[i]);
527 break;
528 case STUBLESS_MARSHAL:
529 if (params[i].attr.IsIn) call_marshaller(pStubMsg, pArg, &params[i]);
530 break;
532 if (params[i].attr.IsOut)
533 {
534 if (params[i].attr.IsReturn && pRetVal) pArg = pRetVal;
535 call_unmarshaller(pStubMsg, &pArg, &params[i], 0);
536 }
537 break;
538 case STUBLESS_FREE:
539 if (!params[i].attr.IsBasetype && params[i].attr.IsOut && !params[i].attr.IsByValue)
540 NdrClearOutParameters( pStubMsg, pTypeFormat, *(unsigned char **)pArg );
541 break;
542 default:
544 }
545 }
546}
547
548static unsigned int type_stack_size(unsigned char fc)
549{
550 switch (fc)
551 {
552 case FC_BYTE:
553 case FC_CHAR:
554 case FC_SMALL:
555 case FC_USMALL:
556 case FC_WCHAR:
557 case FC_SHORT:
558 case FC_USHORT:
559 case FC_LONG:
560 case FC_ULONG:
561 case FC_INT3264:
562 case FC_UINT3264:
563 case FC_ENUM16:
564 case FC_ENUM32:
565 case FC_FLOAT:
567 case FC_IGNORE:
568 return sizeof(void *);
569 case FC_DOUBLE:
570 return sizeof(double);
571 case FC_HYPER:
572 return sizeof(ULONGLONG);
573 default:
574 ERR("invalid base type 0x%x\n", fc);
576 }
577}
578
580{
581 switch (*format)
582 {
583 case FC_USER_MARSHAL:
584 case FC_STRUCT:
585 case FC_PSTRUCT:
586 case FC_CSTRUCT:
587 case FC_CPSTRUCT:
588 case FC_CVSTRUCT:
589 case FC_BOGUS_STRUCT:
590 return TRUE;
591 default:
592 return FALSE;
593 }
594}
595
597 unsigned int stack_size, BOOL object_proc,
598 void *buffer, unsigned int size, unsigned int *count )
599{
601 unsigned int i, stack_offset = object_proc ? sizeof(void *) : 0;
602
603 for (i = 0; stack_offset < stack_size; i++)
604 {
605 const NDR_PARAM_OI_BASETYPE *param = (const NDR_PARAM_OI_BASETYPE *)pFormat;
606 const NDR_PARAM_OI_OTHER *other = (const NDR_PARAM_OI_OTHER *)pFormat;
607
608 if (i + 1 > size / sizeof(*args))
609 {
610 FIXME( "%u args not supported\n", i );
612 }
613
614 args[i].stack_offset = stack_offset;
615 memset( &args[i].attr, 0, sizeof(args[i].attr) );
616
617 switch (param->param_direction)
618 {
620 args[i].attr.IsIn = 1;
621 args[i].attr.IsBasetype = 1;
622 break;
624 args[i].attr.IsOut = 1;
625 args[i].attr.IsReturn = 1;
626 args[i].attr.IsBasetype = 1;
627 break;
628 case FC_IN_PARAM:
629 args[i].attr.IsIn = 1;
630 args[i].attr.MustFree = 1;
631 break;
633 args[i].attr.IsIn = 1;
634 args[i].attr.IsDontCallFreeInst = 1;
635 break;
636 case FC_IN_OUT_PARAM:
637 args[i].attr.IsIn = 1;
638 args[i].attr.IsOut = 1;
639 args[i].attr.MustFree = 1;
640 break;
641 case FC_OUT_PARAM:
642 args[i].attr.IsOut = 1;
643 break;
644 case FC_RETURN_PARAM:
645 args[i].attr.IsOut = 1;
646 args[i].attr.IsReturn = 1;
647 break;
648 }
649 if (args[i].attr.IsBasetype)
650 {
651 args[i].u.type_format_char = param->type_format_char;
652 stack_offset += type_stack_size( param->type_format_char );
653 pFormat += sizeof(NDR_PARAM_OI_BASETYPE);
654 }
655 else
656 {
657 args[i].u.type_offset = other->type_offset;
658 args[i].attr.IsByValue = is_by_value( &pStubMsg->StubDesc->pFormatTypes[other->type_offset] );
659 stack_offset += other->stack_size * sizeof(void *);
660 pFormat += sizeof(NDR_PARAM_OI_OTHER);
661 }
662 }
663 *count = i;
664 return (PFORMAT_STRING)args;
665}
666
668{
673 void *This;
676};
677
679{
680 struct ndr_client_call_ctx *ctx = arg;
681
682 if (ctx->ext_flags.HasNewCorrDesc)
683 {
684 /* free extra correlation package */
685 NdrCorrelationFree(ctx->stub_msg);
686 }
687
688 if (ctx->Oif_flags.HasPipes)
689 {
690 /* NdrPipesDone(...) */
691 }
692
693 /* free the full pointer translation tables */
694 if (ctx->proc_header->Oi_flags & Oi_FULL_PTR_USED)
695 NdrFullPointerXlatFree(ctx->stub_msg->FullPtrXlatTables);
696
697 /* free marshalling buffer */
698 if (ctx->proc_header->Oi_flags & Oi_OBJECT_PROC)
699 NdrProxyFreeBuffer(ctx->This, ctx->stub_msg);
700 else
701 {
702 NdrFreeBuffer(ctx->stub_msg);
703 client_free_handle(ctx->stub_msg, ctx->proc_header, ctx->handle_format, ctx->hbinding);
704 }
705}
706
707/* Helper for NdrpClientCall2, to factor out the part that may or may not be
708 * guarded by a try/except block. */
711 unsigned short procedure_number, unsigned short stack_size, unsigned int number_of_params,
713{
714 struct ndr_client_call_ctx finally_ctx;
717 /* the value to return to the client from the remote procedure */
718 LONG_PTR retval = 0;
719 /* the pointer to the object when in OLE mode */
720 void *This = NULL;
721 /* correlation cache */
722 ULONG_PTR NdrCorrCache[256];
723
724 /* create the full pointer translation tables, if requested */
727
729 {
730 /* object is always the first argument */
731 This = stack_top[0];
732 NdrProxyInitialize(This, &rpc_msg, stub_msg, stub_desc, procedure_number);
733 }
734
735 finally_ctx.stub_msg = stub_msg;
736 finally_ctx.Oif_flags = Oif_flags;
737 finally_ctx.ext_flags = ext_flags;
738 finally_ctx.proc_header = proc_header;
739 finally_ctx.This = This;
740 finally_ctx.handle_format = handle_format;
741 finally_ctx.hbinding = hbinding;
742
743 __TRY
744 {
746 NdrClientInitializeNew(&rpc_msg, stub_msg, stub_desc, procedure_number);
747
748 stub_msg->StackTop = (unsigned char *)stack_top;
749
750 /* we only need a handle if this isn't an object method */
753
755
756 /* store the RPC flags away */
758 rpc_msg.RpcFlags = ((const NDR_PROC_HEADER_RPC *)proc_header)->rpc_flags;
759
760 /* use alternate memory allocation routines */
763
765 {
766 FIXME("pipes not supported yet\n");
767 RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */
768 /* init pipes package */
769 /* NdrPipesInitialize(...) */
770 }
772 {
773 /* initialize extra correlation package */
774 NdrCorrelationInitialize(stub_msg, NdrCorrCache, sizeof(NdrCorrCache), 0);
775 if (ext_flags.Unused & 0x2) /* has range on conformance */
777 }
778
779 /* order of phases:
780 * 1. INITOUT - zero [out] parameters (proxies only)
781 * 2. CALCSIZE - calculate the buffer size
782 * 3. GETBUFFER - allocate the buffer
783 * 4. MARSHAL - marshal [in] params into the buffer
784 * 5. SENDRECEIVE - send/receive buffer
785 * 6. UNMARSHAL - unmarshal [out] params from buffer
786 * 7. FREE - clear [out] parameters (for proxies, and only on error)
787 */
788
789 /* 1. INITOUT */
791 {
792 TRACE( "INITOUT\n" );
794 number_of_params, (unsigned char *)&retval);
795 }
796
797 /* 2. CALCSIZE */
798 TRACE( "CALCSIZE\n" );
800 number_of_params, (unsigned char *)&retval);
801
802 /* 3. GETBUFFER */
803 TRACE( "GETBUFFER\n" );
806 else if (Oif_flags.HasPipes)
807 FIXME("pipes not supported yet\n");
809#if 0
811#else
812 FIXME("using auto handle - call NdrNsGetBuffer when it gets implemented\n");
813#endif
814 else
816
817 /* 4. MARSHAL */
818 TRACE( "MARSHAL\n" );
820 number_of_params, (unsigned char *)&retval);
821
822 /* 5. SENDRECEIVE */
823 TRACE( "SENDRECEIVE\n" );
826 else if (Oif_flags.HasPipes)
827 /* NdrPipesSendReceive(...) */
828 FIXME("pipes not supported yet\n");
830#if 0
831 NdrNsSendReceive(stub_msg, stub_msg->Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle);
832#else
833 FIXME("using auto handle - call NdrNsSendReceive when it gets implemented\n");
834#endif
835 else
837
838 /* convert strings, floating point values and endianness into our
839 * preferred format */
840 if ((rpc_msg.DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
842
843 /* 6. UNMARSHAL */
844 TRACE( "UNMARSHAL\n" );
846 number_of_params, (unsigned char *)&retval);
847 }
849
850 return retval;
851}
852
854 void **stack_top, BOOLEAN fpu_args )
855{
856 /* pointer to start of stack where arguments start */
857 MIDL_STUB_MESSAGE stubMsg;
858 /* procedure number */
859 unsigned short procedure_number;
860 /* size of stack */
861 unsigned short stack_size;
862 /* number of parameters. optional for client to give it to us */
863 unsigned int number_of_params;
864 /* cache of Oif_flags from v2 procedure header */
866 /* cache of extension flags from NDR_PROC_HEADER_EXTS */
868 /* header for procedure string */
869 const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
870 /* the value to return to the client from the remote procedure */
871 LONG_PTR RetVal = 0;
872 PFORMAT_STRING pHandleFormat;
873 NDR_PARAM_OIF old_args[256];
874
875 TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
876
877 TRACE("NDR Version: 0x%lx\n", pStubDesc->Version);
878
879 if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS)
880 {
881 const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0];
882 stack_size = header_rpc->stack_size;
883 procedure_number = header_rpc->proc_num;
884 pFormat += sizeof(NDR_PROC_HEADER_RPC);
885 }
886 else
887 {
888 stack_size = pProcHeader->stack_size;
889 procedure_number = pProcHeader->proc_num;
890 pFormat += sizeof(NDR_PROC_HEADER);
891 }
892 TRACE("stack size: 0x%x\n", stack_size);
893 TRACE("proc num: %d\n", procedure_number);
894 TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
895 TRACE("MIDL stub version = 0x%lx\n", pStubDesc->MIDLVersion);
896
897 pHandleFormat = pFormat;
898
899 /* we only need a handle if this isn't an object method */
900 if (!(pProcHeader->Oi_flags & Oi_OBJECT_PROC))
901 pFormat += get_handle_desc_size(pProcHeader, pFormat);
902
903 if (is_oicf_stubdesc(pStubDesc)) /* -Oicf format */
904 {
905 const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader =
906 (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
907
908 Oif_flags = pOIFHeader->Oi2Flags;
909 number_of_params = pOIFHeader->number_of_params;
910
911 pFormat += sizeof(NDR_PROC_PARTIAL_OIF_HEADER);
912
913 TRACE("Oif_flags = %s\n", debugstr_INTERPRETER_OPT_FLAGS(Oif_flags) );
914
916 {
917 const NDR_PROC_HEADER_EXTS *pExtensions = (const NDR_PROC_HEADER_EXTS *)pFormat;
918 ext_flags = pExtensions->Flags2;
919 pFormat += pExtensions->Size;
920 }
921 }
922 else
923 {
924 pFormat = convert_old_args( &stubMsg, pFormat, stack_size,
925 pProcHeader->Oi_flags & Oi_OBJECT_PROC,
926 old_args, sizeof(old_args), &number_of_params );
927 }
928
929 if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
930 {
931 __TRY
932 {
933 RetVal = ndr_client_call(pStubDesc, pFormat, pHandleFormat,
934 stack_top, fpu_args, &stubMsg, procedure_number, stack_size,
935 number_of_params, Oif_flags, ext_flags, pProcHeader);
936 }
938 {
939 /* 7. FREE */
940 TRACE( "FREE\n" );
941 stubMsg.StackTop = (unsigned char *)stack_top;
942 client_do_args(&stubMsg, pFormat, STUBLESS_FREE, fpu_args,
943 number_of_params, (unsigned char *)&RetVal);
945 }
947 }
948 else if (pProcHeader->Oi_flags & Oi_HAS_COMM_OR_FAULT)
949 {
950 __TRY
951 {
952 RetVal = ndr_client_call(pStubDesc, pFormat, pHandleFormat,
953 stack_top, fpu_args, &stubMsg, procedure_number, stack_size,
954 number_of_params, Oif_flags, ext_flags, pProcHeader);
955 }
957 {
958 const COMM_FAULT_OFFSETS *comm_fault_offsets = &pStubDesc->CommFaultOffsets[procedure_number];
959 ULONG *comm_status;
960 ULONG *fault_status;
961
962 TRACE("comm_fault_offsets = {0x%hx, 0x%hx}\n", comm_fault_offsets->CommOffset, comm_fault_offsets->FaultOffset);
963
964 if (comm_fault_offsets->CommOffset == -1)
965 comm_status = (ULONG *)&RetVal;
966 else if (comm_fault_offsets->CommOffset >= 0)
967 comm_status = *(ULONG **)ARG_FROM_OFFSET(stubMsg.StackTop, comm_fault_offsets->CommOffset);
968 else
969 comm_status = NULL;
970
971 if (comm_fault_offsets->FaultOffset == -1)
972 fault_status = (ULONG *)&RetVal;
973 else if (comm_fault_offsets->FaultOffset >= 0)
974 fault_status = *(ULONG **)ARG_FROM_OFFSET(stubMsg.StackTop, comm_fault_offsets->FaultOffset);
975 else
976 fault_status = NULL;
977
978 NdrMapCommAndFaultStatus(&stubMsg, comm_status, fault_status,
980 }
982 }
983 else
984 {
985 RetVal = ndr_client_call(pStubDesc, pFormat, pHandleFormat,
986 stack_top, fpu_args, &stubMsg, procedure_number, stack_size,
987 number_of_params, Oif_flags, ext_flags, pProcHeader);
988 }
989
990 TRACE("RetVal = 0x%Ix\n", RetVal);
991 return RetVal;
992}
993
994#ifdef __aarch64__
996 "stp x29, x30, [sp, #-0x40]!\n\t"
997 ".seh_save_fplr_x 0x40\n\t"
998 ".seh_endprologue\n\t"
999 "stp x2, x3, [sp, #0x10]\n\t"
1000 "stp x4, x5, [sp, #0x20]\n\t"
1001 "stp x6, x7, [sp, #0x30]\n\t"
1002 "add x2, sp, #0x10\n\t" /* stack */
1003 "mov x3, #0\n\t" /* fpu_stack */
1004 "bl NdrpClientCall2\n\t"
1005 "ldp x29, x30, [sp], #0x40\n\t"
1006 "ret" )
1007#elif defined(__arm64ec__)
1009{
1010 asm( ".seh_proc \"#NdrClientCall2\"\n\t"
1011 "stp x29, x30, [sp, #-0x20]!\n\t"
1012 ".seh_save_fplr_x 0x20\n\t"
1013 ".seh_endprologue\n\t"
1014 "stp x2, x3, [x4, #-0x10]!\n\t"
1015 "mov x2, x4\n\t" /* stack */
1016 "mov x3, #0\n\t" /* fpu_stack */
1017 "bl \"#NdrpClientCall2\"\n\t"
1018 "ldp x29, x30, [sp], #0x20\n\t"
1019 "ret\n\t"
1020 ".seh_endproc" );
1021}
1022#elif defined(__arm__)
1024 "push {r2-r3}\n\t"
1025 ".seh_save_regs {r2,r3}\n\t"
1026 "push {fp,lr}\n\t"
1027 ".seh_save_regs_w {fp,lr}\n\t"
1028 ".seh_endprologue\n\t"
1029 "add r2, sp, #8\n\t" /* stack */
1030 "mov r3, #0\n\t" /* fpu_stack */
1031 "bl NdrpClientCall2\n\t"
1032 "pop {fp,lr}\n\t"
1033 "add sp, #8\n\t"
1034 "bx lr" )
1035#elif defined(__x86_64__)
1037 "subq $0x28,%rsp\n\t"
1038 __ASM_SEH(".seh_stackalloc 0x28\n\t")
1039 __ASM_SEH(".seh_endprologue\n\t")
1040 __ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
1041 "movq %r8,0x40(%rsp)\n\t"
1042 "movq %r9,0x48(%rsp)\n\t"
1043 "leaq 0x40(%rsp),%r8\n\t" /* stack */
1044 "xorq %r9,%r9\n\t" /* fpu_stack */
1045 "call " __ASM_NAME("NdrpClientCall2") "\n\t"
1046 "addq $0x28,%rsp\n\t"
1047 __ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
1048 "ret" )
1049#elif defined(__i386__)
1051 "pushl %ebp\n\t"
1052 __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
1053 __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
1054 "movl %esp,%ebp\n\t"
1055 __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
1056 "push $0\n\t" /* fpu_stack */
1057 "push 16(%ebp)\n\t" /* stack */
1058 "push 12(%ebp)\n\t" /* format */
1059 "push 8(%ebp)\n\t" /* desc */
1060 "call " __ASM_STDCALL("NdrpClientCall2",16) "\n\t"
1061 "leave\n\t"
1062 __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
1063 __ASM_CFI(".cfi_same_value %ebp\n\t")
1064 "ret" )
1065#endif
1066
1067#if defined(__aarch64__) || defined(__arm__)
1068static void **args_regs_to_stack( void **regs, void **fpu_regs, const NDR_PROC_PARTIAL_OIF_HEADER *header )
1069{
1070 static const unsigned int nb_gpregs = sizeof(void *); /* 4 gpregs on arm32, 8 on arm64 */
1071 const NDR_PROC_HEADER_EXTS *ext = (const NDR_PROC_HEADER_EXTS *)(header + 1);
1072 unsigned int i, size, count, pos, params;
1073 unsigned char *data;
1074 void **stack, **args = regs + nb_gpregs;
1075
1076 if (ext->Size < sizeof(*ext) + 3) return NULL;
1077 data = (unsigned char *)(ext + 1);
1078 params = data[0] + (data[1] << 8);
1079 if (!(stack = malloc( params * sizeof(*stack) ))) return NULL;
1080 size = min( ext->Size - sizeof(*ext) - 3, data[2] );
1081 data += 3;
1082 for (i = pos = 0; i < size; i++, pos++)
1083 {
1084 if (data[i] < 0x80) continue;
1085 else if (data[i] < 0x80 + nb_gpregs) stack[pos] = regs[data[i] - 0x80];
1086 else if (data[i] < 0x94) stack[pos] = fpu_regs[data[i] - 0x80 - nb_gpregs];
1087 else if (data[i] == 0x9d) /* repeat */
1088 {
1089 if (i + 3 >= size) break;
1090 count = data[i + 2] + (data[i + 3] << 8);
1091 memcpy( &stack[pos], &args[pos + (signed char)data[i + 1]], count * sizeof(*args) );
1092 pos += count - 1;
1093 i += 3;
1094 }
1095 else if (data[i] < 0xa0) continue;
1096 else stack[pos] = args[pos + (signed char)data[i]];
1097 }
1098 return stack;
1099}
1100#endif
1101
1102extern LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned int stack_size,
1104
1105#ifndef __i386__
1106LONG_PTR WINAPI ndr_stubless_client_call( unsigned int index, void **args, void **fpu_regs )
1107{
1108 void **this = args[0];
1109 const void **vtbl = *this;
1110 const MIDL_STUBLESS_PROXY_INFO *proxy_info = vtbl[-2];
1111 const unsigned char *format = proxy_info->ProcFormatString + proxy_info->FormatStringOffset[index];
1112 const NDR_PROC_HEADER *proc = (const NDR_PROC_HEADER *)format;
1113 void **stack_top = args;
1114 LONG_PTR ret;
1115
1116 if (is_oicf_stubdesc( proxy_info->pStubDesc ))
1117 {
1118 unsigned int hdr_size = (proc->Oi_flags & Oi_HAS_RPCFLAGS) ? sizeof(NDR_PROC_HEADER_RPC) : sizeof(NDR_PROC_HEADER);
1120
1121 if (hdr->Oi2Flags.HasExtensions)
1122 {
1123 const NDR_PROC_HEADER_EXTS *ext = (const NDR_PROC_HEADER_EXTS *)(hdr + 1);
1124 if (ext->Size > sizeof(*ext))
1125 {
1126#ifdef __x86_64__
1127 unsigned short fpu_mask = *(unsigned short *)(ext + 1);
1128 for (int i = 0; i < 4; i++, fpu_mask >>= 2) if (fpu_mask & 3) args[i] = fpu_regs[i];
1129#else
1130 stack_top = args_regs_to_stack( args, fpu_regs, hdr );
1131#endif
1132 }
1133 }
1134 }
1135
1136 ret = NdrpClientCall2( proxy_info->pStubDesc, format, stack_top, TRUE );
1137 if (stack_top != args) free( stack_top );
1138 return ret;
1139}
1140#endif /* __i386__ */
1141
1143 PFORMAT_STRING pFormat, enum stubless_phase phase,
1144 unsigned short number_of_params)
1145{
1146 const NDR_PARAM_OIF *params = (const NDR_PARAM_OIF *)pFormat;
1147 unsigned int i;
1148 LONG_PTR *retval_ptr = NULL;
1149
1150 for (i = 0; i < number_of_params; i++)
1151 {
1152 unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
1153 const unsigned char *pTypeFormat = &pStubMsg->StubDesc->pFormatTypes[params[i].u.type_offset];
1154
1155 TRACE("param[%d]: %p -> %p type %02x %s\n", i,
1156 pArg, *(unsigned char **)pArg,
1157 params[i].attr.IsBasetype ? params[i].u.type_format_char : *pTypeFormat,
1159
1160 switch (phase)
1161 {
1162 case STUBLESS_MARSHAL:
1163 if (params[i].attr.IsOut || params[i].attr.IsReturn)
1164 call_marshaller(pStubMsg, pArg, &params[i]);
1165 break;
1166 case STUBLESS_MUSTFREE:
1167 if (params[i].attr.MustFree)
1168 {
1169 call_freer(pStubMsg, pArg, &params[i]);
1170 }
1171 break;
1172 case STUBLESS_FREE:
1173 if (params[i].attr.ServerAllocSize)
1174 {
1175 free(*(void **)pArg);
1176 }
1177 else if (param_needs_alloc(params[i].attr) &&
1178 (!params[i].attr.MustFree || params[i].attr.IsSimpleRef))
1179 {
1180 if (*pTypeFormat != FC_BIND_CONTEXT) pStubMsg->pfnFree(*(void **)pArg);
1181 }
1182 break;
1183 case STUBLESS_INITOUT:
1184 if (param_needs_alloc(params[i].attr) && !params[i].attr.ServerAllocSize)
1185 {
1186 if (*pTypeFormat == FC_BIND_CONTEXT)
1187 {
1188 NDR_SCONTEXT ctxt = NdrContextHandleInitialize(pStubMsg, pTypeFormat);
1189 *(void **)pArg = NDRSContextValue(ctxt);
1190 if (params[i].attr.IsReturn) retval_ptr = (LONG_PTR *)NDRSContextValue(ctxt);
1191 }
1192 else
1193 {
1194 DWORD size = calc_arg_size(pStubMsg, pTypeFormat);
1195 if (size)
1196 {
1197 *(void **)pArg = NdrAllocate(pStubMsg, size);
1198 memset(*(void **)pArg, 0, size);
1199 }
1200 }
1201 }
1202 if (!retval_ptr && params[i].attr.IsReturn) retval_ptr = (LONG_PTR *)pArg;
1203 break;
1204 case STUBLESS_UNMARSHAL:
1205 if (params[i].attr.ServerAllocSize)
1206 *(void **)pArg = calloc(params[i].attr.ServerAllocSize, 8);
1207
1208 if (params[i].attr.IsIn)
1209 call_unmarshaller(pStubMsg, &pArg, &params[i], 0);
1210 break;
1211 case STUBLESS_CALCSIZE:
1212 if (params[i].attr.IsOut || params[i].attr.IsReturn)
1213 call_buffer_sizer(pStubMsg, pArg, &params[i]);
1214 break;
1215 default:
1217 }
1218 TRACE("\tmemory addr (after): %p -> %p\n", pArg, *(unsigned char **)pArg);
1219 }
1220 return retval_ptr;
1221}
1222
1223/***********************************************************************
1224 * NdrStubCall2 [RPCRT4.@]
1225 *
1226 * Unmarshals [in] parameters, calls either a method in an object or a server
1227 * function, marshals any [out] parameters and frees any allocated data.
1228 *
1229 * NOTES
1230 * Used by stubless MIDL-generated code.
1231 */
1233 struct IRpcStubBuffer * pThis,
1234 struct IRpcChannelBuffer * pChannel,
1235 PRPC_MESSAGE pRpcMsg,
1236 DWORD * pdwStubPhase)
1237{
1238 const MIDL_SERVER_INFO *pServerInfo;
1239 const MIDL_STUB_DESC *pStubDesc;
1240 PFORMAT_STRING pFormat;
1241 MIDL_STUB_MESSAGE stubMsg;
1242 /* pointer to start of stack to pass into stub implementation */
1243 unsigned char * args;
1244 /* size of stack */
1245 unsigned short stack_size;
1246 /* number of parameters. optional for client to give it to us */
1247 unsigned int number_of_params;
1248 /* cache of Oif_flags from v2 procedure header */
1250 /* cache of extension flags from NDR_PROC_HEADER_EXTS */
1252 /* the type of pass we are currently doing */
1253 enum stubless_phase phase;
1254 /* header for procedure string */
1255 const NDR_PROC_HEADER *pProcHeader;
1256 const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = NULL;
1257 /* location to put retval into */
1258 LONG_PTR *retval_ptr = NULL;
1259 /* correlation cache */
1260 ULONG_PTR NdrCorrCache[256];
1261 unsigned short BindingHandleOffset = (USHORT)-1;
1262
1263 TRACE("pThis %p, pChannel %p, pRpcMsg %p, pdwStubPhase %p\n", pThis, pChannel, pRpcMsg, pdwStubPhase);
1264
1265 if (pThis)
1266 pServerInfo = CStdStubBuffer_GetServerInfo(pThis);
1267 else
1268 pServerInfo = ((RPC_SERVER_INTERFACE *)pRpcMsg->RpcInterfaceInformation)->InterpreterInfo;
1269
1270 pStubDesc = pServerInfo->pStubDesc;
1271 pFormat = pServerInfo->ProcString + pServerInfo->FmtStringOffset[pRpcMsg->ProcNum];
1272 pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
1273
1274 if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
1275 NdrStubInitialize(pRpcMsg, &stubMsg, pStubDesc, pChannel);
1276 else
1277 NdrServerInitializeNew(pRpcMsg, &stubMsg, pStubDesc);
1278
1279 /* create the full pointer translation tables, if requested */
1280 if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED)
1282
1283 if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS)
1284 {
1285 const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)pFormat;
1286 pRpcMsg->RpcFlags = header_rpc->rpc_flags;
1287 stack_size = header_rpc->stack_size;
1288 pFormat += sizeof(NDR_PROC_HEADER_RPC);
1289 }
1290 else
1291 {
1292 stack_size = pProcHeader->stack_size;
1293 pFormat += sizeof(NDR_PROC_HEADER);
1294 }
1295
1296 /* use alternate memory allocation routines */
1297 if (pProcHeader->Oi_flags & Oi_RPCSS_ALLOC_USED)
1298#if 0
1299 NdrRpcSsEnableAllocate(&stubMsg);
1300#else
1301 FIXME("Set RPCSS memory allocation routines\n");
1302#endif
1303
1304 TRACE("version 0x%lx, Oi_flags %02x, stack size %x, format %p\n",
1305 pStubDesc->Version, pProcHeader->Oi_flags, stack_size, pFormat);
1306
1307 args = calloc(1, stack_size);
1308 stubMsg.StackTop = args; /* used by conformance of top-level objects */
1309
1310 /* binding */
1311 switch (pProcHeader->handle_type)
1312 {
1313 /* explicit binding: parse additional section */
1314 case 0:
1315 switch (*pFormat) /* handle_type */
1316 {
1317 case FC_BIND_PRIMITIVE: /* explicit primitive */
1318 {
1319 BindingHandleOffset = ((NDR_EHD_PRIMITIVE*)pFormat)->offset;
1320 const NDR_EHD_PRIMITIVE *pDesc = (const NDR_EHD_PRIMITIVE *)pFormat;
1321 if (pDesc->flag)
1322 **(handle_t **)ARG_FROM_OFFSET(stubMsg.StackTop, pDesc->offset) = pRpcMsg->Handle;
1323 else
1324 *(handle_t *)ARG_FROM_OFFSET(stubMsg.StackTop, pDesc->offset) = pRpcMsg->Handle;
1325 pFormat += sizeof(NDR_EHD_PRIMITIVE);
1326 break;
1327 }
1328 case FC_BIND_GENERIC: /* explicit generic */
1329 BindingHandleOffset = ((NDR_EHD_GENERIC*)pFormat)->offset;
1330 pFormat += sizeof(NDR_EHD_GENERIC);
1331 break;
1332 case FC_BIND_CONTEXT: /* explicit context */
1333 BindingHandleOffset = ((NDR_EHD_CONTEXT*)pFormat)->offset;
1334 pFormat += sizeof(NDR_EHD_CONTEXT);
1335 break;
1336 default:
1337 ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
1339 }
1340 break;
1341 case FC_BIND_GENERIC: /* implicit generic */
1342 case FC_BIND_PRIMITIVE: /* implicit primitive */
1343 case FC_CALLBACK_HANDLE: /* implicit callback */
1344 case FC_AUTO_HANDLE: /* implicit auto handle */
1345 break;
1346 default:
1347 ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
1349 }
1350
1351 /* add the implicit This pointer as the first arg to the function if we
1352 * are calling an object method */
1353 if (pThis)
1354 *(void **)args = ((CStdStubBuffer *)pThis)->pvServerObject;
1355
1356 /* add the binding handle to the stack if we are using explicit binding handles */
1357 if (BindingHandleOffset != (USHORT)-1)
1358 *(RPC_BINDING_HANDLE*)&(args[BindingHandleOffset]) = pRpcMsg->Handle;
1359
1360 if (is_oicf_stubdesc(pStubDesc))
1361 {
1362 pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
1363 Oif_flags = pOIFHeader->Oi2Flags;
1364 number_of_params = pOIFHeader->number_of_params;
1365
1366 pFormat += sizeof(NDR_PROC_PARTIAL_OIF_HEADER);
1367
1368 TRACE("Oif_flags = %s\n", debugstr_INTERPRETER_OPT_FLAGS(Oif_flags) );
1369
1371 {
1372 const NDR_PROC_HEADER_EXTS *extensions = (const NDR_PROC_HEADER_EXTS *)pFormat;
1373 ext_flags = extensions->Flags2;
1374 pFormat += extensions->Size;
1375 }
1376
1377 if (Oif_flags.HasPipes)
1378 {
1379 FIXME("pipes not supported yet\n");
1380 RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */
1381 /* init pipes package */
1382 /* NdrPipesInitialize(...) */
1383 }
1385 {
1386 /* initialize extra correlation package */
1387 NdrCorrelationInitialize(&stubMsg, NdrCorrCache, sizeof(NdrCorrCache), 0);
1388 if (ext_flags.Unused & 0x2) /* has range on conformance */
1389 stubMsg.CorrDespIncrement = 12;
1390 }
1391 }
1392 else
1393 {
1394 pFormat = convert_old_args( &stubMsg, pFormat, stack_size,
1395 pProcHeader->Oi_flags & Oi_OBJECT_PROC,
1396 /* reuse the correlation cache, it's not needed for v1 format */
1397 NdrCorrCache, sizeof(NdrCorrCache), &number_of_params );
1398 }
1399
1400 /* convert strings, floating point values and endianness into our
1401 * preferred format */
1402 if ((pRpcMsg->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
1403 NdrConvert(&stubMsg, pFormat);
1404
1405 for (phase = STUBLESS_UNMARSHAL; phase <= STUBLESS_FREE; phase++)
1406 {
1407 TRACE("phase = %d\n", phase);
1408 switch (phase)
1409 {
1411 /* call the server function */
1412 if (pServerInfo->ThunkTable && pServerInfo->ThunkTable[pRpcMsg->ProcNum])
1413 pServerInfo->ThunkTable[pRpcMsg->ProcNum](&stubMsg);
1414 else
1415 {
1418
1419 if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
1420 {
1421 SERVER_ROUTINE *vtbl = *(SERVER_ROUTINE **)((CStdStubBuffer *)pThis)->pvServerObject;
1422 func = vtbl[pRpcMsg->ProcNum];
1423 }
1424 else
1425 func = pServerInfo->DispatchTable[pRpcMsg->ProcNum];
1426
1427 retval = call_server_func(func, args, stack_size, pOIFHeader);
1428
1429 if (retval_ptr)
1430 {
1431 TRACE("stub implementation returned 0x%Ix\n", retval);
1432 *retval_ptr = retval;
1433 }
1434 else
1435 TRACE("void stub implementation\n");
1436 }
1437
1438 stubMsg.Buffer = NULL;
1439 stubMsg.BufferLength = 0;
1440
1441 break;
1442 case STUBLESS_GETBUFFER:
1443 if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
1444 NdrStubGetBuffer(pThis, pChannel, &stubMsg);
1445 else
1446 {
1448
1449 pRpcMsg->BufferLength = stubMsg.BufferLength;
1450 /* allocate buffer for [out] and [ret] params */
1451 Status = I_RpcGetBuffer(pRpcMsg);
1452 if (Status)
1454 stubMsg.Buffer = pRpcMsg->Buffer;
1455 }
1456 break;
1457 case STUBLESS_UNMARSHAL:
1458 case STUBLESS_INITOUT:
1459 case STUBLESS_CALCSIZE:
1460 case STUBLESS_MARSHAL:
1461 case STUBLESS_MUSTFREE:
1462 case STUBLESS_FREE:
1463 retval_ptr = stub_do_args(&stubMsg, pFormat, phase, number_of_params);
1464 break;
1465 default:
1466 ERR("shouldn't reach here. phase %d\n", phase);
1467 break;
1468 }
1469 }
1470
1471 pRpcMsg->BufferLength = (unsigned int)(stubMsg.Buffer - (unsigned char *)pRpcMsg->Buffer);
1472
1474 {
1475 /* free extra correlation package */
1476 NdrCorrelationFree(&stubMsg);
1477 }
1478
1479 if (Oif_flags.HasPipes)
1480 {
1481 /* NdrPipesDone(...) */
1482 }
1483
1484 /* free the full pointer translation tables */
1485 if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED)
1487
1488 /* free server function stack */
1489 free(args);
1490
1491 return S_OK;
1492}
1493
1494/***********************************************************************
1495 * NdrServerCall2 [RPCRT4.@]
1496 */
1498{
1499 DWORD dwPhase;
1500 NdrStubCall2(NULL, NULL, pRpcMsg, &dwPhase);
1501}
1502
1503/***********************************************************************
1504 * NdrStubCall [RPCRT4.@]
1505 */
1507 PRPC_MESSAGE msg, DWORD *phase )
1508{
1509 return NdrStubCall2( This, channel, msg, phase );
1510}
1511
1512/***********************************************************************
1513 * NdrServerCall [RPCRT4.@]
1514 */
1516{
1517 DWORD phase;
1518 NdrStubCall( NULL, NULL, msg, &phase );
1519}
1520
1521/***********************************************************************
1522 * NdrServerCallAll [RPCRT4.@]
1523 */
1525{
1526 FIXME("%p stub\n", msg);
1527}
1528
1529/* Helper for ndr_async_client_call, to factor out the part that may or may not be
1530 * guarded by a try/except block. */
1531static void do_ndr_async_client_call( const MIDL_STUB_DESC *pStubDesc, PFORMAT_STRING pFormat, void **stack_top )
1532{
1533 /* pointer to start of stack where arguments start */
1534 PRPC_MESSAGE pRpcMsg;
1535 PMIDL_STUB_MESSAGE pStubMsg;
1536 RPC_ASYNC_STATE *pAsync;
1538 /* procedure number */
1539 unsigned short procedure_number;
1540 /* cache of Oif_flags from v2 procedure header */
1541 INTERPRETER_OPT_FLAGS Oif_flags = { 0 };
1542 /* cache of extension flags from NDR_PROC_HEADER_EXTS */
1543 INTERPRETER_OPT_FLAGS2 ext_flags = { 0 };
1544 /* header for procedure string */
1545 const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
1547
1548 /* Later NDR language versions probably won't be backwards compatible */
1549 if (pStubDesc->Version > 0x60001)
1550 {
1551 FIXME("Incompatible stub description version: 0x%lx\n", pStubDesc->Version);
1553 }
1554
1558
1560 pRpcMsg = (PRPC_MESSAGE)(pStubMsg + 1);
1561
1563 {
1564 const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0];
1565 async_call_data->stack_size = header_rpc->stack_size;
1566 procedure_number = header_rpc->proc_num;
1567 pFormat += sizeof(NDR_PROC_HEADER_RPC);
1568 }
1569 else
1570 {
1572 procedure_number = pProcHeader->proc_num;
1573 pFormat += sizeof(NDR_PROC_HEADER);
1574 }
1575 TRACE("stack size: 0x%x\n", async_call_data->stack_size);
1576 TRACE("proc num: %d\n", procedure_number);
1577
1578 /* create the full pointer translation tables, if requested */
1581
1583 {
1584 ERR("objects not supported\n");
1587 }
1588
1589 NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDesc, procedure_number);
1590
1591 TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
1592 TRACE("MIDL stub version = 0x%lx\n", pStubDesc->MIDLVersion);
1593
1594 /* needed for conformance of top-level objects */
1597
1598 pAsync = *(RPC_ASYNC_STATE **)pStubMsg->StackTop;
1599 pAsync->StubInfo = async_call_data;
1600 async_call_data->pHandleFormat = pFormat;
1601
1602 TRACE("pAsync %p, pAsync->StubInfo %p, NotificationType %d\n", pAsync, pAsync->StubInfo, pAsync->NotificationType);
1603
1604 pFormat += get_handle_desc_size(pProcHeader, pFormat);
1606 if (!async_call_data->hBinding) return;
1607
1608 if (is_oicf_stubdesc(pStubDesc))
1609 {
1610 const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader =
1611 (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
1612
1613 Oif_flags = pOIFHeader->Oi2Flags;
1615
1616 pFormat += sizeof(NDR_PROC_PARTIAL_OIF_HEADER);
1617
1618 TRACE("Oif_flags = %s\n", debugstr_INTERPRETER_OPT_FLAGS(Oif_flags) );
1619
1620 if (Oif_flags.HasExtensions)
1621 {
1622 const NDR_PROC_HEADER_EXTS *pExtensions =
1623 (const NDR_PROC_HEADER_EXTS *)pFormat;
1624 ext_flags = pExtensions->Flags2;
1625 pFormat += pExtensions->Size;
1626 }
1627 }
1628 else
1629 {
1634 }
1635
1636 async_call_data->pParamFormat = pFormat;
1637
1639
1640 /* store the RPC flags away */
1642 pRpcMsg->RpcFlags = ((const NDR_PROC_HEADER_RPC *)pProcHeader)->rpc_flags;
1643
1644 /* use alternate memory allocation routines */
1647
1648 if (Oif_flags.HasPipes)
1649 {
1650 FIXME("pipes not supported yet\n");
1651 RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */
1652 /* init pipes package */
1653 /* NdrPipesInitialize(...) */
1654 }
1655 if (ext_flags.HasNewCorrDesc)
1656 {
1657 /* initialize extra correlation package */
1659 if (ext_flags.Unused & 0x2) /* has range on conformance */
1661 }
1662
1663 /* order of phases:
1664 * 1. CALCSIZE - calculate the buffer size
1665 * 2. GETBUFFER - allocate the buffer
1666 * 3. MARSHAL - marshal [in] params into the buffer
1667 * 4. SENDRECEIVE - send buffer
1668 * Then in NdrpCompleteAsyncClientCall:
1669 * 1. SENDRECEIVE - receive buffer
1670 * 2. UNMARSHAL - unmarshal [out] params from buffer
1671 */
1672
1673 /* 1. CALCSIZE */
1674 TRACE( "CALCSIZE\n" );
1676
1677 /* 2. GETBUFFER */
1678 TRACE( "GETBUFFER\n" );
1679 if (Oif_flags.HasPipes)
1680 /* NdrGetPipeBuffer(...) */
1681 FIXME("pipes not supported yet\n");
1682 else
1683 {
1685#if 0
1687#else
1688 FIXME("using auto handle - call NdrNsGetBuffer when it gets implemented\n");
1689#endif
1690 else
1692 }
1693 pRpcMsg->RpcFlags |= RPC_BUFFER_ASYNC;
1694 status = I_RpcAsyncSetHandle(pRpcMsg, pAsync);
1695 if (status != RPC_S_OK)
1697
1698 /* 3. MARSHAL */
1699 TRACE( "MARSHAL\n" );
1701
1702 /* 4. SENDRECEIVE */
1703 TRACE( "SEND\n" );
1704 pRpcMsg->RpcFlags |= RPC_BUFFER_ASYNC;
1705 /* send the [in] params only */
1706 if (Oif_flags.HasPipes)
1707 /* NdrPipesSend(...) */
1708 FIXME("pipes not supported yet\n");
1709 else
1710 {
1712#if 0
1713 NdrNsSend(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle);
1714#else
1715 FIXME("using auto handle - call NdrNsSend when it gets implemented\n");
1716#endif
1717 else
1718 {
1719 pStubMsg->RpcMsg->BufferLength = pStubMsg->Buffer - (unsigned char *)pStubMsg->RpcMsg->Buffer;
1721 if (status != RPC_S_OK)
1723 }
1724 }
1725}
1726
1728 void **stack_top )
1729{
1730 LONG_PTR ret = 0;
1731 const NDR_PROC_HEADER *pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
1732
1733 TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
1734
1736 {
1737 __TRY
1738 {
1739 do_ndr_async_client_call( pStubDesc, pFormat, stack_top );
1740 }
1742 {
1743 FIXME("exception %lx during ndr_async_client_call()\n", GetExceptionCode());
1745 }
1746 __ENDTRY
1747 }
1748 else
1749 do_ndr_async_client_call( pStubDesc, pFormat, stack_top);
1750
1751 TRACE("returning %Id\n", ret);
1752 return ret;
1753}
1754
1756{
1757 /* pointer to start of stack where arguments start */
1760 /* header for procedure string */
1763
1764 if (!pAsync->StubInfo)
1766
1767 async_call_data = pAsync->StubInfo;
1770
1771 /* order of phases:
1772 * 1. CALCSIZE - calculate the buffer size
1773 * 2. GETBUFFER - allocate the buffer
1774 * 3. MARSHAL - marshal [in] params into the buffer
1775 * 4. SENDRECEIVE - send buffer
1776 * Then in NdrpCompleteAsyncClientCall:
1777 * 1. SENDRECEIVE - receive buffer
1778 * 2. UNMARSHAL - unmarshal [out] params from buffer
1779 */
1780
1781 /* 1. SENDRECEIVE */
1782 TRACE( "RECEIVE\n" );
1784 /* receive the [out] params */
1786#if 0
1787 NdrNsReceive(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle);
1788#else
1789 FIXME("using auto handle - call NdrNsReceive when it gets implemented\n");
1790#endif
1791 else
1792 {
1794 if (status != RPC_S_OK)
1795 goto cleanup;
1800 }
1801
1802 /* convert strings, floating point values and endianness into our
1803 * preferred format */
1804#if 0
1806 NdrConvert(pStubMsg, pFormat);
1807#endif
1808
1809 /* 2. UNMARSHAL */
1810 TRACE( "UNMARSHAL\n" );
1813
1814cleanup:
1816 {
1817 /* free extra correlation package */
1819 }
1820
1821 /* free the full pointer translation tables */
1824
1825 /* free marshalling buffer */
1828
1831
1832 TRACE("-- 0x%lx\n", status);
1833 return status;
1834}
1835
1836#ifdef __aarch64__
1838 "stp x29, x30, [sp, #-0x40]!\n\t"
1839 ".seh_save_fplr_x 0x40\n\t"
1840 ".seh_endprologue\n\t"
1841 "stp x2, x3, [sp, #0x10]\n\t"
1842 "stp x4, x5, [sp, #0x20]\n\t"
1843 "stp x6, x7, [sp, #0x30]\n\t"
1844 "add x2, sp, #0x10\n\t" /* stack */
1845 "mov x3, #0\n\t" /* fpu_stack */
1846 "bl ndr_async_client_call\n\t"
1847 "ldp x29, x30, [sp], #0x40\n\t"
1848 "ret" )
1849#elif defined(__arm64ec__)
1851{
1852 asm( ".seh_proc \"#NdrAsyncClientCall\"\n\t"
1853 "stp x29, x30, [sp, #-0x20]!\n\t"
1854 ".seh_save_fplr_x 0x20\n\t"
1855 ".seh_endprologue\n\t"
1856 "stp x2, x3, [x4, #-0x10]!\n\t"
1857 "mov x2, x4\n\t" /* stack */
1858 "mov x3, #0\n\t" /* fpu_stack */
1859 "bl \"#ndr_async_client_call\"\n\t"
1860 "ldp x29, x30, [sp], #0x20\n\t"
1861 "ret\n\t"
1862 ".seh_endproc" );
1863}
1864#elif defined(__arm__)
1866 "push {r2-r3}\n\t"
1867 ".seh_save_regs {r2,r3}\n\t"
1868 "push {fp,lr}\n\t"
1869 ".seh_save_regs_w {fp,lr}\n\t"
1870 ".seh_endprologue\n\t"
1871 "add r2, sp, #8\n\t" /* stack */
1872 "mov r3, #0\n\t" /* fpu_stack */
1873 "bl ndr_async_client_call\n\t"
1874 "pop {fp,lr}\n\t"
1875 "add sp, #8\n\t"
1876 "bx lr" )
1877#elif defined(__x86_64__)
1879 "subq $0x28,%rsp\n\t"
1880 __ASM_SEH(".seh_stackalloc 0x28\n\t")
1881 __ASM_SEH(".seh_endprologue\n\t")
1882 __ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
1883 "movq %r8,0x40(%rsp)\n\t"
1884 "movq %r9,0x48(%rsp)\n\t"
1885 "leaq 0x40(%rsp),%r8\n\t" /* stack */
1886 "xorq %r9,%r9\n\t" /* fpu_stack */
1887 "call " __ASM_NAME("ndr_async_client_call") "\n\t"
1888 "addq $0x28,%rsp\n\t"
1889 __ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
1890 "ret" )
1891#elif defined(__i386__)
1893 "pushl %ebp\n\t"
1894 __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
1895 __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
1896 "movl %esp,%ebp\n\t"
1897 __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
1898 "push $0\n\t" /* fpu_stack */
1899 "push 16(%ebp)\n\t" /* stack */
1900 "push 12(%ebp)\n\t" /* format */
1901 "push 8(%ebp)\n\t" /* desc */
1902 "call " __ASM_NAME("ndr_async_client_call") "\n\t"
1903 "leave\n\t"
1904 __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
1905 __ASM_CFI(".cfi_same_value %ebp\n\t")
1906 "ret" )
1907#endif
1908
1910 struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg,
1911 DWORD * pdwStubPhase)
1912{
1913 FIXME("unimplemented, expect crash!\n");
1914 return 0;
1915}
1916
1918{
1919 const MIDL_SERVER_INFO *pServerInfo;
1920 const MIDL_STUB_DESC *pStubDesc;
1921 PFORMAT_STRING pFormat;
1922 /* pointer to start of stack to pass into stub implementation */
1923 unsigned char *args;
1924 /* header for procedure string */
1926 const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = NULL;
1928 PRPC_ASYNC_STATE pAsync;
1930
1931 TRACE("%p\n", pRpcMsg);
1932
1933 pServerInfo = ((RPC_SERVER_INTERFACE *)pRpcMsg->RpcInterfaceInformation)->InterpreterInfo;
1934
1935 pStubDesc = pServerInfo->pStubDesc;
1936 pFormat = pServerInfo->ProcString + pServerInfo->FmtStringOffset[pRpcMsg->ProcNum];
1937 pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
1938
1939 TRACE("NDR Version: 0x%lx\n", pStubDesc->Version);
1940
1944
1946 *(PRPC_MESSAGE)(async_call_data->pStubMsg + 1) = *pRpcMsg;
1947
1949 {
1950 const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0];
1951 async_call_data->stack_size = header_rpc->stack_size;
1952 pFormat += sizeof(NDR_PROC_HEADER_RPC);
1953 }
1954 else
1955 {
1957 pFormat += sizeof(NDR_PROC_HEADER);
1958 }
1959
1960 TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
1961
1962 /* binding */
1963 switch (pProcHeader->handle_type)
1964 {
1965 /* explicit binding: parse additional section */
1966 case 0:
1967 switch (*pFormat) /* handle_type */
1968 {
1969 case FC_BIND_PRIMITIVE: /* explicit primitive */
1970 pFormat += sizeof(NDR_EHD_PRIMITIVE);
1971 break;
1972 case FC_BIND_GENERIC: /* explicit generic */
1973 pFormat += sizeof(NDR_EHD_GENERIC);
1974 break;
1975 case FC_BIND_CONTEXT: /* explicit context */
1976 pFormat += sizeof(NDR_EHD_CONTEXT);
1977 break;
1978 default:
1979 ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
1981 }
1982 break;
1983 case FC_BIND_GENERIC: /* implicit generic */
1984 case FC_BIND_PRIMITIVE: /* implicit primitive */
1985 case FC_CALLBACK_HANDLE: /* implicit callback */
1986 case FC_AUTO_HANDLE: /* implicit auto handle */
1987 break;
1988 default:
1989 ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
1991 }
1992
1994 {
1995 ERR("objects not supported\n");
1998 }
1999
2000 NdrServerInitializeNew(pRpcMsg, async_call_data->pStubMsg, pStubDesc);
2001
2002 /* create the full pointer translation tables, if requested */
2005
2006 /* use alternate memory allocation routines */
2008#if 0
2009 NdrRpcSsEnableAllocate(&stubMsg);
2010#else
2011 FIXME("Set RPCSS memory allocation routines\n");
2012#endif
2013
2014 TRACE("allocating memory for stack of size %x\n", async_call_data->stack_size);
2015
2017 async_call_data->pStubMsg->StackTop = args; /* used by conformance of top-level objects */
2018
2019 pAsync = I_RpcAllocate(sizeof(*pAsync));
2020 if (!pAsync) RpcRaiseException(RPC_X_NO_MEMORY);
2021
2022 status = RpcAsyncInitializeHandle(pAsync, sizeof(*pAsync));
2023 if (status != RPC_S_OK)
2025
2026 pAsync->StubInfo = async_call_data;
2027 TRACE("pAsync %p, pAsync->StubInfo %p, pFormat %p\n", pAsync, pAsync->StubInfo, async_call_data->pHandleFormat);
2028
2029 /* add the implicit pAsync pointer as the first arg to the function */
2030 *(void **)args = pAsync;
2031
2032 if (is_oicf_stubdesc(pStubDesc))
2033 {
2034 INTERPRETER_OPT_FLAGS2 ext_flags = { 0 };
2035
2036 pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
2038
2039 pFormat += sizeof(NDR_PROC_PARTIAL_OIF_HEADER);
2040
2041 TRACE("Oif_flags = %s\n", debugstr_INTERPRETER_OPT_FLAGS(pOIFHeader->Oi2Flags) );
2042
2043 if (pOIFHeader->Oi2Flags.HasExtensions)
2044 {
2045 const NDR_PROC_HEADER_EXTS *extensions = (const NDR_PROC_HEADER_EXTS *)pFormat;
2046 ext_flags = extensions->Flags2;
2047 pFormat += extensions->Size;
2048 }
2049
2050 if (pOIFHeader->Oi2Flags.HasPipes)
2051 {
2052 FIXME("pipes not supported yet\n");
2053 RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */
2054 /* init pipes package */
2055 /* NdrPipesInitialize(...) */
2056 }
2057 if (ext_flags.HasNewCorrDesc)
2058 {
2059 /* initialize extra correlation package */
2061 if (ext_flags.Unused & 0x2) /* has range on conformance */
2063 }
2064 }
2065 else
2066 {
2069 /* reuse the correlation cache, it's not needed for v1 format */
2071 }
2072
2073 /* convert strings, floating point values and endianness into our
2074 * preferred format */
2075 if ((pRpcMsg->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
2077
2078 async_call_data->pHandleFormat = pFormat;
2079
2080 /* 1. UNMARSHAL */
2081 TRACE("UNMARSHAL\n");
2083
2084 /* 2. INITOUT */
2085 TRACE("INITOUT\n");
2087
2088 /* 3. CALLSERVER */
2089 TRACE("CALLSERVER\n");
2090 if (pServerInfo->ThunkTable && pServerInfo->ThunkTable[pRpcMsg->ProcNum])
2091 pServerInfo->ThunkTable[pRpcMsg->ProcNum](async_call_data->pStubMsg);
2092 else
2094 pOIFHeader);
2095}
2096
2098{
2099 /* pointer to start of stack where arguments start */
2102 /* the type of pass we are currently doing */
2103 enum stubless_phase phase;
2105
2106 if (!pAsync->StubInfo)
2108
2109 async_call_data = pAsync->StubInfo;
2111
2112 TRACE("pAsync %p, pAsync->StubInfo %p, pFormat %p\n", pAsync, pAsync->StubInfo, async_call_data->pHandleFormat);
2113
2115 {
2116 TRACE("stub implementation returned 0x%Ix\n", *(LONG_PTR *)Reply);
2117 *async_call_data->retval_ptr = *(LONG_PTR *)Reply;
2118 }
2119 else
2120 TRACE("void stub implementation\n");
2121
2122 for (phase = STUBLESS_CALCSIZE; phase <= STUBLESS_FREE; phase++)
2123 {
2124 TRACE("phase = %d\n", phase);
2125 switch (phase)
2126 {
2127 case STUBLESS_GETBUFFER:
2129 {
2130 ERR("objects not supported\n");
2133 I_RpcFree(pAsync);
2135 }
2136 else
2137 {
2139 /* allocate buffer for [out] and [ret] params */
2141 if (status)
2144 }
2145 break;
2146
2147 case STUBLESS_CALCSIZE:
2148 case STUBLESS_MARSHAL:
2149 case STUBLESS_MUSTFREE:
2150 case STUBLESS_FREE:
2152 break;
2153 default:
2154 ERR("shouldn't reach here. phase %d\n", phase);
2155 break;
2156 }
2157 }
2158
2159#if 0 /* FIXME */
2160 if (ext_flags.HasNewCorrDesc)
2161 {
2162 /* free extra correlation package */
2164 }
2165
2166 if (Oif_flags.HasPipes)
2167 {
2168 /* NdrPipesDone(...) */
2169 }
2170
2171 /* free the full pointer translation tables */
2174#endif
2175
2176 /* free server function stack */
2179 I_RpcFree(pAsync);
2180
2181 return S_OK;
2182}
2183
2185 {{0x8a885d04, 0x1ceb, 0x11c9, {0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60}}, {2, 0}};
2186
2188 ULONG proc, void *retval, void **stack_top )
2189{
2190 ULONG_PTR i;
2191
2192 TRACE("info %p, proc %lu, retval %p, stack_top %p\n", info, proc, retval, stack_top);
2193
2194 for (i = 0; i < info->nCount; ++i)
2195 {
2196 const MIDL_SYNTAX_INFO *syntax_info = &info->pSyntaxInfo[i];
2197 const RPC_SYNTAX_IDENTIFIER *id = &syntax_info->TransferSyntax;
2198
2199 TRACE("Found syntax %s, version %u.%u.\n", debugstr_guid(&id->SyntaxGUID),
2200 id->SyntaxVersion.MajorVersion, id->SyntaxVersion.MinorVersion);
2201 if (!memcmp(id, &ndr_syntax_id, sizeof(RPC_SYNTAX_IDENTIFIER)))
2202 {
2203 if (retval)
2204 FIXME("Complex return types are not supported.\n");
2205
2206 return NdrpClientCall2( info->pStubDesc,
2207 syntax_info->ProcString + syntax_info->FmtStringOffset[proc], stack_top, FALSE );
2208 }
2209 }
2210
2211 FIXME("NDR64 syntax is not supported.\n");
2212 return 0;
2213}
2214
2215#ifdef __aarch64__
2217 "stp x29, x30, [sp, #-0x40]!\n\t"
2218 ".seh_save_fplr_x 0x40\n\t"
2219 ".seh_endprologue\n\t"
2220 "str x3, [sp, #0x18]\n\t"
2221 "stp x4, x5, [sp, #0x20]\n\t"
2222 "stp x6, x7, [sp, #0x30]\n\t"
2223 "add x3, sp, #0x18\n\t" /* stack */
2224 "bl ndr64_client_call\n\t"
2225 "ldp x29, x30, [sp], #0x40\n\t"
2226 "ret" )
2227#elif defined(__arm64ec__)
2229{
2230 asm( ".seh_proc \"#NdrClientCall3\"\n\t"
2231 "stp x29, x30, [sp, #-0x20]!\n\t"
2232 ".seh_save_fplr_x 0x20\n\t"
2233 ".seh_endprologue\n\t"
2234 "str x3, [x4, #-0x8]!\n\t"
2235 "mov x3, x4\n\t" /* stack */
2236 "bl \"#ndr64_client_call\"\n\t"
2237 "ldp x29, x30, [sp], #0x20\n\t"
2238 "ret\n\t"
2239 ".seh_endproc" );
2240}
2241#elif defined(__x86_64__)
2243 "subq $0x28,%rsp\n\t"
2244 __ASM_SEH(".seh_stackalloc 0x28\n\t")
2245 __ASM_SEH(".seh_endprologue\n\t")
2246 __ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
2247 "movq %r9,0x48(%rsp)\n\t"
2248 "leaq 0x48(%rsp),%r9\n\t" /* stack */
2249 "call " __ASM_NAME("ndr64_client_call") "\n\t"
2250 "addq $0x28,%rsp\n\t"
2251 __ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
2252 "ret" )
2253#endif
2254
2256 ULONG proc, void *retval, void **stack_top, void **fpu_stack )
2257{
2258 ULONG_PTR i;
2259
2260 TRACE("info %p, proc %lu, retval %p, stack_top %p, fpu_stack %p\n",
2261 info, proc, retval, stack_top, fpu_stack);
2262
2263 for (i = 0; i < info->nCount; ++i)
2264 {
2265 const MIDL_SYNTAX_INFO *syntax_info = &info->pSyntaxInfo[i];
2266 const RPC_SYNTAX_IDENTIFIER *id = &syntax_info->TransferSyntax;
2267
2268 TRACE("Found syntax %s, version %u.%u.\n", debugstr_guid(&id->SyntaxGUID),
2269 id->SyntaxVersion.MajorVersion, id->SyntaxVersion.MinorVersion);
2270 if (!memcmp(id, &ndr_syntax_id, sizeof(RPC_SYNTAX_IDENTIFIER)))
2271 {
2272 if (retval)
2273 FIXME("Complex return types are not supported.\n");
2274
2275 return ndr_async_client_call( info->pStubDesc,
2276 syntax_info->ProcString + syntax_info->FmtStringOffset[proc], stack_top );
2277 }
2278 }
2279
2280 FIXME("NDR64 syntax is not supported.\n");
2281 return 0;
2282}
2283
2284#ifdef __aarch64__
2286 "stp x29, x30, [sp, #-0x40]!\n\t"
2287 ".seh_save_fplr_x 0x40\n\t"
2288 ".seh_endprologue\n\t"
2289 "str x3, [sp, #0x18]\n\t"
2290 "stp x4, x5, [sp, #0x20]\n\t"
2291 "stp x6, x7, [sp, #0x30]\n\t"
2292 "add x3, sp, #0x18\n\t" /* stack */
2293 "mov x4, #0\n\t" /* fpu_stack */
2294 "bl ndr64_async_client_call\n\t"
2295 "ldp x29, x30, [sp], #0x40\n\t"
2296 "ret" )
2297#elif defined(__arm64ec__)
2299{
2300 asm( ".seh_proc \"#Ndr64AsyncClientCall\"\n\t"
2301 "stp x29, x30, [sp, #-0x20]!\n\t"
2302 ".seh_save_fplr_x 0x20\n\t"
2303 ".seh_endprologue\n\t"
2304 "str x3, [x4, #-0x8]!\n\t"
2305 "mov x3, x4\n\t" /* stack */
2306 "mov x4, #0\n\t" /* fpu_stack */
2307 "bl \"#ndr64_async_client_call\"\n\t"
2308 "ldp x29, x30, [sp], #0x20\n\t"
2309 "ret\n\t"
2310 ".seh_endproc" );
2311}
2312#elif defined(__x86_64__)
2314 "subq $0x28,%rsp\n\t"
2315 __ASM_SEH(".seh_stackalloc 0x28\n\t")
2316 __ASM_SEH(".seh_endprologue\n\t")
2317 __ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
2318 "movq %r9,0x48(%rsp)\n\t"
2319 "leaq 0x48(%rsp),%r9\n\t" /* stack */
2320 "movq $0,0x20(%rsp)\n\t" /* fpu_stack */
2321 "call " __ASM_NAME("ndr64_async_client_call") "\n\t"
2322 "addq $0x28,%rsp\n\t"
2323 __ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
2324 "ret" )
2325#endif
unsigned char BOOLEAN
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define __cdecl
Definition: accygwin.h:79
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define CHAR(Char)
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
PFOR_CONTEXT fc
Definition: for.c:57
void WINAPI NdrProxyGetBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:286
void WINAPI NdrProxyInitialize(void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum)
Definition: cproxy.c:266
void WINAPI NdrProxyFreeBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:348
void WINAPI NdrProxySendReceive(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:314
HRESULT WINAPI NdrProxyErrorHandler(DWORD dwExceptionCode)
Definition: cproxy.c:366
const MIDL_SERVER_INFO * CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface)
Definition: cstub.c:411
handle_t hBinding
Definition: ctx_c.c:54
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define __attribute__(x)
Definition: wpp_private.h:207
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
#define CDECL
Definition: compat.h:29
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define CALLBACK
Definition: compat.h:35
static const WCHAR *const ext[]
Definition: module.c:53
static void cleanup(void)
Definition: main.c:1335
void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, LPRPCCHANNELBUFFER pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cstub.c:451
void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, LPRPCCHANNELBUFFER pRpcChannelBuffer)
Definition: cstub.c:435
void WINAPI NdrCorrelationFree(PMIDL_STUB_MESSAGE pStubMsg)
NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
void WINAPI NdrClearOutParameters(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, void *ArgAddr)
ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
const NDR_BUFFERSIZE NdrBufferSizer[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:259
const NDR_MARSHALL NdrMarshaller[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:171
void *WINAPI NdrAllocate(MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len)
Definition: ndr_marshall.c:418
void WINAPI NdrCorrelationInitialize(PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags)
const NDR_UNMARSHALL NdrUnmarshaller[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:215
void WINAPI NdrConvert(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
const NDR_FREE NdrFreer[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:347
RPC_STATUS WINAPI RpcAsyncInitializeHandle(PRPC_ASYNC_STATE pAsync, unsigned int Size)
Definition: rpc_async.c:57
unsigned char
Definition: typeof.h:29
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
return ret
Definition: mutex.c:146
static jsval_t stack_top(script_ctx_t *ctx)
Definition: engine.c:104
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxMemoryObject * pMemory
FxObject * pObject
Status
Definition: gdiplustypes.h:25
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum func
Definition: glext.h:6028
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint index
Definition: glext.h:6031
GLfloat f
Definition: glext.h:7540
GLenum const GLfloat * params
Definition: glext.h:5645
GLfloat param
Definition: glext.h:5796
GLuint id
Definition: glext.h:5910
const GLfloat * m
Definition: glext.h:10848
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
Definition: glfuncs.h:248
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 * u
Definition: glfuncs.h:240
#define GetExceptionCode
Definition: excpt.h:83
#define S_OK
Definition: intsafe.h:52
char hdr[14]
Definition: iptest.cpp:33
#define debugstr_guid
Definition: kernel32.h:35
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintf
Definition: sprintf.c:45
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1204
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:91
static float(__cdecl *square_half_float)(float x
#define __ASM_NAME(name)
Definition: config.h:934
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
#define min(a, b)
Definition: monoChain.cc:55
int other
Definition: msacm.c:1376
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
void WINAPI NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum)
unsigned char *WINAPI NdrServerInitializeNew(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc)
RPC_STATUS RPC_ENTRY NdrMapCommAndFaultStatus(PMIDL_STUB_MESSAGE pStubMsg, ULONG *pCommStatus, ULONG *pFaultStatus, RPC_STATUS Status)
void WINAPI NdrFreeBuffer(PMIDL_STUB_MESSAGE pStubMsg)
unsigned char *WINAPI NdrGetBuffer(PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle)
unsigned char *WINAPI NdrSendReceive(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer)
RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext)
void WINAPI NdrFullPointerXlatFree(PFULL_PTR_XLAT_TABLES pXlatTables)
PFULL_PTR_XLAT_TABLES WINAPI NdrFullPointerXlatInit(ULONG NumberOfPointers, XLAT_SIDE XlatSide)
void(WINAPI * NDR_BUFFERSIZE)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:55
static PFORMAT_STRING ComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:37
unsigned char *(WINAPI * NDR_UNMARSHALL)(PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char)
Definition: ndr_misc.h:54
static PFORMAT_STRING ComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:42
unsigned char *(WINAPI * NDR_MARSHALL)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:53
void(WINAPI * NDR_FREE)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:57
static unsigned char * call_unmarshaller(PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, const NDR_PARAM_OIF *param, unsigned char fMustAlloc)
Definition: ndr_stubless.c:108
static BOOL param_needs_alloc(PARAM_ATTRIBUTES attr)
Definition: ndr_stubless.c:440
#define ARG_FROM_OFFSET(args, offset)
Definition: ndr_stubless.c:277
LONG_PTR CDECL ndr64_async_client_call(MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, void **stack_top, void **fpu_stack)
static void call_freer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, const NDR_PARAM_OIF *param)
Definition: ndr_stubless.c:135
static BOOL is_oicf_stubdesc(const PMIDL_STUB_DESC pStubDesc)
Definition: ndr_stubless.c:50
static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
Definition: ndr_stubless.c:149
static BOOL is_by_value(PFORMAT_STRING format)
Definition: ndr_stubless.c:579
void WINAPI NdrServerCall(PRPC_MESSAGE msg)
LONG WINAPI NdrStubCall(struct IRpcStubBuffer *This, struct IRpcChannelBuffer *channel, PRPC_MESSAGE msg, DWORD *phase)
LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char *args, unsigned int stack_size, const NDR_PROC_PARTIAL_OIF_HEADER *header)
static handle_t client_get_handle(const MIDL_STUB_MESSAGE *pStubMsg, const NDR_PROC_HEADER *pProcHeader, const PFORMAT_STRING pFormat)
Definition: ndr_stubless.c:293
static LONG_PTR ndr_client_call(const MIDL_STUB_DESC *stub_desc, const PFORMAT_STRING format, const PFORMAT_STRING handle_format, void **stack_top, BOOLEAN fpu_args, MIDL_STUB_MESSAGE *stub_msg, unsigned short procedure_number, unsigned short stack_size, unsigned int number_of_params, INTERPRETER_OPT_FLAGS Oif_flags, INTERPRETER_OPT_FLAGS2 ext_flags, const NDR_PROC_HEADER *proc_header)
Definition: ndr_stubless.c:709
LONG_PTR WINAPI ndr_stubless_client_call(unsigned int index, void **args, void **fpu_regs)
RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply)
static const char * debugstr_INTERPRETER_OPT_FLAGS(INTERPRETER_OPT_FLAGS Oi2Flags)
Definition: ndr_stubless.c:261
void client_do_args(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, BOOLEAN fpu_args, unsigned short number_of_params, unsigned char *pRetVal)
Definition: ndr_stubless.c:484
LONG WINAPI NdrStubCall2(struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg, DWORD *pdwStubPhase)
static void client_free_handle(PMIDL_STUB_MESSAGE pStubMsg, const NDR_PROC_HEADER *pProcHeader, PFORMAT_STRING pFormat, handle_t hBinding)
Definition: ndr_stubless.c:385
void WINAPI NdrServerCallAll(PRPC_MESSAGE msg)
LONG_PTR CDECL ndr64_client_call(MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, void **stack_top)
RPCRTAPI LONG RPC_ENTRY NdrAsyncStubCall(struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg, DWORD *pdwStubPhase)
static unsigned char * call_marshaller(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, const NDR_PARAM_OIF *param)
Definition: ndr_stubless.c:81
void WINAPI NdrRpcSmSetClientToOsf(PMIDL_STUB_MESSAGE pMessage)
Definition: ndr_stubless.c:232
LONG_PTR WINAPI NdrpClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top, BOOLEAN fpu_args)
Definition: ndr_stubless.c:853
static const RPC_SYNTAX_IDENTIFIER ndr_syntax_id
static LONG_PTR * stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, unsigned short number_of_params)
static unsigned int type_stack_size(unsigned char fc)
Definition: ndr_stubless.c:548
static const char * debugstr_PROC_PF(PARAM_ATTRIBUTES param_attributes)
Definition: ndr_stubless.c:240
static BOOL param_is_out_basetype(PARAM_ATTRIBUTES attr)
Definition: ndr_stubless.c:445
LONG_PTR CDECL ndr_async_client_call(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top)
static void CALLBACK ndr_client_call_finally(BOOL normal, void *arg)
Definition: ndr_stubless.c:678
static void do_ndr_async_client_call(const MIDL_STUB_DESC *pStubDesc, PFORMAT_STRING pFormat, void **stack_top)
void WINAPI NdrServerCall2(PRPC_MESSAGE pRpcMsg)
static size_t get_handle_desc_size(const NDR_PROC_HEADER *proc_header, PFORMAT_STRING format)
Definition: ndr_stubless.c:279
PFORMAT_STRING convert_old_args(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, unsigned int stack_size, BOOL object_proc, void *buffer, unsigned int size, unsigned int *count)
Definition: ndr_stubless.c:596
#define NDR_TABLE_MASK
Definition: ndr_stubless.c:48
RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply)
static void call_buffer_sizer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, const NDR_PARAM_OIF *param)
Definition: ndr_stubless.c:55
static size_t basetype_arg_size(unsigned char fc)
Definition: ndr_stubless.c:450
void RPC_ENTRY NdrAsyncServerCall(PRPC_MESSAGE pRpcMsg)
struct _NDR_PROC_HEADER_RPC NDR_PROC_HEADER_RPC
struct _NDR_EHD_CONTEXT NDR_EHD_CONTEXT
struct _NDR_PARAM_OI_OTHER NDR_PARAM_OI_OTHER
struct _NDR_PARAM_OI_BASETYPE NDR_PARAM_OI_BASETYPE
struct _NDR_EHD_PRIMITIVE NDR_EHD_PRIMITIVE
struct _NDR_PROC_HEADER NDR_PROC_HEADER
stubless_phase
Definition: ndr_stubless.h:247
@ STUBLESS_INITOUT
Definition: ndr_stubless.h:249
@ STUBLESS_GETBUFFER
Definition: ndr_stubless.h:252
@ STUBLESS_MARSHAL
Definition: ndr_stubless.h:253
@ STUBLESS_CALCSIZE
Definition: ndr_stubless.h:251
@ STUBLESS_UNMARSHAL
Definition: ndr_stubless.h:248
@ STUBLESS_CALLSERVER
Definition: ndr_stubless.h:250
@ STUBLESS_MUSTFREE
Definition: ndr_stubless.h:254
@ STUBLESS_FREE
Definition: ndr_stubless.h:255
struct _NDR_EHD_GENERIC NDR_EHD_GENERIC
struct _NDR_PROC_PARTIAL_OIF_HEADER NDR_PROC_PARTIAL_OIF_HEADER
@ normal
Definition: optimize.h:166
static HANDLE proc()
Definition: pdb.c:34
short SHORT
Definition: pedump.c:59
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define Oi_HAS_COMM_OR_FAULT
Definition: ndrtypes.h:295
#define Oi_RPCSS_ALLOC_USED
Definition: ndrtypes.h:291
#define Oi_FULL_PTR_USED
Definition: ndrtypes.h:290
#define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL
Definition: ndrtypes.h:288
@ FC_BIND_PRIMITIVE
Definition: ndrtypes.h:194
@ FC_USMALL
Definition: ndrtypes.h:138
@ FC_INT3264
Definition: ndrtypes.h:268
@ FC_STRUCT
Definition: ndrtypes.h:157
@ FC_BIND_GENERIC
Definition: ndrtypes.h:193
@ FC_SMALL
Definition: ndrtypes.h:137
@ FC_BOGUS_STRUCT
Definition: ndrtypes.h:162
@ FC_CPSTRUCT
Definition: ndrtypes.h:160
@ FC_C_CSTRING
Definition: ndrtypes.h:172
@ FC_IGNORE
Definition: ndrtypes.h:149
@ FC_DOUBLE
Definition: ndrtypes.h:146
@ FC_RETURN_PARAM_BASETYPE
Definition: ndrtypes.h:241
@ FC_SMFARRAY
Definition: ndrtypes.h:166
@ FC_USHORT
Definition: ndrtypes.h:141
@ FC_ENUM16
Definition: ndrtypes.h:147
@ FC_C_WSTRING
Definition: ndrtypes.h:175
@ FC_ERROR_STATUS_T
Definition: ndrtypes.h:150
@ FC_LONG
Definition: ndrtypes.h:142
@ FC_CHAR
Definition: ndrtypes.h:136
@ FC_OP
Definition: ndrtypes.h:154
@ FC_HYPER
Definition: ndrtypes.h:145
@ FC_LGVARRAY
Definition: ndrtypes.h:169
@ FC_CVSTRUCT
Definition: ndrtypes.h:161
@ FC_CSTRING
Definition: ndrtypes.h:176
@ FC_BOGUS_ARRAY
Definition: ndrtypes.h:170
@ FC_ULONG
Definition: ndrtypes.h:143
@ FC_AUTO_HANDLE
Definition: ndrtypes.h:195
@ FC_UP
Definition: ndrtypes.h:153
@ FC_IN_PARAM_NO_FREE_INST
Definition: ndrtypes.h:237
@ FC_CARRAY
Definition: ndrtypes.h:164
@ FC_SMVARRAY
Definition: ndrtypes.h:168
@ FC_NON_ENCAPSULATED_UNION
Definition: ndrtypes.h:182
@ FC_STRING_SIZED
Definition: ndrtypes.h:218
@ FC_RP
Definition: ndrtypes.h:152
@ FC_PSTRUCT
Definition: ndrtypes.h:158
@ FC_OUT_PARAM
Definition: ndrtypes.h:239
@ FC_WSTRING
Definition: ndrtypes.h:179
@ FC_FLOAT
Definition: ndrtypes.h:144
@ FC_USER_MARSHAL
Definition: ndrtypes.h:261
@ FC_CSTRUCT
Definition: ndrtypes.h:159
@ FC_ENUM32
Definition: ndrtypes.h:148
@ FC_BIND_CONTEXT
Definition: ndrtypes.h:191
@ FC_CVARRAY
Definition: ndrtypes.h:165
@ FC_FP
Definition: ndrtypes.h:155
@ FC_BYTE
Definition: ndrtypes.h:135
@ FC_UINT3264
Definition: ndrtypes.h:269
@ FC_CALLBACK_HANDLE
Definition: ndrtypes.h:196
@ FC_RETURN_PARAM
Definition: ndrtypes.h:240
@ FC_IP
Definition: ndrtypes.h:189
@ FC_LGFARRAY
Definition: ndrtypes.h:167
@ FC_SHORT
Definition: ndrtypes.h:140
@ FC_IN_OUT_PARAM
Definition: ndrtypes.h:238
@ FC_IN_PARAM_BASETYPE
Definition: ndrtypes.h:236
@ FC_WCHAR
Definition: ndrtypes.h:139
@ FC_IN_PARAM
Definition: ndrtypes.h:235
#define FC_SIMPLE_POINTER
Definition: ndrtypes.h:275
#define Oi_HAS_RPCFLAGS
Definition: ndrtypes.h:293
#define Oi_OBJECT_PROC
Definition: ndrtypes.h:292
#define HANDLE_PARAM_IS_VIA_PTR
Definition: ndrtypes.h:279
#define calloc
Definition: rosglue.h:14
RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg)
Definition: rpc_message.c:1634
RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
Definition: rpc_message.c:1786
RPC_STATUS WINAPI I_RpcAsyncSetHandle(PRPC_MESSAGE pMsg, PRPC_ASYNC_STATE pAsync)
Definition: rpc_message.c:1945
RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
Definition: rpc_message.c:1853
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle(void)
Definition: rpc_server.c:1743
struct _RPC_MESSAGE * PRPC_MESSAGE
#define RPC_BUFFER_ASYNC
Definition: rpcdcep.h:70
CLIENT_CALL_RETURN RPC_VAR_ENTRY Ndr64AsyncClientCall(MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval,...)
RPCRTAPI unsigned char *RPC_ENTRY NdrNsGetBuffer(PMIDL_STUB_MESSAGE pStubMsg, ULONG BufferLength, RPC_BINDING_HANDLE Handle)
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:68
struct _MIDL_STUB_MESSAGE * PMIDL_STUB_MESSAGE
RPCRTAPI void RPC_ENTRY NdrRpcSmClientFree(void *NodeToFree)
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall2(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat,...)
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrAsyncClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat,...)
RPCRTAPI unsigned char *RPC_ENTRY NdrNsSendReceive(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pBufferEnd, RPC_BINDING_HANDLE *pAutoHandle)
RPCRTAPI void *RPC_ENTRY NdrRpcSmClientAllocate(SIZE_T Size) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(NdrRpcSmClientFree) __WINE_MALLOC
RPCRTAPI void RPC_ENTRY NdrRpcSsEnableAllocate(PMIDL_STUB_MESSAGE pMessage)
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:159
#define NDRSContextValue(hContext)
Definition: rpcndr.h:115
@ XLAT_CLIENT
Definition: rpcndr.h:500
@ XLAT_SERVER
Definition: rpcndr.h:499
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall3(MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval,...)
LONG(__RPC_API * SERVER_ROUTINE)(void)
Definition: rpcndr.h:444
#define RPC_X_NO_MEMORY
Definition: rpcnterr.h:35
#define RPC_S_OK
Definition: rpcnterr.h:22
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:755
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:747
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:213
#define RPC_ENTRY
Definition: rpc.h:63
long RPC_STATUS
Definition: rpc.h:48
#define RPCRTAPI
Definition: rpc.h:78
strcat
Definition: string.h:92
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char HasNewCorrDesc
Definition: ndrtypes.h:76
unsigned char Unused
Definition: ndrtypes.h:89
unsigned char ServerMustSize
Definition: ndrtypes.h:59
unsigned char HasAsyncHandle
Definition: ndrtypes.h:70
unsigned char ClientMustSize
Definition: ndrtypes.h:61
unsigned char HasExtensions
Definition: ndrtypes.h:68
unsigned char HasReturn
Definition: ndrtypes.h:63
unsigned char HasPipes
Definition: ndrtypes.h:64
unsigned char Unused
Definition: ndrtypes.h:65
unsigned char HasAsyncUuid
Definition: ndrtypes.h:66
INTERPRETER_OPT_FLAGS2 Flags2
Definition: ndrtypes.h:99
unsigned char Size
Definition: ndrtypes.h:97
unsigned short IsReturn
Definition: ndrtypes.h:37
unsigned short IsSimpleRef
Definition: ndrtypes.h:44
unsigned short ServerAllocSize
Definition: ndrtypes.h:51
unsigned short SaveForAsyncFinish
Definition: ndrtypes.h:49
unsigned short IsPipe
Definition: ndrtypes.h:34
unsigned short MustFree
Definition: ndrtypes.h:31
unsigned short IsOut
Definition: ndrtypes.h:36
unsigned short IsBasetype
Definition: ndrtypes.h:38
unsigned short IsDontCallFreeInst
Definition: ndrtypes.h:47
unsigned short IsIn
Definition: ndrtypes.h:35
unsigned short MustSize
Definition: ndrtypes.h:28
unsigned short IsByValue
Definition: ndrtypes.h:41
GENERIC_BINDING_ROUTINE pfnBind
Definition: rpcndr.h:265
GENERIC_UNBIND_ROUTINE pfnUnbind
Definition: rpcndr.h:266
const unsigned short * FmtStringOffset
Definition: rpcndr.h:454
const STUB_THUNK * ThunkTable
Definition: rpcndr.h:455
const SERVER_ROUTINE * DispatchTable
Definition: rpcndr.h:452
PMIDL_STUB_DESC pStubDesc
Definition: rpcndr.h:451
PFORMAT_STRING ProcString
Definition: rpcndr.h:453
PFORMAT_STRING ProcFormatString
Definition: rpcndr.h:464
const unsigned short * FormatStringOffset
Definition: rpcndr.h:465
PMIDL_STUB_DESC pStubDesc
Definition: rpcndr.h:463
ULONG Version
Definition: rpcndr.h:392
union _MIDL_STUB_DESC::@3416 IMPLICIT_HANDLE_INFO
LONG MIDLVersion
Definition: rpcndr.h:394
handle_t * pAutoHandle
Definition: rpcndr.h:382
const COMM_FAULT_OFFSETS * CommFaultOffsets
Definition: rpcndr.h:395
unsigned char * StackTop
Definition: rpcndr.h:209
unsigned char CorrDespIncrement
Definition: rpcndr.h:201
unsigned char * Buffer
Definition: rpcndr.h:186
struct _FULL_PTR_XLAT_TABLES * FullPtrXlatTables
Definition: rpcndr.h:214
ULONG BufferLength
Definition: rpcndr.h:190
unsigned char * BufferEnd
Definition: rpcndr.h:188
PRPC_MESSAGE RpcMsg
Definition: rpcndr.h:185
const struct _MIDL_STUB_DESC * StubDesc
Definition: rpcndr.h:213
unsigned char * BufferStart
Definition: rpcndr.h:187
unsigned int fHasNewCorrDesc
Definition: rpcndr.h:222
ULONG_PTR MaxCount
Definition: rpcndr.h:204
PFORMAT_STRING ProcString
Definition: rpcndr.h:433
RPC_SYNTAX_IDENTIFIER TransferSyntax
Definition: rpcndr.h:431
const unsigned short * FmtStringOffset
Definition: rpcndr.h:434
unsigned char flags
Definition: ndr_stubless.h:212
unsigned short offset
Definition: ndr_stubless.h:215
unsigned char flag_and_size
Definition: ndr_stubless.h:183
unsigned short offset
Definition: ndr_stubless.h:186
unsigned char binding_routine_pair_index
Definition: ndr_stubless.h:190
unsigned short offset
Definition: ndr_stubless.h:170
unsigned char flag
Definition: ndr_stubless.h:167
unsigned int rpc_flags
Definition: ndr_stubless.h:91
unsigned short stack_size
Definition: ndr_stubless.h:93
unsigned short proc_num
Definition: ndr_stubless.h:92
unsigned char Oi_flags
Definition: ndr_stubless.h:64
unsigned char handle_type
Definition: ndr_stubless.h:43
unsigned short stack_size
Definition: ndr_stubless.h:71
unsigned short proc_num
Definition: ndr_stubless.h:67
INTERPRETER_OPT_FLAGS Oi2Flags
Definition: ndr_stubless.h:107
void * StubInfo
Definition: rpcasync.h:158
RPC_NOTIFICATION_TYPES NotificationType
Definition: rpcasync.h:162
unsigned int BufferLength
Definition: rpcdcep.h:41
unsigned int ProcNum
Definition: rpcdcep.h:42
void * RpcInterfaceInformation
Definition: rpcdcep.h:44
void * Buffer
Definition: rpcdcep.h:40
ULONG DataRepresentation
Definition: rpcdcep.h:39
RPC_BINDING_HANDLE Handle
Definition: rpcdcep.h:38
ULONG RpcFlags
Definition: rpcdcep.h:48
Definition: match.c:390
RPC_BINDING_HANDLE hBinding
Definition: ndr_stubless.h:235
MIDL_STUB_MESSAGE * pStubMsg
Definition: ndr_stubless.h:231
unsigned short stack_size
Definition: ndr_stubless.h:237
PFORMAT_STRING pHandleFormat
Definition: ndr_stubless.h:233
PFORMAT_STRING pParamFormat
Definition: ndr_stubless.h:234
ULONG_PTR NdrCorrCache[256]
Definition: ndr_stubless.h:243
unsigned int number_of_params
Definition: ndr_stubless.h:239
LONG_PTR * retval_ptr
Definition: ndr_stubless.h:241
const NDR_PROC_HEADER * pProcHeader
Definition: ndr_stubless.h:232
Definition: cookie.c:202
Definition: dsound.c:943
Definition: format.c:58
MIDL_STUB_MESSAGE * stub_msg
Definition: ndr_stubless.c:669
INTERPRETER_OPT_FLAGS2 ext_flags
Definition: ndr_stubless.c:671
PFORMAT_STRING handle_format
Definition: ndr_stubless.c:674
const NDR_PROC_HEADER * proc_header
Definition: ndr_stubless.c:672
INTERPRETER_OPT_FLAGS Oif_flags
Definition: ndr_stubless.c:670
Definition: format.c:80
Definition: ps.c:97
int32_t INT_PTR
Definition: typedefs.h:64
int64_t LONGLONG
Definition: typedefs.h:68
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
static unsigned stack_offset(compile_ctx_t *ctx)
Definition: compile.c:349
int retval
Definition: wcstombs.cpp:91
void * arg
Definition: msvc.h:10
#define WINAPI
Definition: msvc.h:6
#define __ASM_CFI(str)
Definition: asm.h:39
#define __ASM_SEH(str)
Definition: asm.h:45
#define __ASM_STDCALL(name, args)
Definition: asm.h:33
#define __EXCEPT_ALL
Definition: exception.h:65
#define __FINALLY_CTX(func, ctx)
Definition: exception.h:68
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1440
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1447
#define RPC_S_INVALID_ASYNC_HANDLE
Definition: winerror.h:1517
#define RPC_X_WRONG_STUB_VERSION
Definition: winerror.h:1493
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1444
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1431
__wchar_t WCHAR
Definition: xmlstorage.h:180