36#define NONAMELESSUNION
50# define LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32) \
51 (*((UINT32 *)(pchar)) = (uint32))
53# define LITTLE_ENDIAN_UINT32_READ(pchar) \
54 (*((UINT32 *)(pchar)))
57# define LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32) \
58 (*(pchar) = LOBYTE(LOWORD(uint32)), \
59 *((pchar)+1) = HIBYTE(LOWORD(uint32)), \
60 *((pchar)+2) = LOBYTE(HIWORD(uint32)), \
61 *((pchar)+3) = HIBYTE(HIWORD(uint32)))
63# define LITTLE_ENDIAN_UINT32_READ(pchar) \
65 MAKEWORD(*(pchar), *((pchar)+1)), \
66 MAKEWORD(*((pchar)+2), *((pchar)+3))))
69#define BIG_ENDIAN_UINT32_WRITE(pchar, uint32) \
70 (*((pchar)+3) = LOBYTE(LOWORD(uint32)), \
71 *((pchar)+2) = HIBYTE(LOWORD(uint32)), \
72 *((pchar)+1) = LOBYTE(HIWORD(uint32)), \
73 *(pchar) = HIBYTE(HIWORD(uint32)))
75#define BIG_ENDIAN_UINT32_READ(pchar) \
77 MAKEWORD(*((pchar)+3), *((pchar)+2)), \
78 MAKEWORD(*((pchar)+1), *(pchar))))
80#ifdef NDR_LOCAL_IS_BIG_ENDIAN
81# define NDR_LOCAL_UINT32_WRITE(pchar, uint32) \
82 BIG_ENDIAN_UINT32_WRITE(pchar, uint32)
83# define NDR_LOCAL_UINT32_READ(pchar) \
84 BIG_ENDIAN_UINT32_READ(pchar)
86# define NDR_LOCAL_UINT32_WRITE(pchar, uint32) \
87 LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32)
88# define NDR_LOCAL_UINT32_READ(pchar) \
89 LITTLE_ENDIAN_UINT32_READ(pchar)
123#define STD_OVERFLOW_CHECK(_Msg) do { \
124 TRACE("buffer=%d/%d\n", (ULONG)(_Msg->Buffer - (unsigned char *)_Msg->RpcMsg->Buffer), _Msg->BufferLength); \
125 if (_Msg->Buffer > (unsigned char *)_Msg->RpcMsg->Buffer + _Msg->BufferLength) \
126 ERR("buffer overflow %d bytes\n", (ULONG)(_Msg->Buffer - ((unsigned char *)_Msg->RpcMsg->Buffer + _Msg->BufferLength))); \
129#define NDR_POINTER_ID_BASE 0x20000
130#define NDR_POINTER_ID(pStubMsg) (NDR_POINTER_ID_BASE + ((pStubMsg)->UniquePtrCount++) * 4)
131#define NDR_TABLE_SIZE 128
132#define NDR_TABLE_MASK 127
163 unsigned char fMustAlloc);
400#define MEML_MAGIC ('M' << 24 | 'E' << 16 | 'M' << 8 | 'L')
426 aligned_len = (
len + 7) & ~7;
429 if (adjusted_len <
len)
431 ERR(
"overflow of adjusted_len %ld, len %ld\n", adjusted_len,
len);
435 p = pStubMsg->pfnAllocate(adjusted_len);
440 mem_list->
size = aligned_len;
458 TRACE(
"(%p, %p)\n", pStubMsg, Pointer);
460 pStubMsg->pfnFree(Pointer);
465 return (*(
const ULONG *)pFormat != -1);
480 TRACE(
"unmarshalled conformance is %ld\n", pStubMsg->
MaxCount);
506 ERR(
"invalid array bound(s): ActualCount = %d, Offset = %d, MaxValue = %d\n",
560 BYTE dtype = pFormat[0] & 0xf;
561 short ofs = *(
const short *)&pFormat[2];
571 switch (pFormat[0] & 0xf0) {
573 TRACE(
"normal conformance, ofs=%d\n", ofs);
577 TRACE(
"pointer conformance, ofs=%d\n", ofs);
581 TRACE(
"toplevel conformance, ofs=%d\n", ofs);
592 TRACE(
"constant conformance, val=%ld\n",
data);
596 FIXME(
"toplevel multidimensional conformance, ofs=%d\n", ofs);
606 FIXME(
"unknown conformance type %x, expect crash.\n", pFormat[0] & 0xf0);
610 switch (pFormat[1]) {
616 unsigned char *old_stack_top = pStubMsg->
StackTop;
622 TRACE(
"callback conformance into apfnExprEval[%d]\n", ofs);
623 pStubMsg->
StubDesc->apfnExprEval[ofs](pStubMsg);
661 FIXME(
"unknown conformance data type %x\n", dtype);
664 TRACE(
"dereferenced data type %x at %p, got %ld\n", dtype,
ptr,
data);
667 switch (pFormat[1]) {
685 FIXME(
"unknown conformance op %d\n", pFormat[1]);
690 TRACE(
"resulting conformance is %ld\n", *pCount);
705 if (
ret > 0xffffffff)
725 ERR(
"buffer length overflow - BufferLength = %u, size = %u\n",
739 ERR(
"buffer overflow - Buffer = %p, BufferEnd = %p, size = %u\n",
744 ERR(
"pointer is the same as the buffer\n");
755 ERR(
"buffer overflow - Buffer = %p, BufferEnd = %p, size = %u\n",
774 ERR(
"bufsize 0x%x exceeded buffer end %p of buffer %p\n",
bufsize,
782 ERR(
"invalid string length of %d\n",
bufsize / esize);
789 ERR(
"string not null-terminated at byte position %d, data is 0x%x\n",
798 TRACE(
" FC_ALLOCATE_ALL_NODES");
800 TRACE(
" FC_DONT_FREE");
802 TRACE(
" FC_ALLOCED_ON_STACK");
804 TRACE(
" FC_SIMPLE_POINTER");
806 TRACE(
" FC_POINTER_DEREF");
815 unsigned char *Pointer,
818 unsigned type = pFormat[0],
attr = pFormat[1];
822 BOOL pointer_needs_marshaling;
824 TRACE(
"(%p,%p,%p,%p)\n", pStubMsg,
Buffer, Pointer, pFormat);
828 else desc = pFormat + *(
const SHORT*)pFormat;
834 ERR(
"NULL ref pointer is not allowed\n");
837 pointer_needs_marshaling =
TRUE;
842 pointer_needs_marshaling =
TRUE;
844 pointer_needs_marshaling =
FALSE;
846 TRACE(
"writing 0x%08x to buffer\n", pointer_id);
852 TRACE(
"writing 0x%08x to buffer\n", pointer_id);
856 FIXME(
"unhandled ptr type=%02x\n",
type);
861 TRACE(
"calling marshaller for type 0x%x\n", (
int)*
desc);
863 if (pointer_needs_marshaling) {
865 Pointer = *(
unsigned char**)Pointer;
866 TRACE(
"deref => %p\n", Pointer);
869 if (
m)
m(pStubMsg, Pointer,
desc);
870 else FIXME(
"no marshaller for data type=%02x\n", *
desc);
885 unsigned char **pPointer,
886 unsigned char *pSrcPointer,
888 unsigned char fMustAlloc)
890 unsigned type = pFormat[0],
attr = pFormat[1];
893 DWORD pointer_id = 0;
894 BOOL pointer_needs_unmarshaling, need_alloc =
FALSE, inner_must_alloc =
FALSE;
896 TRACE(
"(%p,%p,%p,%p,%p,%d)\n", pStubMsg,
Buffer, pPointer, pSrcPointer, pFormat, fMustAlloc);
900 else desc = pFormat + *(
const SHORT*)pFormat;
904 pointer_needs_unmarshaling =
TRUE;
908 TRACE(
"pointer_id is 0x%08x\n", pointer_id);
910 pointer_needs_unmarshaling =
TRUE;
913 pointer_needs_unmarshaling =
FALSE;
918 TRACE(
"pointer_id is 0x%08x\n", pointer_id);
922 inner_must_alloc =
TRUE;
925 FIXME(
"free object pointer %p\n", pSrcPointer);
927 pointer_needs_unmarshaling =
TRUE;
931 pointer_needs_unmarshaling =
FALSE;
936 TRACE(
"pointer_id is 0x%08x\n", pointer_id);
941 FIXME(
"unhandled ptr type=%02x\n",
type);
946 if (pointer_needs_unmarshaling) {
947 unsigned char **current_ptr = pPointer;
956 TRACE(
"setting *pPointer to %p\n", pSrcPointer);
957 *pPointer = pSrcPointer;
960 need_alloc = inner_must_alloc =
TRUE;
972 *pPointer = pSrcPointer;
981 FIXME(
"FC_ALLOCATE_ALL_NODES not implemented\n");
987 current_ptr = *(
unsigned char***)current_ptr;
988 TRACE(
"deref => %p\n", current_ptr);
991 if (
m)
m(pStubMsg, current_ptr,
desc, inner_must_alloc);
992 else FIXME(
"no unmarshaller for data type=%02x\n", *
desc);
999 TRACE(
"pointer=%p\n", *pPointer);
1006 unsigned char *Pointer,
1009 unsigned type = pFormat[0],
attr = pFormat[1];
1012 BOOL pointer_needs_sizing;
1015 TRACE(
"(%p,%p,%p)\n", pStubMsg, Pointer, pFormat);
1019 else desc = pFormat + *(
const SHORT*)pFormat;
1025 ERR(
"NULL ref pointer is not allowed\n");
1038 if (!pointer_needs_sizing)
1042 FIXME(
"unhandled ptr type=%02x\n",
type);
1048 Pointer = *(
unsigned char**)Pointer;
1049 TRACE(
"deref => %p\n", Pointer);
1053 if (
m)
m(pStubMsg, Pointer,
desc);
1054 else FIXME(
"no buffersizer for data type=%02x\n", *
desc);
1063 unsigned type = pFormat[0],
attr = pFormat[1];
1066 DWORD pointer_id = 0;
1067 BOOL pointer_needs_sizing;
1073 else desc = pFormat + *(
const SHORT*)pFormat;
1077 pointer_needs_sizing =
TRUE;
1082 TRACE(
"pointer_id is 0x%08x\n", pointer_id);
1084 pointer_needs_sizing =
TRUE;
1086 pointer_needs_sizing =
FALSE;
1092 TRACE(
"pointer_id is 0x%08x\n", pointer_id);
1098 FIXME(
"unhandled ptr type=%02x\n",
type);
1109 if (pointer_needs_sizing) {
1111 if (
m)
m(pStubMsg,
desc);
1112 else FIXME(
"no memorysizer for data type=%02x\n", *
desc);
1122 unsigned char *Pointer,
1125 unsigned type = pFormat[0],
attr = pFormat[1];
1128 unsigned char *current_pointer = Pointer;
1130 TRACE(
"(%p,%p,%p)\n", pStubMsg, Pointer, pFormat);
1135 else desc = pFormat + *(
const SHORT*)pFormat;
1137 if (!Pointer)
return;
1142 if (!pointer_needs_freeing)
1147 current_pointer = *(
unsigned char**)Pointer;
1148 TRACE(
"deref => %p\n", current_pointer);
1152 if (
m)
m(pStubMsg, current_pointer,
desc);
1164 TRACE(
"not freeing stack ptr %p\n", Pointer);
1167 TRACE(
"freeing %p\n", Pointer);
1171 TRACE(
"not freeing %p\n", Pointer);
1184 unsigned char *saved_buffer =
NULL;
1193 saved_buffer = pStubMsg->
Buffer;
1198 while (pFormat[0] !=
FC_END) {
1199 switch (pFormat[0]) {
1201 FIXME(
"unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1210 rep = *(
const WORD*)&pFormat[2];
1222 for (
i = 0;
i < rep;
i++) {
1229 unsigned char *memptr = membase + *(
const SHORT*)&
info[0];
1231 unsigned char *saved_memory = pStubMsg->
Memory;
1233 pStubMsg->
Memory = membase;
1235 pStubMsg->
Memory = saved_memory;
1238 pFormat += 8 *
count;
1244 pStubMsg->
Buffer = saved_buffer;
1261 unsigned char *pDstBuffer,
1262 unsigned char *pSrcMemoryPtrs,
1264 unsigned char fMustAlloc)
1269 unsigned char *saved_buffer =
NULL;
1271 TRACE(
"(%p,%p,%p,%p,%d)\n", pStubMsg, pDstBuffer, pSrcMemoryPtrs, pFormat, fMustAlloc);
1278 saved_buffer = pStubMsg->
Buffer;
1283 while (pFormat[0] !=
FC_END) {
1284 TRACE(
"pFormat[0] = 0x%x\n", pFormat[0]);
1285 switch (pFormat[0]) {
1287 FIXME(
"unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1296 rep = *(
const WORD*)&pFormat[2];
1308 for (
i = 0;
i < rep;
i++) {
1310 unsigned char *bufdstbase = pDstBuffer + (
i *
stride);
1311 unsigned char *memsrcbase = pSrcMemoryPtrs + (
i *
stride);
1316 unsigned char **bufdstptr = (
unsigned char **)(bufdstbase + *(
const SHORT*)&
info[2]);
1317 unsigned char **memsrcptr = (
unsigned char **)(memsrcbase + *(
const SHORT*)&
info[0]);
1322 pFormat += 8 *
count;
1328 pStubMsg->
Buffer = saved_buffer;
1343 ULONG saved_buffer_length = 0;
1349 if (*pFormat !=
FC_PP)
return;
1359 while (pFormat[0] !=
FC_END) {
1360 switch (pFormat[0]) {
1362 FIXME(
"unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1371 rep = *(
const WORD*)&pFormat[2];
1383 for (
i = 0;
i < rep;
i++) {
1389 unsigned char *memptr = membase + *(
const SHORT*)&
info[0];
1390 unsigned char *saved_memory = pStubMsg->
Memory;
1392 pStubMsg->
Memory = membase;
1394 pStubMsg->
Memory = saved_memory;
1397 pFormat += 8 *
count;
1400 if (saved_buffer_length)
1416 unsigned char *saved_buffer =
NULL;
1418 TRACE(
"(%p,%p)\n", pStubMsg, pFormat);
1424 saved_buffer = pStubMsg->
Buffer;
1429 if (*pFormat !=
FC_PP)
return 0;
1432 while (pFormat[0] !=
FC_END) {
1433 switch (pFormat[0]) {
1435 FIXME(
"unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1444 rep = *(
const WORD*)&pFormat[2];
1456 for (
i = 0;
i < rep;
i++) {
1465 pFormat += 8 *
count;
1471 pStubMsg->
Buffer = saved_buffer;
1488 if (*pFormat !=
FC_PP)
return;
1491 while (pFormat[0] !=
FC_END) {
1492 switch (pFormat[0]) {
1494 FIXME(
"unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1503 rep = *(
const WORD*)&pFormat[2];
1515 for (
i = 0;
i < rep;
i++) {
1521 unsigned char *memptr = membase + *(
const SHORT*)&
info[0];
1522 unsigned char *saved_memory = pStubMsg->
Memory;
1524 pStubMsg->
Memory = membase;
1526 pStubMsg->
Memory = saved_memory;
1529 pFormat += 8 *
count;
1547 if (*pFormat !=
FC_RP)
1565 unsigned char **ppMemory,
1567 unsigned char fMustAlloc)
1571 TRACE(
"(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
1573 if (*pFormat ==
FC_RP)
1579 if (pStubMsg->
IsClient && !*ppMemory)
1581 ERR(
"NULL ref pointer is not allowed\n");
1613 if (*pFormat !=
FC_RP)
1629 if (*pFormat !=
FC_RP)
1653 unsigned char FormatChar )
1668 unsigned char FormatChar )
1670#define BASE_TYPE_UNMARSHALL(type) \
1671 align_pointer(&pStubMsg->Buffer, sizeof(type)); \
1672 TRACE("pMemory: %p\n", pMemory); \
1673 *(type *)pMemory = *(type *)pStubMsg->Buffer; \
1674 pStubMsg->Buffer += sizeof(type);
1735 FIXME(
"Unhandled base type: 0x%02x\n", FormatChar);
1737#undef BASE_TYPE_UNMARSHALL
1747 unsigned size = *(
const WORD*)(pFormat+2);
1765 unsigned char **ppMemory,
1767 unsigned char fMustAlloc)
1769 unsigned size = *(
const WORD*)(pFormat+2);
1770 unsigned char *saved_buffer;
1771 TRACE(
"(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
1779 if (!pStubMsg->
IsClient && !*ppMemory)
1781 *ppMemory = pStubMsg->
Buffer;
1789 TRACE(
"copying %p to %p\n", saved_buffer, *ppMemory);
1790 if (*ppMemory != saved_buffer)
1803 unsigned size = *(
const WORD*)(pFormat+2);
1819 unsigned short size = *(
const WORD *)(pFormat+2);
1821 TRACE(
"(%p,%p)\n", pStubMsg, pFormat);
1891 ERR(
"unknown array format 0x%x\n",
fc);
1902 unsigned char alignment;
1907 esize = *(
const WORD*)(pFormat+2);
1908 alignment = pFormat[1] + 1;
1922 esize = *(
const WORD*)(pFormat+2);
1923 alignment = pFormat[1] + 1;
1951 alignment = pFormat[1] + 1;
1963 ERR(
"unknown array format 0x%x\n",
fc);
1973 BOOL conformance_present;
2006 def = *(
const WORD *)(pFormat + 2);
2014 ERR(
"unknown array format 0x%x\n",
fc);
2025 unsigned char alignment;
2030 esize = *(
const WORD*)(pFormat+2);
2031 alignment = pFormat[1] + 1;
2046 esize = *(
const WORD*)(pFormat+2);
2047 alignment = pFormat[1] + 1;
2078 alignment = pFormat[1] + 1;
2090 ERR(
"unknown array format 0x%x\n",
fc);
2103 esize = *(
const WORD*)(pFormat+2);
2107 esize = *(
const WORD*)(pFormat+2);
2123 def = *(
const WORD *)(pFormat + 2);
2136 ERR(
"unknown array format 0x%x\n",
fc);
2144 unsigned char fUseBufferMemoryServer,
unsigned char fUnmarshall)
2148 unsigned char alignment;
2149 unsigned char *saved_buffer, *
pMemory;
2155 esize = *(
const WORD*)(pFormat+2);
2156 alignment = pFormat[1] + 1;
2170 if (fUseBufferMemoryServer && !pStubMsg->
IsClient && !*ppMemory)
2172 *ppMemory = pStubMsg->
Buffer;
2175 saved_buffer = pStubMsg->
Buffer;
2181 TRACE(
"copying %p to %p\n", saved_buffer, *ppMemory);
2182 if (*ppMemory != saved_buffer)
2187 esize = *(
const WORD*)(pFormat+2);
2188 alignment = pFormat[1] + 1;
2203 if (!fMustAlloc && !*ppMemory)
2207 saved_buffer = pStubMsg->
Buffer;
2228 ERR(
"buffer size %d must equal memory size %ld for non-sized conformant strings\n",
2234 ERR(
"conformant strings can't have Offset (%d)\n", pStubMsg->
Offset);
2249 if (fUseBufferMemoryServer && !pStubMsg->
IsClient &&
2253 *ppMemory = pStubMsg->
Buffer;
2254 else if (!*ppMemory)
2258 if (*ppMemory == pStubMsg->
Buffer)
2271 alignment = pFormat[1] + 1;
2280 if (!fMustAlloc && !*ppMemory)
2286 saved_buffer = pStubMsg->
Buffer;
2292 return pStubMsg->
Buffer - saved_buffer;
2295 ERR(
"unknown array format 0x%x\n",
fc);
2302 unsigned char fHasPointers)
2307 unsigned char alignment;
2312 esize = *(
const WORD*)(pFormat+2);
2313 alignment = pFormat[1] + 1;
2329 esize = *(
const WORD*)(pFormat+2);
2330 alignment = pFormat[1] + 1;
2359 ERR(
"buffer size %d must equal memory size %ld for non-sized conformant strings\n",
2365 ERR(
"conformant strings can't have Offset (%d)\n", pStubMsg->
Offset);
2378 alignment = pFormat[1] + 1;
2393 pStubMsg->
MemorySize = SavedMemorySize + memsize;
2396 ERR(
"unknown array format 0x%x\n",
fc);
2434 ERR(
"unknown array format 0x%x\n",
fc);
2462 TRACE(
"(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat);
2465 ERR(
"Unhandled string type: %#x\n", pFormat[0]);
2492 TRACE(
"(pStubMsg == ^%p, pMemory == ^%p, pFormat == ^%p)\n", pStubMsg,
pMemory, pFormat);
2495 ERR(
"Unhandled string type: %#x\n", pFormat[0]);
2520 TRACE(
"(pStubMsg == ^%p, pFormat == ^%p)\n", pStubMsg, pFormat);
2523 ERR(
"Unhandled string type: %#x\n", pFormat[0]);
2546 unsigned char** ppMemory,
PFORMAT_STRING pFormat,
unsigned char fMustAlloc )
2548 TRACE(
"(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n",
2549 pStubMsg, *ppMemory, pFormat, fMustAlloc);
2552 ERR(
"Unhandled string type: %#x\n", *pFormat);
2561 pFormat, fMustAlloc,
2567 pFormat, fMustAlloc,
2584 TRACE(
"(pStubMsg == ^%p, pMemory == ^%p, pFormat == ^%p)\n", pStubMsg,
pMemory, pFormat);
2586 maxsize = *(
const USHORT *)&pFormat[2];
2592 while (
i < maxsize &&
str[
i])
i++;
2601 while (
i < maxsize &&
str[
i])
i++;
2608 ERR(
"Unhandled string type: %#x\n", *pFormat);
2625 unsigned char **ppMemory,
2627 unsigned char fMustAlloc)
2631 TRACE(
"(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n",
2632 pStubMsg, *ppMemory, pFormat, fMustAlloc);
2634 maxsize = *(
const USHORT *)&pFormat[2];
2639 ERR(
"non-conformant strings can't have Offset (%d)\n", pStubMsg->
Offset);
2647 ERR(
"Unhandled string type: %#x\n", *pFormat);
2651 memsize = esize * maxsize;
2656 if (!fMustAlloc && !*ppMemory)
2680 ULONG esize, maxsize;
2682 TRACE(
"(pStubMsg == ^%p, pMemory == ^%p, pFormat == ^%p)\n", pStubMsg,
pMemory, pFormat);
2684 maxsize = *(
const USHORT *)&pFormat[2];
2692 while (
i < maxsize &&
str[
i])
i++;
2701 while (
i < maxsize &&
str[
i])
i++;
2708 ERR(
"Unhandled string type: %#x\n", *pFormat);
2723 TRACE(
"(pStubMsg == ^%p, pFormat == ^%p)\n", pStubMsg, pFormat);
2725 maxsize = *(
const USHORT *)&pFormat[2];
2731 ERR(
"non-conformant strings can't have Offset (%d)\n", pStubMsg->
Offset);
2739 ERR(
"Unhandled string type: %#x\n", *pFormat);
2743 memsize = esize * maxsize;
2756#include "pshpack1.h"
2777 return *(
const WORD*)&pFormat[2];
2780 return *(
const ULONG*)&pFormat[2];
2782 return *(
const WORD*)&pFormat[4];
2784 switch (((
const NDR_RANGE *)pFormat)->flags_type & 0xf) {
2789 return sizeof(
UCHAR);
2797 return sizeof(
ULONG);
2799 return sizeof(
float);
2805 return sizeof(
UINT);
2807 ERR(
"unknown type 0x%x\n", ((
const NDR_RANGE *)pFormat)->flags_type & 0xf);
2814 pFormat += *(
const SHORT*)pFormat;
2815 return *(
const SHORT*)pFormat;
2817 return sizeof(
void *);
2819 return *(
const WORD*)&pFormat[2] * 2;
2821 FIXME(
"unhandled embedded type %02x\n", *pFormat);
2834 FIXME(
"no memorysizer for data type=%02x\n", *pFormat);
2838 return m(pStubMsg, pFormat);
2847 unsigned char *mem_base =
pMemory;
2852 while (*pFormat !=
FC_END) {
2916 unsigned char *saved_buffer;
2919 TRACE(
"pStubMsg->Buffer before %p\n", pStubMsg->
Buffer);
2922 if (*pPointer !=
FC_RP)
2924 saved_buffer = pStubMsg->
Buffer;
2929 pointer_buffer_mark_set =
TRUE;
2931 else if (*pPointer !=
FC_RP)
2934 if (pointer_buffer_mark_set)
2938 pStubMsg->
Buffer = saved_buffer;
2939 if (*pPointer !=
FC_RP)
2942 TRACE(
"pStubMsg->Buffer after %p\n", pStubMsg->
Buffer);
2971 desc = pFormat + *(
const SHORT*)pFormat;
2986 else FIXME(
"no marshaller for embedded type %02x\n", *
desc);
2993 FIXME(
"unhandled format 0x%02x\n", *pFormat);
3005 unsigned char fMustAlloc)
3007 unsigned char *mem_base =
pMemory;
3012 while (*pFormat !=
FC_END) {
3086 unsigned char *saved_buffer;
3091 if (*pPointer !=
FC_RP)
3093 saved_buffer = pStubMsg->
Buffer;
3098 pointer_buffer_mark_set =
TRUE;
3100 else if (*pPointer !=
FC_RP)
3104 if (pointer_buffer_mark_set)
3108 pStubMsg->
Buffer = saved_buffer;
3109 if (*pPointer !=
FC_RP)
3141 desc = pFormat + *(
const SHORT*)pFormat;
3163 else FIXME(
"no unmarshaller for embedded type %02x\n", *
desc);
3170 FIXME(
"unhandled format %d\n", *pFormat);
3183 unsigned char *mem_base =
pMemory;
3188 while (*pFormat !=
FC_END) {
3237 ERR(
"BufferLength == 0??\n");
3242 if (*pPointer !=
FC_RP)
3274 desc = pFormat + *(
const SHORT*)pFormat;
3288 else FIXME(
"no buffersizer for embedded type %02x\n", *
desc);
3295 FIXME(
"unhandled format 0x%02x\n", *pFormat);
3308 unsigned char *mem_base =
pMemory;
3313 while (*pFormat !=
FC_END) {
3376 desc = pFormat + *(
const SHORT*)pFormat;
3396 FIXME(
"unhandled format 0x%02x\n", *pFormat);
3411 while (*pFormat !=
FC_END) {
3453 unsigned char *saved_buffer;
3457 if (*pPointer !=
FC_RP)
3459 saved_buffer = pStubMsg->
Buffer;
3464 pointer_buffer_mark_set =
TRUE;
3466 else if (*pPointer !=
FC_RP)
3471 if (pointer_buffer_mark_set)
3475 pStubMsg->
Buffer = saved_buffer;
3476 if (*pPointer !=
FC_RP)
3483 size +=
sizeof(
void *);
3507 desc = pFormat + *(
const SHORT*)pFormat;
3514 FIXME(
"unhandled format 0x%02x\n", *pFormat);
3527 while (*pFormat !=
FC_END) {
3560 size +=
sizeof(
void *);
3585 desc = pFormat + *(
const SHORT*)pFormat;
3592 FIXME(
"unhandled format 0x%02x\n", *pFormat);
3609 unsigned char *OldMemory = pStubMsg->
Memory;
3612 ULONG max_count = 0;
3633 pointer_buffer_mark_set =
TRUE;
3642 if (*(
const SHORT*)pFormat) conf_array = pFormat + *(
const SHORT*)pFormat;
3644 if (*(
const WORD*)pFormat) pointer_desc = pFormat + *(
const WORD*)pFormat;
3653 pMemory + struct_size, conf_array);
3671 pStubMsg->
Memory = OldMemory;
3673 if (pointer_buffer_mark_set)
3688 unsigned char **ppMemory,
3690 unsigned char fMustAlloc)
3692 unsigned size = *(
const WORD*)(pFormat+2);
3698 ULONG max_count = 0;
3702 TRACE(
"(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
3708 unsigned char *saved_buffer = pStubMsg->
Buffer;
3719 pointer_buffer_mark_set =
TRUE;
3722 pStubMsg->
Buffer = saved_buffer;
3728 if (*(
const SHORT*)pFormat) conf_array = pFormat + *(
const SHORT*)pFormat;
3730 if (*(
const WORD*)pFormat) pointer_desc = pFormat + *(
const WORD*)pFormat;
3744 if (!fMustAlloc && !*ppMemory)
3764 if (pointer_buffer_mark_set)
3782 unsigned char *OldMemory = pStubMsg->
Memory;
3783 int pointer_length_set = 0;
3785 ULONG max_count = 0;
3805 pointer_length_set = 1;
3813 if (*(
const SHORT*)pFormat) conf_array = pFormat + *(
const SHORT*)pFormat;
3815 if (*(
const WORD*)pFormat) pointer_desc = pFormat + *(
const WORD*)pFormat;
3843 pStubMsg->
Memory = OldMemory;
3845 if(pointer_length_set)
3859 unsigned size = *(
const WORD*)(pFormat+2);
3863 ULONG max_count = 0;
3866 TRACE(
"(%p,%p)\n", pStubMsg, pFormat);
3871 if (*(
const SHORT*)pFormat) conf_array = pFormat + *(
const SHORT*)pFormat;
3873 if (*(
const WORD*)pFormat) pointer_desc = pFormat + *(
const WORD*)pFormat;
3910 unsigned char *OldMemory = pStubMsg->
Memory;
3915 if (*(
const SHORT*)pFormat) conf_array = pFormat + *(
const SHORT*)pFormat;
3917 if (*(
const WORD*)pFormat) pointer_desc = pFormat + *(
const WORD*)pFormat;
3928 pStubMsg->
Memory = OldMemory;
3941 ERR(
"invalid format = 0x%x\n", pFormat[0]);
3957 unsigned char **ppMemory,
3959 unsigned char fMustAlloc)
3961 TRACE(
"(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
3964 ERR(
"invalid format = 0x%x\n", pFormat[0]);
3987 ERR(
"invalid format = 0x%x\n", pFormat[0]);
4002 TRACE(
"(%p,%p)\n", pStubMsg, pFormat);
4005 ERR(
"invalid format = 0x%x\n", pFormat[0]);
4025 ERR(
"invalid format = 0x%x\n", pFormat[0]);
4045 ERR(
"invalid format type %x\n", pFormat[0]);
4063 unsigned char** ppMemory,
4065 unsigned char fMustAlloc )
4067 TRACE(
"(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
4071 ERR(
"invalid format type %x\n", pFormat[0]);
4078 pFormat, fMustAlloc,
4097 ERR(
"invalid format type %x\n", pFormat[0]);
4117 ERR(
"invalid format type %x\n", pFormat[0]);
4135 TRACE(
"(%p, %p)\n", pStubMsg, pFormat);
4139 ERR(
"invalid format type %x\n", pFormat[0]);