Signed-off-by: Zebediah Figura z.figura12@gmail.com --- include/ndrtypes.h | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+)
diff --git a/include/ndrtypes.h b/include/ndrtypes.h index b353ce5..938dc65 100644 --- a/include/ndrtypes.h +++ b/include/ndrtypes.h @@ -168,8 +168,113 @@ typedef enum FC_SMVARRAY, /* 0x1f */ /* small (<64k) varying array */ FC_LGVARRAY, /* 0x20 */ /* large (>= 64k) varying array */ FC_BOGUS_ARRAY, /* 0x21 */ /* complex array */ + + FC_C_CSTRING, /* 0x22 */ /* conformant char string */ + FC_C_BSTRING, /* 0x23 */ + FC_C_SSTRING, /* 0x24 */ + FC_C_WSTRING, /* 0x25 */ /* conformant wchar string */ + FC_CSTRING, /* 0x26 */ /* non-conformant char string */ + FC_BSTRING, /* 0x27 */ + FC_SSTRING, /* 0x28 */ + FC_WSTRING, /* 0x29 */ /* non-conformant wchar string */ + + FC_ENCAPSULATED_UNION, /* 0x2a */ + FC_NON_ENCAPSULATED_UNION, /* 0x2b */ + + FC_BYTE_COUNT_POINTER, /* 0x2c */ /* [byte_count] ACF attribute */ + + FC_TRANSMIT_AS, /* 0x2d */ + FC_REPRESENT_AS, /* 0x2e */ + + FC_IP, /* 0x2f */ /* interface pointer */ + + FC_BIND_CONTEXT, /* 0x30 */ + + FC_BIND_GENERIC, /* 0x31 */ + FC_BIND_PRIMITIVE, /* 0x32 */ + FC_AUTO_HANDLE, /* 0x33 */ + FC_CALLBACK_HANDLE, /* 0x34 */ + + FC_UNUSED1, /* 0x35 */ + + FC_POINTER, /* 0x36 */ + + FC_ALIGNM2, /* 0x37 */ + FC_ALIGNM4, /* 0x38 */ + FC_ALIGNM8, /* 0x39 */ + + FC_UNUSED2, /* 0x3a */ + FC_UNUSED3, /* 0x3b */ + FC_UNUSED4, /* 0x3c */ + + FC_STRUCTPAD1, /* 0x3d */ + FC_STRUCTPAD2, /* 0x3e */ + FC_STRUCTPAD3, /* 0x3f */ + FC_STRUCTPAD4, /* 0x40 */ + FC_STRUCTPAD5, /* 0x41 */ + FC_STRUCTPAD6, /* 0x42 */ + FC_STRUCTPAD7, /* 0x43 */ + + FC_STRING_SIZED, /* 0x44 */ + + FC_UNUSED5, /* 0x45 */ + + FC_NO_REPEAT, /* 0x46 */ + FC_FIXED_REPEAT, /* 0x47 */ + FC_VARIABLE_REPEAT, /* 0x48 */ + FC_FIXED_OFFSET, /* 0x49 */ + FC_VARIABLE_OFFSET, /* 0x4a */ + + FC_PP, /* 0x4b */ /* pointer layout */ +/* FC_PP: FC_PAD layouts */ +/* layouts: FC_NO_REPEAT FC_PAD instance */ +/* instance: NdrFcShort(memofs), NdrFcShort(bufofs), desc */ + + FC_EMBEDDED_COMPLEX, /* 0x4c */ + + FC_IN_PARAM, /* 0x4d */ + FC_IN_PARAM_BASETYPE, /* 0x4e */ + FC_IN_PARAM_NO_FREE_INST, /* 0x4f */ + FC_IN_OUT_PARAM, /* 0x50 */ + FC_OUT_PARAM, /* 0x51 */ + FC_RETURN_PARAM, /* 0x52 */ + FC_RETURN_PARAM_BASETYPE, /* 0x53 */ + + FC_DEREFERENCE, /* 0x54 */ + FC_DIV_2, /* 0x55 */ + FC_MULT_2, /* 0x56 */ + FC_ADD_1, /* 0x57 */ + FC_SUB_1, /* 0x58 */ + + FC_CALLBACK, /* 0x59 */ + + FC_CONSTANT_IID, /* 0x5a */ + + FC_END, /* 0x5b */ + FC_PAD, /* 0x5c */ + + FC_HARD_STRUCT = 0xb1, + + FC_TRANSMIT_AS_PTR, /* 0xb2 */ + FC_REPRESENT_AS_PTR, /* 0xb3 */ + + FC_USER_MARSHAL, /* 0xb4 */ + + FC_PIPE, /* 0xb5 */ + FC_BLKHOLE, /* 0xb6 */ + + FC_RANGE, /* 0xb7 */ + + FC_INT3264, /* 0xb8 */ + FC_UINT3264, /* 0xb9 */ } FORMAT_CHARACTER;
+#define FC_ALLOCATE_ALL_NODES 0x01 +#define FC_DONT_FREE 0x02 +#define FC_ALLOCED_ON_STACK 0x04 +#define FC_SIMPLE_POINTER 0x08 +#define FC_POINTER_DEREF 0x10 + /* flags for all handle types */ #define HANDLE_PARAM_IS_VIA_PTR 0x80 #define HANDLE_PARAM_IS_IN 0x40 @@ -182,4 +287,23 @@ typedef enum #define NDR_CONTEXT_HANDLE_SERIALIZE 0x02 #define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL 0x01
+#define Oi_FULL_PTR_USED 0x01 +#define Oi_RPCSS_ALLOC_USED 0x02 +#define Oi_OBJECT_PROC 0x04 +#define Oi_HAS_RPCFLAGS 0x08 +#define Oi_OBJ_USE_V2_INTERPRETER 0x20 +#define Oi_HAS_COMM_OR_FAULT 0x20 +#define Oi_USE_NEW_INIT_ROUTINES 0x40 + +#define FC_NORMAL_CONFORMANCE (unsigned char) 0x00 +#define FC_POINTER_CONFORMANCE (unsigned char) 0x10 +#define FC_TOP_LEVEL_CONFORMANCE (unsigned char) 0x20 +#define FC_CONSTANT_CONFORMANCE (unsigned char) 0x40 +#define FC_TOP_LEVEL_MULTID_CONFORMANCE (unsigned char) 0x80 + +#define USER_MARSHAL_UNIQUE 0x80 +#define USER_MARSHAL_REF 0x40 +#define USER_MARSHAL_POINTER 0xc0 +#define USER_MARSHAL_IID 0x20 + #endif
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- All types defined in wine/rpcfc.h have equivalent types in ndrtypes.h, with the exception of RPC_FC_BIND_EXPLICIT, which I have replaced with 0.
dlls/rpcrt4/ndr_contexthandle.c | 2 - dlls/rpcrt4/ndr_es.c | 15 +- dlls/rpcrt4/ndr_marshall.c | 1420 +++++++++++++++++++-------------------- dlls/rpcrt4/ndr_ole.c | 6 +- dlls/rpcrt4/ndr_stubless.c | 241 ++++--- dlls/rpcrt4/ndr_stubless.h | 16 +- 6 files changed, 846 insertions(+), 854 deletions(-)
diff --git a/dlls/rpcrt4/ndr_contexthandle.c b/dlls/rpcrt4/ndr_contexthandle.c index 3b26285..a5e1ffc 100644 --- a/dlls/rpcrt4/ndr_contexthandle.c +++ b/dlls/rpcrt4/ndr_contexthandle.c @@ -23,8 +23,6 @@ #include "rpc_assoc.h" #include "rpcndr.h"
-#include "wine/rpcfc.h" - #include "wine/debug.h" #include "wine/list.h"
diff --git a/dlls/rpcrt4/ndr_es.c b/dlls/rpcrt4/ndr_es.c index 59ea816..158bc7c 100644 --- a/dlls/rpcrt4/ndr_es.c +++ b/dlls/rpcrt4/ndr_es.c @@ -32,7 +32,6 @@ #include "ndr_stubless.h"
#include "wine/debug.h" -#include "wine/rpcfc.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
@@ -424,7 +423,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu client_interface = pStubDesc->RpcInterfaceInformation; pEsMsg->InterfaceId = client_interface->InterfaceId;
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) { const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0]; stack_size = header_rpc->stack_size; @@ -438,17 +437,17 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu pFormat += sizeof(NDR_PROC_HEADER); }
- if (pProcHeader->handle_type == RPC_FC_BIND_EXPLICIT) + if (pProcHeader->handle_type == 0) { switch (*pFormat) /* handle_type */ { - case RPC_FC_BIND_PRIMITIVE: /* explicit primitive */ + case FC_BIND_PRIMITIVE: /* explicit primitive */ pFormat += sizeof(NDR_EHD_PRIMITIVE); break; - case RPC_FC_BIND_GENERIC: /* explicit generic */ + case FC_BIND_GENERIC: /* explicit generic */ pFormat += sizeof(NDR_EHD_GENERIC); break; - case RPC_FC_BIND_CONTEXT: /* explicit context */ + case FC_BIND_CONTEXT: /* explicit context */ pFormat += sizeof(NDR_EHD_CONTEXT); break; default: @@ -467,7 +466,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu pEsMsg->StubMsg.pfnFree = pStubDesc->pfnFree;
/* create the full pointer translation tables, if requested */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) pEsMsg->StubMsg.FullPtrXlatTables = NdrFullPointerXlatInit(0,XLAT_CLIENT);
TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags); @@ -510,7 +509,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu return; } /* free the full pointer translation tables */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) NdrFullPointerXlatFree(pEsMsg->StubMsg.FullPtrXlatTables); }
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 6356fb9..52e2716 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -43,8 +43,6 @@ #include "ndrtypes.h"
#include "wine/unicode.h" -#include "wine/rpcfc.h" - #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -554,15 +552,15 @@ PFORMAT_STRING ComputeConformanceOrVariance( }
switch (pFormat[0] & 0xf0) { - case RPC_FC_NORMAL_CONFORMANCE: + case FC_NORMAL_CONFORMANCE: TRACE("normal conformance, ofs=%d\n", ofs); ptr = pMemory; break; - case RPC_FC_POINTER_CONFORMANCE: + case FC_POINTER_CONFORMANCE: TRACE("pointer conformance, ofs=%d\n", ofs); ptr = pStubMsg->Memory; break; - case RPC_FC_TOP_LEVEL_CONFORMANCE: + case FC_TOP_LEVEL_CONFORMANCE: TRACE("toplevel conformance, ofs=%d\n", ofs); if (pStubMsg->StackTop) { ptr = pStubMsg->StackTop; @@ -572,12 +570,12 @@ PFORMAT_STRING ComputeConformanceOrVariance( goto finish_conf; } break; - case RPC_FC_CONSTANT_CONFORMANCE: + case FC_CONSTANT_CONFORMANCE: data = ofs | ((DWORD)pFormat[1] << 16); TRACE("constant conformance, val=%ld\n", data); *pCount = data; goto finish_conf; - case RPC_FC_TOP_LEVEL_MULTID_CONFORMANCE: + case FC_TOP_LEVEL_MULTID_CONFORMANCE: FIXME("toplevel multidimensional conformance, ofs=%d\n", ofs); if (pStubMsg->StackTop) { ptr = pStubMsg->StackTop; @@ -593,10 +591,10 @@ PFORMAT_STRING ComputeConformanceOrVariance( }
switch (pFormat[1]) { - case RPC_FC_DEREFERENCE: + case FC_DEREFERENCE: ptr = *(LPVOID*)((char *)ptr + ofs); break; - case RPC_FC_CALLBACK: + case FC_CALLBACK: { unsigned char *old_stack_top = pStubMsg->StackTop; ULONG_PTR max_count, old_max_count = pStubMsg->MaxCount; @@ -621,25 +619,25 @@ PFORMAT_STRING ComputeConformanceOrVariance( }
switch (dtype) { - case RPC_FC_LONG: - case RPC_FC_ULONG: + case FC_LONG: + case FC_ULONG: data = *(DWORD*)ptr; break; - case RPC_FC_SHORT: + case FC_SHORT: data = *(SHORT*)ptr; break; - case RPC_FC_USHORT: + case FC_USHORT: data = *(USHORT*)ptr; break; - case RPC_FC_CHAR: - case RPC_FC_SMALL: + case FC_CHAR: + case FC_SMALL: data = *(CHAR*)ptr; break; - case RPC_FC_BYTE: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_USMALL: data = *(UCHAR*)ptr; break; - case RPC_FC_HYPER: + case FC_HYPER: data = *(ULONGLONG *)ptr; break; default: @@ -650,20 +648,20 @@ PFORMAT_STRING ComputeConformanceOrVariance(
done_conf_grab: switch (pFormat[1]) { - case RPC_FC_DEREFERENCE: /* already handled */ + case FC_DEREFERENCE: /* already handled */ case 0: /* no op */ *pCount = data; break; - case RPC_FC_ADD_1: + case FC_ADD_1: *pCount = data + 1; break; - case RPC_FC_SUB_1: + case FC_SUB_1: *pCount = data - 1; break; - case RPC_FC_MULT_2: + case FC_MULT_2: *pCount = data * 2; break; - case RPC_FC_DIV_2: + case FC_DIV_2: *pCount = data / 2; break; default: @@ -779,16 +777,16 @@ static void validate_string_data(MIDL_STUB_MESSAGE *pStubMsg, ULONG bufsize, ULO
static inline void dump_pointer_attr(unsigned char attr) { - if (attr & RPC_FC_P_ALLOCALLNODES) - TRACE(" RPC_FC_P_ALLOCALLNODES"); - if (attr & RPC_FC_P_DONTFREE) - TRACE(" RPC_FC_P_DONTFREE"); - if (attr & RPC_FC_P_ONSTACK) - TRACE(" RPC_FC_P_ONSTACK"); - if (attr & RPC_FC_P_SIMPLEPOINTER) - TRACE(" RPC_FC_P_SIMPLEPOINTER"); - if (attr & RPC_FC_P_DEREF) - TRACE(" RPC_FC_P_DEREF"); + if (attr & FC_ALLOCATE_ALL_NODES) + TRACE(" FC_ALLOCATE_ALL_NODES"); + if (attr & FC_DONT_FREE) + TRACE(" FC_DONT_FREE"); + if (attr & FC_ALLOCED_ON_STACK) + TRACE(" FC_ALLOCED_ON_STACK"); + if (attr & FC_SIMPLE_POINTER) + TRACE(" FC_SIMPLE_POINTER"); + if (attr & FC_POINTER_DEREF) + TRACE(" FC_POINTER_DEREF"); TRACE("\n"); }
@@ -809,11 +807,11 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p,%p,%p,%p)\n", pStubMsg, Buffer, Pointer, pFormat); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); pFormat += 2; - if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; + if (attr & FC_SIMPLE_POINTER) desc = pFormat; else desc = pFormat + *(const SHORT*)pFormat;
switch (type) { - case RPC_FC_RP: /* ref pointer (always non-null) */ + case FC_RP: /* ref pointer (always non-null) */ if (!Pointer) { ERR("NULL ref pointer is not allowed\n"); @@ -821,8 +819,8 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, } pointer_needs_marshaling = TRUE; break; - case RPC_FC_UP: /* unique pointer */ - case RPC_FC_OP: /* object pointer - same as unique here */ + case FC_UP: /* unique pointer */ + case FC_OP: /* object pointer - same as unique here */ if (Pointer) pointer_needs_marshaling = TRUE; else @@ -831,7 +829,7 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, TRACE("writing 0x%08x to buffer\n", pointer_id); NDR_LOCAL_UINT32_WRITE(Buffer, pointer_id); break; - case RPC_FC_FP: + case FC_FP: pointer_needs_marshaling = !NdrFullPointerQueryPointer( pStubMsg->FullPtrXlatTables, Pointer, 1, &pointer_id); TRACE("writing 0x%08x to buffer\n", pointer_id); @@ -846,7 +844,7 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, TRACE("calling marshaller for type 0x%x\n", (int)*desc);
if (pointer_needs_marshaling) { - if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { Pointer = *(unsigned char**)Pointer; TRACE("deref => %p\n", Pointer); } @@ -877,14 +875,14 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p,%p,%p,%p,%p,%d)\n", pStubMsg, Buffer, pPointer, pSrcPointer, pFormat, fMustAlloc); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); pFormat += 2; - if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; + if (attr & FC_SIMPLE_POINTER) desc = pFormat; else desc = pFormat + *(const SHORT*)pFormat;
switch (type) { - case RPC_FC_RP: /* ref pointer (always non-null) */ + case FC_RP: /* ref pointer (always non-null) */ pointer_needs_unmarshaling = TRUE; break; - case RPC_FC_UP: /* unique pointer */ + case FC_UP: /* unique pointer */ pointer_id = NDR_LOCAL_UINT32_READ(Buffer); TRACE("pointer_id is 0x%08x\n", pointer_id); if (pointer_id) @@ -894,7 +892,7 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pointer_needs_unmarshaling = FALSE; } break; - case RPC_FC_OP: /* object pointer - we must free data before overwriting it */ + case FC_OP: /* object pointer - we must free data before overwriting it */ pointer_id = NDR_LOCAL_UINT32_READ(Buffer); TRACE("pointer_id is 0x%08x\n", pointer_id); if (!fMustAlloc && pSrcPointer) @@ -910,7 +908,7 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pointer_needs_unmarshaling = FALSE; } break; - case RPC_FC_FP: + case FC_FP: pointer_id = NDR_LOCAL_UINT32_READ(Buffer); TRACE("pointer_id is 0x%08x\n", pointer_id); pointer_needs_unmarshaling = !NdrFullPointerQueryRefId( @@ -945,17 +943,17 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, * whether we have to initialise it so we can use the optimisation of * setting the pointer to the buffer, if possible, or set fMustAlloc to * TRUE. */ - if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { fMustAlloc = TRUE; } else { *current_ptr = NULL; } }
- if (attr & RPC_FC_P_ALLOCALLNODES) - FIXME("RPC_FC_P_ALLOCALLNODES not implemented\n"); + if (attr & FC_ALLOCATE_ALL_NODES) + FIXME("FC_ALLOCATE_ALL_NODES not implemented\n");
- if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { if (fMustAlloc) { unsigned char *base_ptr_val = NdrAllocate(pStubMsg, sizeof(void *)); *pPointer = base_ptr_val; @@ -969,7 +967,7 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, if (m) m(pStubMsg, current_ptr, desc, fMustAlloc); else FIXME("no unmarshaller for data type=%02x\n", *desc);
- if (type == RPC_FC_FP) + if (type == FC_FP) NdrFullPointerInsertRefId(pStubMsg->FullPtrXlatTables, pointer_id, *pPointer); } @@ -993,24 +991,24 @@ static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p,%p,%p)\n", pStubMsg, Pointer, pFormat); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); pFormat += 2; - if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; + if (attr & FC_SIMPLE_POINTER) desc = pFormat; else desc = pFormat + *(const SHORT*)pFormat;
switch (type) { - case RPC_FC_RP: /* ref pointer (always non-null) */ + case FC_RP: /* ref pointer (always non-null) */ if (!Pointer) { ERR("NULL ref pointer is not allowed\n"); RpcRaiseException(RPC_X_NULL_REF_POINTER); } break; - case RPC_FC_OP: - case RPC_FC_UP: + case FC_OP: + case FC_UP: /* NULL pointer has no further representation */ if (!Pointer) return; break; - case RPC_FC_FP: + case FC_FP: pointer_needs_sizing = !NdrFullPointerQueryPointer( pStubMsg->FullPtrXlatTables, Pointer, 0, &pointer_id); if (!pointer_needs_sizing) @@ -1022,7 +1020,7 @@ static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, return; }
- if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { Pointer = *(unsigned char**)Pointer; TRACE("deref => %p\n", Pointer); } @@ -1047,15 +1045,15 @@ static ULONG PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p,%p,%p)\n", pStubMsg, Buffer, pFormat); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); pFormat += 2; - if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; + if (attr & FC_SIMPLE_POINTER) desc = pFormat; else desc = pFormat + *(const SHORT*)pFormat;
switch (type) { - case RPC_FC_RP: /* ref pointer (always non-null) */ + case FC_RP: /* ref pointer (always non-null) */ pointer_needs_sizing = TRUE; break; - case RPC_FC_UP: /* unique pointer */ - case RPC_FC_OP: /* object pointer - we must free data before overwriting it */ + case FC_UP: /* unique pointer */ + case FC_OP: /* object pointer - we must free data before overwriting it */ pointer_id = NDR_LOCAL_UINT32_READ(Buffer); TRACE("pointer_id is 0x%08x\n", pointer_id); if (pointer_id) @@ -1063,7 +1061,7 @@ static ULONG PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, else pointer_needs_sizing = FALSE; break; - case RPC_FC_FP: + case FC_FP: { void *pointer; pointer_id = NDR_LOCAL_UINT32_READ(Buffer); @@ -1078,7 +1076,7 @@ static ULONG PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, return 0; }
- if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { align_length(&pStubMsg->MemorySize, sizeof(void*)); pStubMsg->MemorySize += sizeof(void*); TRACE("deref\n"); @@ -1107,21 +1105,21 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p)\n", pStubMsg, Pointer, pFormat); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); - if (attr & RPC_FC_P_DONTFREE) return; + if (attr & FC_DONT_FREE) return; pFormat += 2; - if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; + if (attr & FC_SIMPLE_POINTER) desc = pFormat; else desc = pFormat + *(const SHORT*)pFormat;
if (!Pointer) return;
- if (type == RPC_FC_FP) { + if (type == FC_FP) { int pointer_needs_freeing = NdrFullPointerFree( pStubMsg->FullPtrXlatTables, Pointer); if (!pointer_needs_freeing) return; }
- if (attr & RPC_FC_P_DEREF) { + if (attr & FC_POINTER_DEREF) { current_pointer = *(unsigned char**)Pointer; TRACE("deref => %p\n", current_pointer); } @@ -1138,7 +1136,7 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg, if (Pointer >= pStubMsg->BufferStart && Pointer <= pStubMsg->BufferEnd) goto notfree;
- if (attr & RPC_FC_P_ONSTACK) { + if (attr & FC_ALLOCED_ON_STACK) { TRACE("not freeing stack ptr %p\n", Pointer); return; } @@ -1163,7 +1161,7 @@ static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
- if (*pFormat != RPC_FC_PP) return NULL; + if (*pFormat != FC_PP) return NULL; pFormat += 2;
if (pStubMsg->PointerBufferMark) @@ -1173,25 +1171,25 @@ static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; }
- while (pFormat[0] != RPC_FC_END) { + while (pFormat[0] != FC_END) { switch (pFormat[0]) { default: FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]); /* fallthrough */ - case RPC_FC_NO_REPEAT: + case FC_NO_REPEAT: rep = 1; stride = 0; count = 1; pFormat += 2; break; - case RPC_FC_FIXED_REPEAT: + case FC_FIXED_REPEAT: rep = *(const WORD*)&pFormat[2]; stride = *(const WORD*)&pFormat[4]; count = *(const WORD*)&pFormat[8]; pFormat += 10; break; - case RPC_FC_VARIABLE_REPEAT: - rep = (pFormat[1] == RPC_FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; + case FC_VARIABLE_REPEAT: + rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; stride = *(const WORD*)&pFormat[2]; count = *(const WORD*)&pFormat[6]; pFormat += 8; @@ -1243,7 +1241,7 @@ static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%p,%d)\n", pStubMsg, pDstBuffer, pSrcMemoryPtrs, pFormat, fMustAlloc);
- if (*pFormat != RPC_FC_PP) return NULL; + if (*pFormat != FC_PP) return NULL; pFormat += 2;
if (pStubMsg->PointerBufferMark) @@ -1253,26 +1251,26 @@ static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; }
- while (pFormat[0] != RPC_FC_END) { + while (pFormat[0] != FC_END) { TRACE("pFormat[0] = 0x%x\n", pFormat[0]); switch (pFormat[0]) { default: FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]); /* fallthrough */ - case RPC_FC_NO_REPEAT: + case FC_NO_REPEAT: rep = 1; stride = 0; count = 1; pFormat += 2; break; - case RPC_FC_FIXED_REPEAT: + case FC_FIXED_REPEAT: rep = *(const WORD*)&pFormat[2]; stride = *(const WORD*)&pFormat[4]; count = *(const WORD*)&pFormat[8]; pFormat += 10; break; - case RPC_FC_VARIABLE_REPEAT: - rep = (pFormat[1] == RPC_FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; + case FC_VARIABLE_REPEAT: + rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; stride = *(const WORD*)&pFormat[2]; count = *(const WORD*)&pFormat[6]; pFormat += 8; @@ -1319,7 +1317,7 @@ static void EmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
if (pStubMsg->IgnoreEmbeddedPointers) return;
- if (*pFormat != RPC_FC_PP) return; + if (*pFormat != FC_PP) return; pFormat += 2;
if (pStubMsg->PointerLength) @@ -1329,25 +1327,25 @@ static void EmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerLength = 0; }
- while (pFormat[0] != RPC_FC_END) { + while (pFormat[0] != FC_END) { switch (pFormat[0]) { default: FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]); /* fallthrough */ - case RPC_FC_NO_REPEAT: + case FC_NO_REPEAT: rep = 1; stride = 0; count = 1; pFormat += 2; break; - case RPC_FC_FIXED_REPEAT: + case FC_FIXED_REPEAT: rep = *(const WORD*)&pFormat[2]; stride = *(const WORD*)&pFormat[4]; count = *(const WORD*)&pFormat[8]; pFormat += 10; break; - case RPC_FC_VARIABLE_REPEAT: - rep = (pFormat[1] == RPC_FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; + case FC_VARIABLE_REPEAT: + rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; stride = *(const WORD*)&pFormat[2]; count = *(const WORD*)&pFormat[6]; pFormat += 8; @@ -1399,28 +1397,28 @@ static ULONG EmbeddedPointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; }
- if (*pFormat != RPC_FC_PP) return 0; + if (*pFormat != FC_PP) return 0; pFormat += 2;
- while (pFormat[0] != RPC_FC_END) { + while (pFormat[0] != FC_END) { switch (pFormat[0]) { default: FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]); /* fallthrough */ - case RPC_FC_NO_REPEAT: + case FC_NO_REPEAT: rep = 1; stride = 0; count = 1; pFormat += 2; break; - case RPC_FC_FIXED_REPEAT: + case FC_FIXED_REPEAT: rep = *(const WORD*)&pFormat[2]; stride = *(const WORD*)&pFormat[4]; count = *(const WORD*)&pFormat[8]; pFormat += 10; break; - case RPC_FC_VARIABLE_REPEAT: - rep = (pFormat[1] == RPC_FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; + case FC_VARIABLE_REPEAT: + rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; stride = *(const WORD*)&pFormat[2]; count = *(const WORD*)&pFormat[6]; pFormat += 8; @@ -1458,28 +1456,28 @@ static void EmbeddedPointerFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned i;
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); - if (*pFormat != RPC_FC_PP) return; + if (*pFormat != FC_PP) return; pFormat += 2;
- while (pFormat[0] != RPC_FC_END) { + while (pFormat[0] != FC_END) { switch (pFormat[0]) { default: FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]); /* fallthrough */ - case RPC_FC_NO_REPEAT: + case FC_NO_REPEAT: rep = 1; stride = 0; count = 1; pFormat += 2; break; - case RPC_FC_FIXED_REPEAT: + case FC_FIXED_REPEAT: rep = *(const WORD*)&pFormat[2]; stride = *(const WORD*)&pFormat[4]; count = *(const WORD*)&pFormat[8]; pFormat += 10; break; - case RPC_FC_VARIABLE_REPEAT: - rep = (pFormat[1] == RPC_FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; + case FC_VARIABLE_REPEAT: + rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount; stride = *(const WORD*)&pFormat[2]; count = *(const WORD*)&pFormat[6]; pFormat += 8; @@ -1517,7 +1515,7 @@ unsigned char * WINAPI NdrPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, /* Increment the buffer here instead of in PointerMarshall, * as that is used by embedded pointers which already handle the incrementing * the buffer, and shouldn't write any additional pointer data to the wire */ - if (*pFormat != RPC_FC_RP) + if (*pFormat != FC_RP) { align_pointer_clear(&pStubMsg->Buffer, 4); Buffer = pStubMsg->Buffer; @@ -1543,7 +1541,7 @@ unsigned char * WINAPI NdrPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- if (*pFormat == RPC_FC_RP) + if (*pFormat == FC_RP) { Buffer = pStubMsg->Buffer; /* Do the NULL ref pointer check here because embedded pointers can be @@ -1583,7 +1581,7 @@ void WINAPI NdrPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, /* Increment the buffer length here instead of in PointerBufferSize, * as that is used by embedded pointers which already handle the buffer * length, and shouldn't write anything more to the wire */ - if (*pFormat != RPC_FC_RP) + if (*pFormat != FC_RP) { align_length(&pStubMsg->BufferLength, 4); safe_buffer_length_increment(pStubMsg, 4); @@ -1599,7 +1597,7 @@ ULONG WINAPI NdrPointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { unsigned char *Buffer = pStubMsg->Buffer; - if (*pFormat != RPC_FC_RP) + if (*pFormat != FC_RP) { align_pointer(&pStubMsg->Buffer, 4); safe_buffer_increment(pStubMsg, 4); @@ -1648,39 +1646,39 @@ void WINAPI NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char*
switch(FormatChar) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: BASE_TYPE_UNMARSHALL(UCHAR); TRACE("value: 0x%02x\n", *pMemory); break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: BASE_TYPE_UNMARSHALL(USHORT); TRACE("value: 0x%04x\n", *(USHORT *)pMemory); break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ERROR_STATUS_T: + case FC_ENUM32: BASE_TYPE_UNMARSHALL(ULONG); TRACE("value: 0x%08x\n", *(ULONG *)pMemory); break; - case RPC_FC_FLOAT: + case FC_FLOAT: BASE_TYPE_UNMARSHALL(float); TRACE("value: %f\n", *(float *)pMemory); break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: BASE_TYPE_UNMARSHALL(double); TRACE("value: %f\n", *(double *)pMemory); break; - case RPC_FC_HYPER: + case FC_HYPER: BASE_TYPE_UNMARSHALL(ULONGLONG); TRACE("value: %s\n", wine_dbgstr_longlong(*(ULONGLONG *)pMemory)); break; - case RPC_FC_ENUM16: + case FC_ENUM16: align_pointer(&pStubMsg->Buffer, sizeof(USHORT)); TRACE("pMemory: %p\n", pMemory); /* 16-bits on the wire, but int in memory */ @@ -1688,21 +1686,21 @@ void WINAPI NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pStubMsg->Buffer += sizeof(USHORT); TRACE("value: 0x%08x\n", *(UINT *)pMemory); break; - case RPC_FC_INT3264: + case FC_INT3264: align_pointer(&pStubMsg->Buffer, sizeof(INT)); /* 32-bits on the wire, but int_ptr in memory */ *(INT_PTR *)pMemory = *(INT *)pStubMsg->Buffer; pStubMsg->Buffer += sizeof(INT); TRACE("value: 0x%08lx\n", *(INT_PTR *)pMemory); break; - case RPC_FC_UINT3264: + case FC_UINT3264: align_pointer(&pStubMsg->Buffer, sizeof(UINT)); /* 32-bits on the wire, but int_ptr in memory */ *(UINT_PTR *)pMemory = *(UINT *)pStubMsg->Buffer; pStubMsg->Buffer += sizeof(UINT); TRACE("value: 0x%08lx\n", *(UINT_PTR *)pMemory); break; - case RPC_FC_IGNORE: + case FC_IGNORE: break; default: FIXME("Unhandled base type: 0x%02x\n", FormatChar); @@ -1725,7 +1723,7 @@ unsigned char * WINAPI NdrSimpleStructMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferMark = pStubMsg->Buffer; safe_copy_to_buffer(pStubMsg, pMemory, size);
- if (pFormat[0] != RPC_FC_STRUCT) + if (pFormat[0] != FC_STRUCT) EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat+4);
return NULL; @@ -1756,7 +1754,7 @@ unsigned char * WINAPI NdrSimpleStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; safe_buffer_increment(pStubMsg, size); - if (pFormat[0] == RPC_FC_PSTRUCT) + if (pFormat[0] == FC_PSTRUCT) EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat+4, fMustAlloc);
TRACE("copying %p to %p\n", saved_buffer, *ppMemory); @@ -1779,7 +1777,7 @@ void WINAPI NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, align_length(&pStubMsg->BufferLength, pFormat[1] + 1);
safe_buffer_length_increment(pStubMsg, size); - if (pFormat[0] != RPC_FC_STRUCT) + if (pFormat[0] != FC_STRUCT) EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat+4); }
@@ -1797,7 +1795,7 @@ ULONG WINAPI NdrSimpleStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->MemorySize += size; safe_buffer_increment(pStubMsg, size);
- if (pFormat[0] != RPC_FC_STRUCT) + if (pFormat[0] != FC_STRUCT) EmbeddedPointerMemorySize(pStubMsg, pFormat+4); return pStubMsg->MemorySize; } @@ -1810,7 +1808,7 @@ void WINAPI NdrSimpleStructFree(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); - if (pFormat[0] != RPC_FC_STRUCT) + if (pFormat[0] != FC_STRUCT) EmbeddedPointerFree(pStubMsg, pMemory, pFormat+4); }
@@ -1824,18 +1822,18 @@ static inline void array_compute_and_size_conformance(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: ComputeConformance(pStubMsg, pMemory, pFormat+4, 0); SizeConformance(pStubMsg); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, 0); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0); SizeConformance(pStubMsg); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) { TRACE("string=%s\n", debugstr_a((const char *)pMemory)); pStubMsg->ActualCount = strlen((const char *)pMemory)+1; @@ -1846,14 +1844,14 @@ static inline void array_compute_and_size_conformance( pStubMsg->ActualCount = strlenW((LPCWSTR)pMemory)+1; }
- if (pFormat[1] == RPC_FC_STRING_SIZED) + if (pFormat[1] == FC_STRING_SIZED) pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0); else pStubMsg->MaxCount = pStubMsg->ActualCount;
SizeConformance(pStubMsg); break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: count = *(const WORD *)(pFormat + 2); pFormat += 4; if (IsConformanceOrVariancePresent(pFormat)) SizeConformance(pStubMsg); @@ -1876,7 +1874,7 @@ static inline void array_buffer_size(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -1891,7 +1889,7 @@ static inline void array_buffer_size( if (fHasPointers) EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -1908,9 +1906,9 @@ static inline void array_buffer_size( if (fHasPointers) EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) esize = 1; else esize = 2; @@ -1920,7 +1918,7 @@ static inline void array_buffer_size( size = safe_multiply(esize, pStubMsg->ActualCount); safe_buffer_length_increment(pStubMsg, size); break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: alignment = pFormat[1] + 1; pFormat = SkipConformance(pStubMsg, pFormat + 4); if (IsConformanceOrVariancePresent(pFormat)) SizeVariance(pStubMsg); @@ -1947,18 +1945,18 @@ static inline void array_compute_and_write_conformance(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: ComputeConformance(pStubMsg, pMemory, pFormat+4, 0); WriteConformance(pStubMsg); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, 0); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0); WriteConformance(pStubMsg); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) { TRACE("string=%s\n", debugstr_a((const char *)pMemory)); pStubMsg->ActualCount = strlen((const char *)pMemory)+1; @@ -1968,14 +1966,14 @@ static inline void array_compute_and_write_conformance( TRACE("string=%s\n", debugstr_w((LPCWSTR)pMemory)); pStubMsg->ActualCount = strlenW((LPCWSTR)pMemory)+1; } - if (pFormat[1] == RPC_FC_STRING_SIZED) + if (pFormat[1] == FC_STRING_SIZED) pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0); else pStubMsg->MaxCount = pStubMsg->ActualCount; pStubMsg->Offset = 0; WriteConformance(pStubMsg); break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: def = *(const WORD *)(pFormat + 2); pFormat += 4; conformance_present = IsConformanceOrVariancePresent(pFormat); @@ -1999,7 +1997,7 @@ static inline void array_write_variance_and_marshall(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2015,7 +2013,7 @@ static inline void array_write_variance_and_marshall( if (fHasPointers) EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2035,9 +2033,9 @@ static inline void array_write_variance_and_marshall( if (fHasPointers) EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) esize = 1; else esize = 2; @@ -2047,7 +2045,7 @@ static inline void array_write_variance_and_marshall( size = safe_multiply(esize, pStubMsg->ActualCount); safe_copy_to_buffer(pStubMsg, pMemory, size); /* the string itself */ break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: alignment = pFormat[1] + 1; pFormat = SkipConformance(pStubMsg, pFormat + 4); if (IsConformanceOrVariancePresent(pFormat)) WriteVariance(pStubMsg); @@ -2072,27 +2070,27 @@ static inline ULONG array_read_conformance(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: esize = *(const WORD*)(pFormat+2); pFormat = ReadConformance(pStubMsg, pFormat+4); return safe_multiply(esize, pStubMsg->MaxCount); - case RPC_FC_CVARRAY: + case FC_CVARRAY: esize = *(const WORD*)(pFormat+2); pFormat = ReadConformance(pStubMsg, pFormat+4); return safe_multiply(esize, pStubMsg->MaxCount); - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) esize = 1; else esize = 2;
- if (pFormat[1] == RPC_FC_STRING_SIZED) + if (pFormat[1] == FC_STRING_SIZED) ReadConformance(pStubMsg, pFormat + 2); else ReadConformance(pStubMsg, NULL); return safe_multiply(esize, pStubMsg->MaxCount); - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: def = *(const WORD *)(pFormat + 2); pFormat += 4; if (IsConformanceOrVariancePresent(pFormat)) pFormat = ReadConformance(pStubMsg, pFormat); @@ -2124,7 +2122,7 @@ static inline ULONG array_read_variance_and_unmarshall(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2156,7 +2154,7 @@ static inline ULONG array_read_variance_and_unmarshall( memcpy(*ppMemory, saved_buffer, bufsize); } return bufsize; - case RPC_FC_CVARRAY: + case FC_CVARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2187,16 +2185,16 @@ static inline ULONG array_read_variance_and_unmarshall( memcpy(*ppMemory + offset, saved_buffer, bufsize); } return bufsize; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) esize = 1; else esize = 2;
ReadVariance(pStubMsg, NULL, pStubMsg->MaxCount);
- if (pFormat[1] != RPC_FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount)) + if (pFormat[1] != FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount)) { ERR("buffer size %d must equal memory size %ld for non-sized conformant strings\n", pStubMsg->ActualCount, pStubMsg->MaxCount); @@ -2233,14 +2231,14 @@ static inline ULONG array_read_variance_and_unmarshall( else safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
- if (*pFormat == RPC_FC_C_CSTRING) + if (*pFormat == FC_C_CSTRING) TRACE("string=%s\n", debugstr_a((char*)*ppMemory)); else TRACE("string=%s\n", debugstr_w((LPWSTR)*ppMemory)); } return bufsize;
- case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: alignment = pFormat[1] + 1; pFormat = SkipConformance(pStubMsg, pFormat + 4); pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); @@ -2281,7 +2279,7 @@ static inline void array_memory_size(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2298,7 +2296,7 @@ static inline void array_memory_size( if (fHasPointers) EmbeddedPointerMemorySize(pStubMsg, pFormat); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: esize = *(const WORD*)(pFormat+2); alignment = pFormat[1] + 1;
@@ -2318,16 +2316,16 @@ static inline void array_memory_size( if (fHasPointers) EmbeddedPointerMemorySize(pStubMsg, pFormat); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (fc == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (fc == FC_C_CSTRING) esize = 1; else esize = 2;
ReadVariance(pStubMsg, NULL, pStubMsg->MaxCount);
- if (pFormat[1] != RPC_FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount)) + if (pFormat[1] != FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount)) { ERR("buffer size %d must equal memory size %ld for non-sized conformant strings\n", pStubMsg->ActualCount, pStubMsg->MaxCount); @@ -2347,7 +2345,7 @@ static inline void array_memory_size( safe_buffer_increment(pStubMsg, bufsize); pStubMsg->MemorySize += memsize; break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: alignment = pFormat[1] + 1; pFormat = SkipConformance(pStubMsg, pFormat + 4); pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount); @@ -2379,22 +2377,22 @@ static inline void array_free(
switch (fc) { - case RPC_FC_CARRAY: + case FC_CARRAY: pFormat = ComputeConformance(pStubMsg, pMemory, pFormat+4, 0); if (fHasPointers) EmbeddedPointerFree(pStubMsg, pMemory, pFormat); break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: pFormat = ComputeConformance(pStubMsg, pMemory, pFormat+4, 0); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0); if (fHasPointers) EmbeddedPointerFree(pStubMsg, pMemory, pFormat); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: + case FC_C_CSTRING: + case FC_C_WSTRING: /* No embedded pointers so nothing to do */ break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: count = *(const WORD *)(pFormat + 2); pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, count); pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount); @@ -2434,22 +2432,22 @@ unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg, { TRACE("(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat);
- if (pFormat[0] != RPC_FC_C_CSTRING && pFormat[0] != RPC_FC_C_WSTRING) { + if (pFormat[0] != FC_C_CSTRING && pFormat[0] != FC_C_WSTRING) { ERR("Unhandled string type: %#x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
/* allow compiler to optimise inline function by passing constant into * these functions */ - if (pFormat[0] == RPC_FC_C_CSTRING) { - array_compute_and_write_conformance(RPC_FC_C_CSTRING, pStubMsg, pszMessage, + if (pFormat[0] == FC_C_CSTRING) { + array_compute_and_write_conformance(FC_C_CSTRING, pStubMsg, pszMessage, pFormat); - array_write_variance_and_marshall(RPC_FC_C_CSTRING, pStubMsg, pszMessage, + array_write_variance_and_marshall(FC_C_CSTRING, pStubMsg, pszMessage, pFormat, TRUE /* fHasPointers */); } else { - array_compute_and_write_conformance(RPC_FC_C_WSTRING, pStubMsg, pszMessage, + array_compute_and_write_conformance(FC_C_WSTRING, pStubMsg, pszMessage, pFormat); - array_write_variance_and_marshall(RPC_FC_C_WSTRING, pStubMsg, pszMessage, + array_write_variance_and_marshall(FC_C_WSTRING, pStubMsg, pszMessage, pFormat, TRUE /* fHasPointers */); }
@@ -2464,22 +2462,22 @@ void WINAPI NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(pStubMsg == ^%p, pMemory == ^%p, pFormat == ^%p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_C_CSTRING && pFormat[0] != RPC_FC_C_WSTRING) { + if (pFormat[0] != FC_C_CSTRING && pFormat[0] != FC_C_WSTRING) { ERR("Unhandled string type: %#x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
/* allow compiler to optimise inline function by passing constant into * these functions */ - if (pFormat[0] == RPC_FC_C_CSTRING) { - array_compute_and_size_conformance(RPC_FC_C_CSTRING, pStubMsg, pMemory, + if (pFormat[0] == FC_C_CSTRING) { + array_compute_and_size_conformance(FC_C_CSTRING, pStubMsg, pMemory, pFormat); - array_buffer_size(RPC_FC_C_CSTRING, pStubMsg, pMemory, pFormat, + array_buffer_size(FC_C_CSTRING, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); } else { - array_compute_and_size_conformance(RPC_FC_C_WSTRING, pStubMsg, pMemory, + array_compute_and_size_conformance(FC_C_WSTRING, pStubMsg, pMemory, pFormat); - array_buffer_size(RPC_FC_C_WSTRING, pStubMsg, pMemory, pFormat, + array_buffer_size(FC_C_WSTRING, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); } } @@ -2492,20 +2490,20 @@ ULONG WINAPI NdrConformantStringMemorySize( PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(pStubMsg == ^%p, pFormat == ^%p)\n", pStubMsg, pFormat);
- if (pFormat[0] != RPC_FC_C_CSTRING && pFormat[0] != RPC_FC_C_WSTRING) { + if (pFormat[0] != FC_C_CSTRING && pFormat[0] != FC_C_WSTRING) { ERR("Unhandled string type: %#x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
/* allow compiler to optimise inline function by passing constant into * these functions */ - if (pFormat[0] == RPC_FC_C_CSTRING) { - array_read_conformance(RPC_FC_C_CSTRING, pStubMsg, pFormat); - array_memory_size(RPC_FC_C_CSTRING, pStubMsg, pFormat, + if (pFormat[0] == FC_C_CSTRING) { + array_read_conformance(FC_C_CSTRING, pStubMsg, pFormat); + array_memory_size(FC_C_CSTRING, pStubMsg, pFormat, TRUE /* fHasPointers */); } else { - array_read_conformance(RPC_FC_C_WSTRING, pStubMsg, pFormat); - array_memory_size(RPC_FC_C_WSTRING, pStubMsg, pFormat, + array_read_conformance(FC_C_WSTRING, pStubMsg, pFormat); + array_memory_size(FC_C_WSTRING, pStubMsg, pFormat, TRUE /* fHasPointers */); }
@@ -2521,22 +2519,22 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg TRACE("(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n", pStubMsg, *ppMemory, pFormat, fMustAlloc);
- if (pFormat[0] != RPC_FC_C_CSTRING && pFormat[0] != RPC_FC_C_WSTRING) { + if (pFormat[0] != FC_C_CSTRING && pFormat[0] != FC_C_WSTRING) { ERR("Unhandled string type: %#x\n", *pFormat); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
/* allow compiler to optimise inline function by passing constant into * these functions */ - if (pFormat[0] == RPC_FC_C_CSTRING) { - array_read_conformance(RPC_FC_C_CSTRING, pStubMsg, pFormat); - array_read_variance_and_unmarshall(RPC_FC_C_CSTRING, pStubMsg, ppMemory, + if (pFormat[0] == FC_C_CSTRING) { + array_read_conformance(FC_C_CSTRING, pStubMsg, pFormat); + array_read_variance_and_unmarshall(FC_C_CSTRING, pStubMsg, ppMemory, pFormat, fMustAlloc, TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */); } else { - array_read_conformance(RPC_FC_C_WSTRING, pStubMsg, pFormat); - array_read_variance_and_unmarshall(RPC_FC_C_WSTRING, pStubMsg, ppMemory, + array_read_conformance(FC_C_WSTRING, pStubMsg, pFormat); + array_read_variance_and_unmarshall(FC_C_WSTRING, pStubMsg, ppMemory, pFormat, fMustAlloc, TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */); @@ -2558,7 +2556,7 @@ unsigned char * WINAPI NdrNonConformantStringMarshall(PMIDL_STUB_MESSAGE pStubM
maxsize = *(const USHORT *)&pFormat[2];
- if (*pFormat == RPC_FC_CSTRING) + if (*pFormat == FC_CSTRING) { ULONG i = 0; const char *str = (const char *)pMemory; @@ -2567,7 +2565,7 @@ unsigned char * WINAPI NdrNonConformantStringMarshall(PMIDL_STUB_MESSAGE pStubM pStubMsg->ActualCount = i + 1; esize = 1; } - else if (*pFormat == RPC_FC_WSTRING) + else if (*pFormat == FC_WSTRING) { ULONG i = 0; const WCHAR *str = (const WCHAR *)pMemory; @@ -2613,8 +2611,8 @@ unsigned char * WINAPI NdrNonConformantStringUnmarshall(PMIDL_STUB_MESSAGE pStu RpcRaiseException(RPC_S_INVALID_BOUND); }
- if (*pFormat == RPC_FC_CSTRING) esize = 1; - else if (*pFormat == RPC_FC_WSTRING) esize = 2; + if (*pFormat == FC_CSTRING) esize = 1; + else if (*pFormat == FC_WSTRING) esize = 2; else { ERR("Unhandled string type: %#x\n", *pFormat); @@ -2633,10 +2631,10 @@ unsigned char * WINAPI NdrNonConformantStringUnmarshall(PMIDL_STUB_MESSAGE pStu
safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
- if (*pFormat == RPC_FC_CSTRING) { + if (*pFormat == FC_CSTRING) { TRACE("string=%s\n", debugstr_an((char*)*ppMemory, pStubMsg->ActualCount)); } - else if (*pFormat == RPC_FC_WSTRING) { + else if (*pFormat == FC_WSTRING) { TRACE("string=%s\n", debugstr_wn((LPWSTR)*ppMemory, pStubMsg->ActualCount)); }
@@ -2658,7 +2656,7 @@ void WINAPI NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
SizeVariance(pStubMsg);
- if (*pFormat == RPC_FC_CSTRING) + if (*pFormat == FC_CSTRING) { ULONG i = 0; const char *str = (const char *)pMemory; @@ -2667,7 +2665,7 @@ void WINAPI NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->ActualCount = i + 1; esize = 1; } - else if (*pFormat == RPC_FC_WSTRING) + else if (*pFormat == FC_WSTRING) { ULONG i = 0; const WCHAR *str = (const WCHAR *)pMemory; @@ -2705,8 +2703,8 @@ ULONG WINAPI NdrNonConformantStringMemorySize(PMIDL_STUB_MESSAGE pStubMsg, RpcRaiseException(RPC_S_INVALID_BOUND); }
- if (*pFormat == RPC_FC_CSTRING) esize = 1; - else if (*pFormat == RPC_FC_WSTRING) esize = 2; + if (*pFormat == FC_CSTRING) esize = 1; + else if (*pFormat == FC_WSTRING) esize = 2; else { ERR("Unhandled string type: %#x\n", *pFormat); @@ -2740,54 +2738,54 @@ static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) { switch (*pFormat) { - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_BOGUS_STRUCT: - case RPC_FC_SMFARRAY: - case RPC_FC_SMVARRAY: - case RPC_FC_CSTRING: + case FC_STRUCT: + case FC_PSTRUCT: + case FC_CSTRUCT: + case FC_BOGUS_STRUCT: + case FC_SMFARRAY: + case FC_SMVARRAY: + case FC_CSTRING: return *(const WORD*)&pFormat[2]; - case RPC_FC_USER_MARSHAL: + case FC_USER_MARSHAL: return *(const WORD*)&pFormat[4]; - case RPC_FC_RANGE: { + case FC_RANGE: { switch (((const NDR_RANGE *)pFormat)->flags_type & 0xf) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: return sizeof(UCHAR); - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: return sizeof(USHORT); - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: + case FC_INT3264: + case FC_UINT3264: return sizeof(ULONG); - case RPC_FC_FLOAT: + case FC_FLOAT: return sizeof(float); - case RPC_FC_DOUBLE: + case FC_DOUBLE: return sizeof(double); - case RPC_FC_HYPER: + case FC_HYPER: return sizeof(ULONGLONG); - case RPC_FC_ENUM16: + case FC_ENUM16: return sizeof(UINT); default: ERR("unknown type 0x%x\n", ((const NDR_RANGE *)pFormat)->flags_type & 0xf); RpcRaiseException(RPC_X_BAD_STUB_DATA); } } - case RPC_FC_NON_ENCAPSULATED_UNION: + case FC_NON_ENCAPSULATED_UNION: pFormat += 2; pFormat = SkipConformance(pStubMsg, pFormat); pFormat += *(const SHORT*)pFormat; return *(const SHORT*)pFormat; - case RPC_FC_IP: + case FC_IP: return sizeof(void *); - case RPC_FC_WSTRING: + case FC_WSTRING: return *(const WORD*)&pFormat[2] * 2; default: FIXME("unhandled embedded type %02x\n", *pFormat); @@ -2820,24 +2818,24 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_MARSHALL m; ULONG size;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: TRACE("byte=%d <= %p\n", *(WORD*)pMemory, pMemory); safe_copy_to_buffer(pStubMsg, pMemory, 1); pMemory += 1; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: TRACE("short=%d <= %p\n", *(WORD*)pMemory, pMemory); safe_copy_to_buffer(pStubMsg, pMemory, 2); pMemory += 2; break; - case RPC_FC_ENUM16: + case FC_ENUM16: { USHORT val = *(DWORD *)pMemory; TRACE("enum16=%d <= %p\n", *(DWORD*)pMemory, pMemory); @@ -2847,15 +2845,15 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += 4; break; } - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: TRACE("long=%d <= %p\n", *(DWORD*)pMemory, pMemory); safe_copy_to_buffer(pStubMsg, pMemory, 4); pMemory += 4; break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: { UINT val = *(UINT_PTR *)pMemory; TRACE("int3264=%ld <= %p\n", *(UINT_PTR *)pMemory, pMemory); @@ -2863,34 +2861,34 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += sizeof(UINT_PTR); break; } - case RPC_FC_FLOAT: + case FC_FLOAT: TRACE("float=%f <= %p\n", *(float*)pMemory, pMemory); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(float)); pMemory += sizeof(float); break; - case RPC_FC_HYPER: + case FC_HYPER: TRACE("longlong=%s <= %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory); safe_copy_to_buffer(pStubMsg, pMemory, 8); pMemory += 8; break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: TRACE("double=%f <= %p\n", *(double*)pMemory, pMemory); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(double)); pMemory += sizeof(double); break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: { unsigned char *saved_buffer; BOOL pointer_buffer_mark_set = FALSE; TRACE("pointer=%p <= %p\n", *(unsigned char**)pMemory, pMemory); TRACE("pStubMsg->Buffer before %p\n", pStubMsg->Buffer); - if (*pFormat != RPC_FC_POINTER) + if (*pFormat != FC_POINTER) pPointer = pFormat; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) align_pointer_clear(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; if (pStubMsg->PointerBufferMark) @@ -2899,7 +2897,7 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; pointer_buffer_mark_set = TRUE; } - else if (*pPointer != RPC_FC_RP) + else if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ PointerMarshall(pStubMsg, saved_buffer, *(unsigned char**)pMemory, pPointer); if (pointer_buffer_mark_set) @@ -2907,36 +2905,36 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, STD_OVERFLOW_CHECK(pStubMsg); pStubMsg->PointerBufferMark = pStubMsg->Buffer; pStubMsg->Buffer = saved_buffer; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } TRACE("pStubMsg->Buffer after %p\n", pStubMsg->Buffer); - if (*pFormat == RPC_FC_POINTER) + if (*pFormat == FC_POINTER) pPointer += 4; else pFormat += 4; pMemory += sizeof(void *); break; } - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_pointer(&pMemory, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_pointer(&pMemory, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_pointer(&pMemory, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + pMemory += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: pMemory += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; @@ -2946,10 +2944,10 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, if (m) { /* for some reason interface pointers aren't generated as - * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet + * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet * they still need the dereferencing treatment that pointers are * given */ - if (*desc == RPC_FC_IP) + if (*desc == FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); else m(pStubMsg, pMemory, desc); @@ -2958,7 +2956,7 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += size; pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format 0x%02x\n", *pFormat); @@ -2979,24 +2977,24 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_UNMARSHALL m; ULONG size;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: safe_copy_from_buffer(pStubMsg, pMemory, 1); TRACE("byte=%d => %p\n", *(WORD*)pMemory, pMemory); pMemory += 1; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: safe_copy_from_buffer(pStubMsg, pMemory, 2); TRACE("short=%d => %p\n", *(WORD*)pMemory, pMemory); pMemory += 2; break; - case RPC_FC_ENUM16: + case FC_ENUM16: { WORD val; safe_copy_from_buffer(pStubMsg, &val, 2); @@ -3007,14 +3005,14 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += 4; break; } - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: safe_copy_from_buffer(pStubMsg, pMemory, 4); TRACE("long=%d => %p\n", *(DWORD*)pMemory, pMemory); pMemory += 4; break; - case RPC_FC_INT3264: + case FC_INT3264: { INT val; safe_copy_from_buffer(pStubMsg, &val, 4); @@ -3023,7 +3021,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += sizeof(INT_PTR); break; } - case RPC_FC_UINT3264: + case FC_UINT3264: { UINT val; safe_copy_from_buffer(pStubMsg, &val, 4); @@ -3032,33 +3030,33 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += sizeof(UINT_PTR); break; } - case RPC_FC_FLOAT: + case FC_FLOAT: safe_copy_from_buffer(pStubMsg, pMemory, sizeof(float)); TRACE("float=%f => %p\n", *(float*)pMemory, pMemory); pMemory += sizeof(float); break; - case RPC_FC_HYPER: + case FC_HYPER: safe_copy_from_buffer(pStubMsg, pMemory, 8); TRACE("longlong=%s => %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory); pMemory += 8; break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: safe_copy_from_buffer(pStubMsg, pMemory, sizeof(double)); TRACE("double=%f => %p\n", *(double*)pMemory, pMemory); pMemory += sizeof(double); break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: { unsigned char *saved_buffer; BOOL pointer_buffer_mark_set = FALSE; TRACE("pointer => %p\n", pMemory); - if (*pFormat != RPC_FC_POINTER) + if (*pFormat != FC_POINTER) pPointer = pFormat; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) align_pointer(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; if (pStubMsg->PointerBufferMark) @@ -3067,7 +3065,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; pointer_buffer_mark_set = TRUE; } - else if (*pPointer != RPC_FC_RP) + else if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
PointerUnmarshall(pStubMsg, saved_buffer, (unsigned char**)pMemory, *(unsigned char**)pMemory, pPointer, fMustAlloc); @@ -3076,36 +3074,36 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, STD_OVERFLOW_CHECK(pStubMsg); pStubMsg->PointerBufferMark = pStubMsg->Buffer; pStubMsg->Buffer = saved_buffer; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } - if (*pFormat == RPC_FC_POINTER) + if (*pFormat == FC_POINTER) pPointer += 4; else pFormat += 4; pMemory += sizeof(void *); break; } - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_pointer_clear(&pMemory, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_pointer_clear(&pMemory, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_pointer_clear(&pMemory, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - memset(pMemory, 0, *pFormat - RPC_FC_STRUCTPAD1 + 1); - pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + memset(pMemory, 0, *pFormat - FC_STRUCTPAD1 + 1); + pMemory += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: pMemory += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; @@ -3122,10 +3120,10 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, if (m) { /* for some reason interface pointers aren't generated as - * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet + * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet * they still need the dereferencing treatment that pointers are * given */ - if (*desc == RPC_FC_IP) + if (*desc == FC_IP) m(pStubMsg, (unsigned char **)pMemory, desc, FALSE); else m(pStubMsg, &pMemory, desc, FALSE); @@ -3134,7 +3132,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pMemory += size; pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format %d\n", *pFormat); @@ -3154,48 +3152,48 @@ static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, NDR_BUFFERSIZE m; ULONG size;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: safe_buffer_length_increment(pStubMsg, 1); pMemory += 1; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: safe_buffer_length_increment(pStubMsg, 2); pMemory += 2; break; - case RPC_FC_ENUM16: + case FC_ENUM16: safe_buffer_length_increment(pStubMsg, 2); pMemory += 4; break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: - case RPC_FC_FLOAT: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: + case FC_FLOAT: safe_buffer_length_increment(pStubMsg, 4); pMemory += 4; break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: safe_buffer_length_increment(pStubMsg, 4); pMemory += sizeof(INT_PTR); break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: safe_buffer_length_increment(pStubMsg, 8); pMemory += 8; break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: - if (*pFormat != RPC_FC_POINTER) + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: + if (*pFormat != FC_POINTER) pPointer = pFormat; if (!pStubMsg->IgnoreEmbeddedPointers) { @@ -3208,36 +3206,36 @@ static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerLength = pStubMsg->BufferLength; pStubMsg->BufferLength = saved_buffer_length; } - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) { align_length(&pStubMsg->BufferLength, 4); safe_buffer_length_increment(pStubMsg, 4); } - if (*pFormat == RPC_FC_POINTER) + if (*pFormat == FC_POINTER) pPointer += 4; else pFormat += 4; pMemory += sizeof(void*); break; - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_pointer(&pMemory, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_pointer(&pMemory, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_pointer(&pMemory, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + pMemory += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: pMemory += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; @@ -3246,10 +3244,10 @@ static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, if (m) { /* for some reason interface pointers aren't generated as - * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet + * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet * they still need the dereferencing treatment that pointers are * given */ - if (*desc == RPC_FC_IP) + if (*desc == FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); else m(pStubMsg, pMemory, desc); @@ -3258,7 +3256,7 @@ static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pMemory += size; pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format 0x%02x\n", *pFormat); @@ -3278,67 +3276,67 @@ static unsigned char * ComplexFree(PMIDL_STUB_MESSAGE pStubMsg, NDR_FREE m; ULONG size;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: pMemory += 1; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: pMemory += 2; break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: - case RPC_FC_FLOAT: + case FC_LONG: + case FC_ULONG: + case FC_ENUM16: + case FC_ENUM32: + case FC_FLOAT: pMemory += 4; break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: pMemory += sizeof(INT_PTR); break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: pMemory += 8; break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: - if (*pFormat != RPC_FC_POINTER) + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: + if (*pFormat != FC_POINTER) pPointer = pFormat; NdrPointerFree(pStubMsg, *(unsigned char**)pMemory, pPointer); - if (*pFormat == RPC_FC_POINTER) + if (*pFormat == FC_POINTER) pPointer += 4; else pFormat += 4; pMemory += sizeof(void *); break; - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_pointer(&pMemory, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_pointer(&pMemory, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_pointer(&pMemory, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + pMemory += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: pMemory += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; @@ -3347,10 +3345,10 @@ static unsigned char * ComplexFree(PMIDL_STUB_MESSAGE pStubMsg, if (m) { /* for some reason interface pointers aren't generated as - * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet + * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet * they still need the dereferencing treatment that pointers are * given */ - if (*desc == RPC_FC_IP) + if (*desc == FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); else m(pStubMsg, pMemory, desc); @@ -3358,7 +3356,7 @@ static unsigned char * ComplexFree(PMIDL_STUB_MESSAGE pStubMsg, pMemory += size; pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format 0x%02x\n", *pFormat); @@ -3376,53 +3374,53 @@ static ULONG ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING desc; ULONG size = 0;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: size += 1; safe_buffer_increment(pStubMsg, 1); break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: size += 2; safe_buffer_increment(pStubMsg, 2); break; - case RPC_FC_ENUM16: + case FC_ENUM16: size += 4; safe_buffer_increment(pStubMsg, 2); break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: - case RPC_FC_FLOAT: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: + case FC_FLOAT: size += 4; safe_buffer_increment(pStubMsg, 4); break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: size += sizeof(INT_PTR); safe_buffer_increment(pStubMsg, 4); break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: size += 8; safe_buffer_increment(pStubMsg, 8); break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: { unsigned char *saved_buffer; BOOL pointer_buffer_mark_set = FALSE; - if (*pFormat != RPC_FC_POINTER) + if (*pFormat != FC_POINTER) pPointer = pFormat; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) align_pointer(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; if (pStubMsg->PointerBufferMark) @@ -3431,7 +3429,7 @@ static ULONG ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->PointerBufferMark = NULL; pointer_buffer_mark_set = TRUE; } - else if (*pPointer != RPC_FC_RP) + else if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
if (!pStubMsg->IgnoreEmbeddedPointers) @@ -3441,42 +3439,42 @@ static ULONG ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, STD_OVERFLOW_CHECK(pStubMsg); pStubMsg->PointerBufferMark = pStubMsg->Buffer; pStubMsg->Buffer = saved_buffer; - if (*pPointer != RPC_FC_RP) + if (*pPointer != FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } - if (*pFormat == RPC_FC_POINTER) + if (*pFormat == FC_POINTER) pPointer += 4; else pFormat += 4; size += sizeof(void *); break; } - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_length(&size, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_length(&size, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_length(&size, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - size += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + size += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: size += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; size += EmbeddedComplexMemorySize(pStubMsg, desc); pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format 0x%02x\n", *pFormat); @@ -3492,69 +3490,69 @@ ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) PFORMAT_STRING desc; ULONG size = 0;
- while (*pFormat != RPC_FC_END) { + while (*pFormat != FC_END) { switch (*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: size += 1; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: size += 2; break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: - case RPC_FC_FLOAT: + case FC_LONG: + case FC_ULONG: + case FC_ENUM16: + case FC_ENUM32: + case FC_FLOAT: size += 4; break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: size += sizeof(INT_PTR); break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: size += 8; break; - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: - case RPC_FC_POINTER: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: + case FC_POINTER: size += sizeof(void *); - if (*pFormat != RPC_FC_POINTER) + if (*pFormat != FC_POINTER) pFormat += 4; break; - case RPC_FC_ALIGNM2: + case FC_ALIGNM2: align_length(&size, 2); break; - case RPC_FC_ALIGNM4: + case FC_ALIGNM4: align_length(&size, 4); break; - case RPC_FC_ALIGNM8: + case FC_ALIGNM8: align_length(&size, 8); break; - case RPC_FC_STRUCTPAD1: - case RPC_FC_STRUCTPAD2: - case RPC_FC_STRUCTPAD3: - case RPC_FC_STRUCTPAD4: - case RPC_FC_STRUCTPAD5: - case RPC_FC_STRUCTPAD6: - case RPC_FC_STRUCTPAD7: - size += *pFormat - RPC_FC_STRUCTPAD1 + 1; + case FC_STRUCTPAD1: + case FC_STRUCTPAD2: + case FC_STRUCTPAD3: + case FC_STRUCTPAD4: + case FC_STRUCTPAD5: + case FC_STRUCTPAD6: + case FC_STRUCTPAD7: + size += *pFormat - FC_STRUCTPAD1 + 1; break; - case RPC_FC_EMBEDDED_COMPLEX: + case FC_EMBEDDED_COMPLEX: size += pFormat[1]; pFormat += 2; desc = pFormat + *(const SHORT*)pFormat; size += EmbeddedComplexSize(pStubMsg, desc); pFormat += 2; continue; - case RPC_FC_PAD: + case FC_PAD: break; default: FIXME("unhandled format 0x%02x\n", *pFormat); @@ -3904,15 +3902,15 @@ unsigned char * WINAPI NdrConformantArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); - if (pFormat[0] != RPC_FC_CARRAY) + if (pFormat[0] != FC_CARRAY) { ERR("invalid format = 0x%x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- array_compute_and_write_conformance(RPC_FC_CARRAY, pStubMsg, pMemory, + array_compute_and_write_conformance(FC_CARRAY, pStubMsg, pMemory, pFormat); - array_write_variance_and_marshall(RPC_FC_CARRAY, pStubMsg, pMemory, pFormat, + array_write_variance_and_marshall(FC_CARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */);
return NULL; @@ -3927,14 +3925,14 @@ unsigned char * WINAPI NdrConformantArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char fMustAlloc) { TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); - if (pFormat[0] != RPC_FC_CARRAY) + if (pFormat[0] != FC_CARRAY) { ERR("invalid format = 0x%x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- array_read_conformance(RPC_FC_CARRAY, pStubMsg, pFormat); - array_read_variance_and_unmarshall(RPC_FC_CARRAY, pStubMsg, ppMemory, pFormat, + array_read_conformance(FC_CARRAY, pStubMsg, pFormat); + array_read_variance_and_unmarshall(FC_CARRAY, pStubMsg, ppMemory, pFormat, fMustAlloc, TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */); @@ -3950,14 +3948,14 @@ void WINAPI NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); - if (pFormat[0] != RPC_FC_CARRAY) + if (pFormat[0] != FC_CARRAY) { ERR("invalid format = 0x%x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- array_compute_and_size_conformance(RPC_FC_CARRAY, pStubMsg, pMemory, pFormat); - array_buffer_size(RPC_FC_CARRAY, pStubMsg, pMemory, pFormat, + array_compute_and_size_conformance(FC_CARRAY, pStubMsg, pMemory, pFormat); + array_buffer_size(FC_CARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); }
@@ -3968,14 +3966,14 @@ ULONG WINAPI NdrConformantArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { TRACE("(%p,%p)\n", pStubMsg, pFormat); - if (pFormat[0] != RPC_FC_CARRAY) + if (pFormat[0] != FC_CARRAY) { ERR("invalid format = 0x%x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- array_read_conformance(RPC_FC_CARRAY, pStubMsg, pFormat); - array_memory_size(RPC_FC_CARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */); + array_read_conformance(FC_CARRAY, pStubMsg, pFormat); + array_memory_size(FC_CARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */);
return pStubMsg->MemorySize; } @@ -3988,13 +3986,13 @@ void WINAPI NdrConformantArrayFree(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat); - if (pFormat[0] != RPC_FC_CARRAY) + if (pFormat[0] != FC_CARRAY) { ERR("invalid format = 0x%x\n", pFormat[0]); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- array_free(RPC_FC_CARRAY, pStubMsg, pMemory, pFormat, + array_free(FC_CARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); }
@@ -4008,16 +4006,16 @@ unsigned char* WINAPI NdrConformantVaryingArrayMarshall( PMIDL_STUB_MESSAGE pStu { TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_CVARRAY) + if (pFormat[0] != FC_CVARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return NULL; }
- array_compute_and_write_conformance(RPC_FC_CVARRAY, pStubMsg, pMemory, + array_compute_and_write_conformance(FC_CVARRAY, pStubMsg, pMemory, pFormat); - array_write_variance_and_marshall(RPC_FC_CVARRAY, pStubMsg, pMemory, + array_write_variance_and_marshall(FC_CVARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */);
return NULL; @@ -4034,15 +4032,15 @@ unsigned char* WINAPI NdrConformantVaryingArrayUnmarshall( PMIDL_STUB_MESSAGE pS { TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- if (pFormat[0] != RPC_FC_CVARRAY) + if (pFormat[0] != FC_CVARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return NULL; }
- array_read_conformance(RPC_FC_CVARRAY, pStubMsg, pFormat); - array_read_variance_and_unmarshall(RPC_FC_CVARRAY, pStubMsg, ppMemory, + array_read_conformance(FC_CVARRAY, pStubMsg, pFormat); + array_read_variance_and_unmarshall(FC_CVARRAY, pStubMsg, ppMemory, pFormat, fMustAlloc, TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */); @@ -4060,14 +4058,14 @@ void WINAPI NdrConformantVaryingArrayFree( PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_CVARRAY) + if (pFormat[0] != FC_CVARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return; }
- array_free(RPC_FC_CVARRAY, pStubMsg, pMemory, pFormat, + array_free(FC_CVARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); }
@@ -4080,16 +4078,16 @@ void WINAPI NdrConformantVaryingArrayBufferSize( PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_CVARRAY) + if (pFormat[0] != FC_CVARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return; }
- array_compute_and_size_conformance(RPC_FC_CVARRAY, pStubMsg, pMemory, + array_compute_and_size_conformance(FC_CVARRAY, pStubMsg, pMemory, pFormat); - array_buffer_size(RPC_FC_CVARRAY, pStubMsg, pMemory, pFormat, + array_buffer_size(FC_CVARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); }
@@ -4102,15 +4100,15 @@ ULONG WINAPI NdrConformantVaryingArrayMemorySize( PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(%p, %p)\n", pStubMsg, pFormat);
- if (pFormat[0] != RPC_FC_CVARRAY) + if (pFormat[0] != FC_CVARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return pStubMsg->MemorySize; }
- array_read_conformance(RPC_FC_CVARRAY, pStubMsg, pFormat); - array_memory_size(RPC_FC_CVARRAY, pStubMsg, pFormat, + array_read_conformance(FC_CVARRAY, pStubMsg, pFormat); + array_memory_size(FC_CVARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */);
return pStubMsg->MemorySize; @@ -4128,7 +4126,7 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_BOGUS_ARRAY) + if (pFormat[0] != FC_BOGUS_ARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4164,8 +4162,8 @@ unsigned char * WINAPI NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferLength = saved_buffer_length; }
- array_compute_and_write_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); - array_write_variance_and_marshall(RPC_FC_BOGUS_ARRAY, pStubMsg, + array_compute_and_write_conformance(FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); + array_write_variance_and_marshall(FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */);
STD_OVERFLOW_CHECK(pStubMsg); @@ -4193,7 +4191,7 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- if (pFormat[0] != RPC_FC_BOGUS_ARRAY) + if (pFormat[0] != FC_BOGUS_ARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4220,8 +4218,8 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, /* restore the original buffer */ pStubMsg->Buffer = saved_buffer;
- array_read_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat); - array_read_variance_and_unmarshall(RPC_FC_BOGUS_ARRAY, pStubMsg, ppMemory, pFormat, fMustAlloc, + array_read_conformance(FC_BOGUS_ARRAY, pStubMsg, pFormat); + array_read_variance_and_unmarshall(FC_BOGUS_ARRAY, pStubMsg, ppMemory, pFormat, fMustAlloc, TRUE /* fUseBufferMemoryServer */, TRUE /* fUnmarshall */);
if (pointer_buffer_mark_set) @@ -4244,7 +4242,7 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_BOGUS_ARRAY) + if (pFormat[0] != FC_BOGUS_ARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4278,8 +4276,8 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferLength = saved_buffer_length; }
- array_compute_and_size_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); - array_buffer_size(RPC_FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */); + array_compute_and_size_conformance(FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat); + array_buffer_size(FC_BOGUS_ARRAY, pStubMsg, pMemory, pFormat, TRUE /* fHasPointers */);
if(pointer_length_set) { @@ -4296,15 +4294,15 @@ ULONG WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, { TRACE("(%p,%p)\n", pStubMsg, pFormat);
- if (pFormat[0] != RPC_FC_BOGUS_ARRAY) + if (pFormat[0] != FC_BOGUS_ARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return 0; }
- array_read_conformance(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat); - array_memory_size(RPC_FC_BOGUS_ARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */); + array_read_conformance(FC_BOGUS_ARRAY, pStubMsg, pFormat); + array_memory_size(FC_BOGUS_ARRAY, pStubMsg, pFormat, TRUE /* fHasPointers */); return pStubMsg->MemorySize; }
@@ -4319,7 +4317,7 @@ void WINAPI NdrComplexArrayFree(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
- if (pFormat[0] != RPC_FC_BOGUS_ARRAY) + if (pFormat[0] != FC_BOGUS_ARRAY) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4678,7 +4676,7 @@ unsigned char * WINAPI NdrConformantStructMarshall(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CSTRUCT_FORMAT); - if ((pCStructFormat->type != RPC_FC_CPSTRUCT) && (pCStructFormat->type != RPC_FC_CSTRUCT)) + if ((pCStructFormat->type != FC_CPSTRUCT) && (pCStructFormat->type != FC_CSTRUCT)) { ERR("invalid format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4687,7 +4685,7 @@ unsigned char * WINAPI NdrConformantStructMarshall(PMIDL_STUB_MESSAGE pStubMsg,
pCArrayFormat = (const unsigned char *)&pCStructFormat->offset_to_array_description + pCStructFormat->offset_to_array_description; - if (*pCArrayFormat != RPC_FC_CARRAY) + if (*pCArrayFormat != FC_CARRAY) { ERR("invalid array format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4715,7 +4713,7 @@ unsigned char * WINAPI NdrConformantStructMarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferMark = pStubMsg->Buffer; safe_copy_to_buffer(pStubMsg, pMemory, pCStructFormat->memory_size + bufsize);
- if (pCStructFormat->type == RPC_FC_CPSTRUCT) + if (pCStructFormat->type == FC_CPSTRUCT) EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat);
return NULL; @@ -4737,7 +4735,7 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
pFormat += sizeof(NDR_CSTRUCT_FORMAT); - if ((pCStructFormat->type != RPC_FC_CPSTRUCT) && (pCStructFormat->type != RPC_FC_CSTRUCT)) + if ((pCStructFormat->type != FC_CPSTRUCT) && (pCStructFormat->type != FC_CSTRUCT)) { ERR("invalid format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4745,7 +4743,7 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs } pCArrayFormat = (const unsigned char *)&pCStructFormat->offset_to_array_description + pCStructFormat->offset_to_array_description; - if (*pCArrayFormat != RPC_FC_CARRAY) + if (*pCArrayFormat != FC_CARRAY) { ERR("invalid array format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4781,7 +4779,7 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs
saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; safe_buffer_increment(pStubMsg, pCStructFormat->memory_size + bufsize); - if (pCStructFormat->type == RPC_FC_CPSTRUCT) + if (pCStructFormat->type == FC_CPSTRUCT) EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc);
TRACE("copying %p to %p\n", saved_buffer, *ppMemory); @@ -4805,7 +4803,7 @@ void WINAPI NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CSTRUCT_FORMAT); - if ((pCStructFormat->type != RPC_FC_CPSTRUCT) && (pCStructFormat->type != RPC_FC_CSTRUCT)) + if ((pCStructFormat->type != FC_CPSTRUCT) && (pCStructFormat->type != FC_CSTRUCT)) { ERR("invalid format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4813,7 +4811,7 @@ void WINAPI NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, } pCArrayFormat = (const unsigned char *)&pCStructFormat->offset_to_array_description + pCStructFormat->offset_to_array_description; - if (*pCArrayFormat != RPC_FC_CARRAY) + if (*pCArrayFormat != FC_CARRAY) { ERR("invalid array format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4831,7 +4829,7 @@ void WINAPI NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, safe_buffer_length_increment(pStubMsg, pCStructFormat->memory_size); safe_buffer_length_increment(pStubMsg, safe_multiply(pStubMsg->MaxCount, esize));
- if (pCStructFormat->type == RPC_FC_CPSTRUCT) + if (pCStructFormat->type == FC_CPSTRUCT) EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat); }
@@ -4858,7 +4856,7 @@ void WINAPI NdrConformantStructFree(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CSTRUCT_FORMAT); - if ((pCStructFormat->type != RPC_FC_CPSTRUCT) && (pCStructFormat->type != RPC_FC_CSTRUCT)) + if ((pCStructFormat->type != FC_CPSTRUCT) && (pCStructFormat->type != FC_CSTRUCT)) { ERR("invalid format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4867,7 +4865,7 @@ void WINAPI NdrConformantStructFree(PMIDL_STUB_MESSAGE pStubMsg,
pCArrayFormat = (const unsigned char *)&pCStructFormat->offset_to_array_description + pCStructFormat->offset_to_array_description; - if (*pCArrayFormat != RPC_FC_CARRAY) + if (*pCArrayFormat != FC_CARRAY) { ERR("invalid array format type %x\n", pCStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4882,7 +4880,7 @@ void WINAPI NdrConformantStructFree(PMIDL_STUB_MESSAGE pStubMsg, /* copy constant sized part of struct */ pStubMsg->BufferMark = pStubMsg->Buffer;
- if (pCStructFormat->type == RPC_FC_CPSTRUCT) + if (pCStructFormat->type == FC_CPSTRUCT) EmbeddedPointerFree(pStubMsg, pMemory, pFormat); }
@@ -4899,7 +4897,7 @@ unsigned char * WINAPI NdrConformantVaryingStructMarshall(PMIDL_STUB_MESSAGE pS TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CVSTRUCT_FORMAT); - if (pCVStructFormat->type != RPC_FC_CVSTRUCT) + if (pCVStructFormat->type != FC_CVSTRUCT) { ERR("invalid format type %x\n", pCVStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -4948,7 +4946,7 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
pFormat += sizeof(NDR_CVSTRUCT_FORMAT); - if (pCVStructFormat->type != RPC_FC_CVSTRUCT) + if (pCVStructFormat->type != FC_CVSTRUCT) { ERR("invalid format type %x\n", pCVStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5001,9 +4999,9 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE memcpy(*ppMemory + pCVStructFormat->memory_size + offset, saved_array_buffer, bufsize);
- if (*pCVArrayFormat == RPC_FC_C_CSTRING) + if (*pCVArrayFormat == FC_C_CSTRING) TRACE("string=%s\n", debugstr_a((char *)(*ppMemory + pCVStructFormat->memory_size))); - else if (*pCVArrayFormat == RPC_FC_C_WSTRING) + else if (*pCVArrayFormat == FC_C_WSTRING) TRACE("string=%s\n", debugstr_w((WCHAR *)(*ppMemory + pCVStructFormat->memory_size)));
return NULL; @@ -5022,7 +5020,7 @@ void WINAPI NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CVSTRUCT_FORMAT); - if (pCVStructFormat->type != RPC_FC_CVSTRUCT) + if (pCVStructFormat->type != FC_CVSTRUCT) { ERR("invalid format type %x\n", pCVStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5060,7 +5058,7 @@ ULONG WINAPI NdrConformantVaryingStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p)\n", pStubMsg, pFormat);
pFormat += sizeof(NDR_CVSTRUCT_FORMAT); - if (pCVStructFormat->type != RPC_FC_CVSTRUCT) + if (pCVStructFormat->type != FC_CVSTRUCT) { ERR("invalid format type %x\n", pCVStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5099,7 +5097,7 @@ void WINAPI NdrConformantVaryingStructFree(PMIDL_STUB_MESSAGE pStubMsg, TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
pFormat += sizeof(NDR_CVSTRUCT_FORMAT); - if (pCVStructFormat->type != RPC_FC_CVSTRUCT) + if (pCVStructFormat->type != FC_CVSTRUCT) { ERR("invalid format type %x\n", pCVStructFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5145,8 +5143,8 @@ unsigned char * WINAPI NdrFixedArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pSmFArrayFormat->type != RPC_FC_SMFARRAY) && - (pSmFArrayFormat->type != RPC_FC_LGFARRAY)) + if ((pSmFArrayFormat->type != FC_SMFARRAY) && + (pSmFArrayFormat->type != FC_LGFARRAY)) { ERR("invalid format type %x\n", pSmFArrayFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5155,7 +5153,7 @@ unsigned char * WINAPI NdrFixedArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
align_pointer_clear(&pStubMsg->Buffer, pSmFArrayFormat->alignment + 1);
- if (pSmFArrayFormat->type == RPC_FC_SMFARRAY) + if (pSmFArrayFormat->type == FC_SMFARRAY) { total_size = pSmFArrayFormat->total_size; pFormat = (const unsigned char *)(pSmFArrayFormat + 1); @@ -5189,8 +5187,8 @@ unsigned char * WINAPI NdrFixedArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- if ((pSmFArrayFormat->type != RPC_FC_SMFARRAY) && - (pSmFArrayFormat->type != RPC_FC_LGFARRAY)) + if ((pSmFArrayFormat->type != FC_SMFARRAY) && + (pSmFArrayFormat->type != FC_LGFARRAY)) { ERR("invalid format type %x\n", pSmFArrayFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5199,7 +5197,7 @@ unsigned char * WINAPI NdrFixedArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
align_pointer(&pStubMsg->Buffer, pSmFArrayFormat->alignment + 1);
- if (pSmFArrayFormat->type == RPC_FC_SMFARRAY) + if (pSmFArrayFormat->type == FC_SMFARRAY) { total_size = pSmFArrayFormat->total_size; pFormat = (const unsigned char *)(pSmFArrayFormat + 1); @@ -5243,8 +5241,8 @@ void WINAPI NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pSmFArrayFormat->type != RPC_FC_SMFARRAY) && - (pSmFArrayFormat->type != RPC_FC_LGFARRAY)) + if ((pSmFArrayFormat->type != FC_SMFARRAY) && + (pSmFArrayFormat->type != FC_LGFARRAY)) { ERR("invalid format type %x\n", pSmFArrayFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5253,7 +5251,7 @@ void WINAPI NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
align_length(&pStubMsg->BufferLength, pSmFArrayFormat->alignment + 1);
- if (pSmFArrayFormat->type == RPC_FC_SMFARRAY) + if (pSmFArrayFormat->type == FC_SMFARRAY) { total_size = pSmFArrayFormat->total_size; pFormat = (const unsigned char *)(pSmFArrayFormat + 1); @@ -5280,8 +5278,8 @@ ULONG WINAPI NdrFixedArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p)\n", pStubMsg, pFormat);
- if ((pSmFArrayFormat->type != RPC_FC_SMFARRAY) && - (pSmFArrayFormat->type != RPC_FC_LGFARRAY)) + if ((pSmFArrayFormat->type != FC_SMFARRAY) && + (pSmFArrayFormat->type != FC_LGFARRAY)) { ERR("invalid format type %x\n", pSmFArrayFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5290,7 +5288,7 @@ ULONG WINAPI NdrFixedArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
align_pointer(&pStubMsg->Buffer, pSmFArrayFormat->alignment + 1);
- if (pSmFArrayFormat->type == RPC_FC_SMFARRAY) + if (pSmFArrayFormat->type == FC_SMFARRAY) { total_size = pSmFArrayFormat->total_size; pFormat = (const unsigned char *)(pSmFArrayFormat + 1); @@ -5321,15 +5319,15 @@ void WINAPI NdrFixedArrayFree(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pSmFArrayFormat->type != RPC_FC_SMFARRAY) && - (pSmFArrayFormat->type != RPC_FC_LGFARRAY)) + if ((pSmFArrayFormat->type != FC_SMFARRAY) && + (pSmFArrayFormat->type != FC_LGFARRAY)) { ERR("invalid format type %x\n", pSmFArrayFormat->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); return; }
- if (pSmFArrayFormat->type == RPC_FC_SMFARRAY) + if (pSmFArrayFormat->type == FC_SMFARRAY) pFormat = (const unsigned char *)(pSmFArrayFormat + 1); else { @@ -5353,8 +5351,8 @@ unsigned char * WINAPI NdrVaryingArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pFormat[0] != RPC_FC_SMVARRAY) && - (pFormat[0] != RPC_FC_LGVARRAY)) + if ((pFormat[0] != FC_SMVARRAY) && + (pFormat[0] != FC_LGVARRAY)) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5363,7 +5361,7 @@ unsigned char * WINAPI NdrVaryingArrayMarshall(PMIDL_STUB_MESSAGE pStubMsg,
alignment = pFormat[1] + 1;
- if (pFormat[0] == RPC_FC_SMVARRAY) + if (pFormat[0] == FC_SMVARRAY) { pFormat += 2; pFormat += sizeof(WORD); @@ -5418,8 +5416,8 @@ unsigned char * WINAPI NdrVaryingArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
- if ((pFormat[0] != RPC_FC_SMVARRAY) && - (pFormat[0] != RPC_FC_LGVARRAY)) + if ((pFormat[0] != FC_SMVARRAY) && + (pFormat[0] != FC_LGVARRAY)) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5428,7 +5426,7 @@ unsigned char * WINAPI NdrVaryingArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
alignment = pFormat[1] + 1;
- if (pFormat[0] == RPC_FC_SMVARRAY) + if (pFormat[0] == FC_SMVARRAY) { pFormat += 2; size = *(const WORD*)pFormat; @@ -5481,8 +5479,8 @@ void WINAPI NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pFormat[0] != RPC_FC_SMVARRAY) && - (pFormat[0] != RPC_FC_LGVARRAY)) + if ((pFormat[0] != FC_SMVARRAY) && + (pFormat[0] != FC_LGVARRAY)) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5491,7 +5489,7 @@ void WINAPI NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
alignment = pFormat[1] + 1;
- if (pFormat[0] == RPC_FC_SMVARRAY) + if (pFormat[0] == FC_SMVARRAY) { pFormat += 2; pFormat += sizeof(WORD); @@ -5537,8 +5535,8 @@ ULONG WINAPI NdrVaryingArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p)\n", pStubMsg, pFormat);
- if ((pFormat[0] != RPC_FC_SMVARRAY) && - (pFormat[0] != RPC_FC_LGVARRAY)) + if ((pFormat[0] != FC_SMVARRAY) && + (pFormat[0] != FC_LGVARRAY)) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -5547,7 +5545,7 @@ ULONG WINAPI NdrVaryingArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
alignment = pFormat[1] + 1;
- if (pFormat[0] == RPC_FC_SMVARRAY) + if (pFormat[0] == FC_SMVARRAY) { pFormat += 2; size = *(const WORD*)pFormat; @@ -5590,15 +5588,15 @@ void WINAPI NdrVaryingArrayFree(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p, %p, %p)\n", pStubMsg, pMemory, pFormat);
- if ((pFormat[0] != RPC_FC_SMVARRAY) && - (pFormat[0] != RPC_FC_LGVARRAY)) + if ((pFormat[0] != FC_SMVARRAY) && + (pFormat[0] != FC_LGVARRAY)) { ERR("invalid format type %x\n", pFormat[0]); RpcRaiseException(RPC_S_INTERNAL_ERROR); return; }
- if (pFormat[0] == RPC_FC_SMVARRAY) + if (pFormat[0] == FC_SMVARRAY) { pFormat += 2; pFormat += sizeof(WORD); @@ -5630,22 +5628,22 @@ static ULONG get_discriminant(unsigned char fc, const unsigned char *pMemory) { switch (fc) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: return *pMemory; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_ENUM16: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: + case FC_ENUM16: return *(const USHORT *)pMemory; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: return *(const ULONG *)pMemory; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: return *(const ULONG_PTR *)pMemory; default: FIXME("Unhandled base type: 0x%02x\n", fc); @@ -5716,10 +5714,10 @@ static unsigned char *union_arm_marshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned c BOOL pointer_buffer_mark_set = FALSE; switch(*desc) { - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: align_pointer_clear(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; if (pStubMsg->PointerBufferMark) @@ -5745,7 +5743,7 @@ static unsigned char *union_arm_marshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned c pStubMsg->Buffer = saved_buffer + 4; } break; - case RPC_FC_IP: + case FC_IP: /* must be dereferenced first */ m(pStubMsg, *(unsigned char **)pMemory, desc); break; @@ -5789,10 +5787,10 @@ static unsigned char *union_arm_unmarshall(PMIDL_STUB_MESSAGE pStubMsg, BOOL pointer_buffer_mark_set = FALSE; switch(*desc) { - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: align_pointer(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; if (pStubMsg->PointerBufferMark) @@ -5819,7 +5817,7 @@ static unsigned char *union_arm_unmarshall(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->Buffer = saved_buffer + 4; } break; - case RPC_FC_IP: + case FC_IP: /* must be dereferenced first */ m(pStubMsg, *(unsigned char ***)ppMemory, desc, fMustAlloc); break; @@ -5860,10 +5858,10 @@ static void union_arm_buffer_size(PMIDL_STUB_MESSAGE pStubMsg, { switch(*desc) { - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: align_length(&pStubMsg->BufferLength, 4); safe_buffer_length_increment(pStubMsg, 4); /* for pointer ID */ if (!pStubMsg->IgnoreEmbeddedPointers) @@ -5878,7 +5876,7 @@ static void union_arm_buffer_size(PMIDL_STUB_MESSAGE pStubMsg, pStubMsg->BufferLength = saved_buffer_length; } break; - case RPC_FC_IP: + case FC_IP: /* must be dereferenced first */ m(pStubMsg, *(unsigned char **)pMemory, desc); break; @@ -5919,10 +5917,10 @@ static ULONG union_arm_memory_size(PMIDL_STUB_MESSAGE pStubMsg, { switch(*desc) { - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: align_pointer(&pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; safe_buffer_increment(pStubMsg, 4); @@ -5965,13 +5963,13 @@ static void union_arm_free(PMIDL_STUB_MESSAGE pStubMsg, { switch(*desc) { - case RPC_FC_RP: - case RPC_FC_UP: - case RPC_FC_OP: - case RPC_FC_FP: + case FC_RP: + case FC_UP: + case FC_OP: + case FC_FP: PointerFree(pStubMsg, *(unsigned char **)pMemory, desc); break; - case RPC_FC_IP: + case FC_IP: /* must be dereferenced first */ m(pStubMsg, *(unsigned char **)pMemory, desc); break; @@ -6164,20 +6162,20 @@ static LONG unmarshall_discriminant(PMIDL_STUB_MESSAGE pStubMsg,
switch(**ppFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: { UCHAR d; safe_copy_from_buffer(pStubMsg, &d, sizeof(d)); discriminant = d; break; } - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_ENUM16: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: + case FC_ENUM16: { USHORT d; align_pointer(&pStubMsg->Buffer, sizeof(USHORT)); @@ -6185,8 +6183,8 @@ static LONG unmarshall_discriminant(PMIDL_STUB_MESSAGE pStubMsg, discriminant = d; break; } - case RPC_FC_LONG: - case RPC_FC_ULONG: + case FC_LONG: + case FC_ULONG: { ULONG d; align_pointer(&pStubMsg->Buffer, sizeof(ULONG)); @@ -6416,7 +6414,7 @@ static unsigned char *WINAPI NdrRangeMarshall(
TRACE("pStubMsg %p, pMemory %p, type 0x%02x\n", pStubMsg, pMemory, *pFormat);
- if (pRange->type != RPC_FC_RANGE) + if (pRange->type != FC_RANGE) { ERR("invalid format type %x\n", pRange->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6442,7 +6440,7 @@ unsigned char *WINAPI NdrRangeUnmarshall(
TRACE("pStubMsg: %p, ppMemory: %p, type: 0x%02x, fMustAlloc: %s\n", pStubMsg, ppMemory, *pFormat, fMustAlloc ? "true" : "false");
- if (pRange->type != RPC_FC_RANGE) + if (pRange->type != FC_RANGE) { ERR("invalid format type %x\n", pRange->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6483,41 +6481,41 @@ unsigned char *WINAPI NdrRangeUnmarshall(
switch(base_type) { - case RPC_FC_CHAR: - case RPC_FC_SMALL: + case FC_CHAR: + case FC_SMALL: RANGE_UNMARSHALL(UCHAR, UCHAR, "%d"); TRACE("value: 0x%02x\n", **ppMemory); break; - case RPC_FC_BYTE: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_USMALL: RANGE_UNMARSHALL(CHAR, CHAR, "%u"); TRACE("value: 0x%02x\n", **ppMemory); break; - case RPC_FC_WCHAR: /* FIXME: valid? */ - case RPC_FC_USHORT: + case FC_WCHAR: /* FIXME: valid? */ + case FC_USHORT: RANGE_UNMARSHALL(USHORT, USHORT, "%u"); TRACE("value: 0x%04x\n", **(USHORT **)ppMemory); break; - case RPC_FC_SHORT: + case FC_SHORT: RANGE_UNMARSHALL(SHORT, SHORT, "%d"); TRACE("value: 0x%04x\n", **(USHORT **)ppMemory); break; - case RPC_FC_LONG: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ENUM32: RANGE_UNMARSHALL(LONG, LONG, "%d"); TRACE("value: 0x%08x\n", **(ULONG **)ppMemory); break; - case RPC_FC_ULONG: + case FC_ULONG: RANGE_UNMARSHALL(ULONG, ULONG, "%u"); TRACE("value: 0x%08x\n", **(ULONG **)ppMemory); break; - case RPC_FC_ENUM16: + case FC_ENUM16: RANGE_UNMARSHALL(UINT, USHORT, "%u"); TRACE("value: 0x%08x\n", **(UINT **)ppMemory); break; - case RPC_FC_FLOAT: - case RPC_FC_DOUBLE: - case RPC_FC_HYPER: + case FC_FLOAT: + case FC_DOUBLE: + case FC_HYPER: default: ERR("invalid range base type: 0x%02x\n", base_type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6539,7 +6537,7 @@ static void WINAPI NdrRangeBufferSize(
TRACE("pStubMsg %p, pMemory %p, type 0x%02x\n", pStubMsg, pMemory, *pFormat);
- if (pRange->type != RPC_FC_RANGE) + if (pRange->type != FC_RANGE) { ERR("invalid format type %x\n", pRange->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6559,7 +6557,7 @@ static ULONG WINAPI NdrRangeMemorySize( const NDR_RANGE *pRange = (const NDR_RANGE *)pFormat; unsigned char base_type;
- if (pRange->type != RPC_FC_RANGE) + if (pRange->type != FC_RANGE) { ERR("invalid format type %x\n", pRange->type); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6594,42 +6592,42 @@ static unsigned char *WINAPI NdrBaseTypeMarshall(
switch(*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: safe_copy_to_buffer(pStubMsg, pMemory, sizeof(UCHAR)); TRACE("value: 0x%02x\n", *pMemory); break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: align_pointer_clear(&pStubMsg->Buffer, sizeof(USHORT)); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(USHORT)); TRACE("value: 0x%04x\n", *(USHORT *)pMemory); break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ERROR_STATUS_T: + case FC_ENUM32: align_pointer_clear(&pStubMsg->Buffer, sizeof(ULONG)); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(ULONG)); TRACE("value: 0x%08x\n", *(ULONG *)pMemory); break; - case RPC_FC_FLOAT: + case FC_FLOAT: align_pointer_clear(&pStubMsg->Buffer, sizeof(float)); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(float)); break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: align_pointer_clear(&pStubMsg->Buffer, sizeof(double)); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(double)); break; - case RPC_FC_HYPER: + case FC_HYPER: align_pointer_clear(&pStubMsg->Buffer, sizeof(ULONGLONG)); safe_copy_to_buffer(pStubMsg, pMemory, sizeof(ULONGLONG)); TRACE("value: %s\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory)); break; - case RPC_FC_ENUM16: + case FC_ENUM16: { USHORT val = *(UINT *)pMemory; /* only 16-bits on the wire, so do a sanity check */ @@ -6640,15 +6638,15 @@ static unsigned char *WINAPI NdrBaseTypeMarshall( TRACE("value: 0x%04x\n", *(UINT *)pMemory); break; } - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: { UINT val = *(UINT_PTR *)pMemory; align_pointer_clear(&pStubMsg->Buffer, sizeof(UINT)); safe_copy_to_buffer(pStubMsg, &val, sizeof(val)); break; } - case RPC_FC_IGNORE: + case FC_IGNORE: break; default: FIXME("Unhandled base type: 0x%02x\n", *pFormat); @@ -6688,39 +6686,39 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
switch(*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: BASE_TYPE_UNMARSHALL(UCHAR); TRACE("value: 0x%02x\n", **ppMemory); break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: BASE_TYPE_UNMARSHALL(USHORT); TRACE("value: 0x%04x\n", **(USHORT **)ppMemory); break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ERROR_STATUS_T: + case FC_ENUM32: BASE_TYPE_UNMARSHALL(ULONG); TRACE("value: 0x%08x\n", **(ULONG **)ppMemory); break; - case RPC_FC_FLOAT: + case FC_FLOAT: BASE_TYPE_UNMARSHALL(float); TRACE("value: %f\n", **(float **)ppMemory); break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: BASE_TYPE_UNMARSHALL(double); TRACE("value: %f\n", **(double **)ppMemory); break; - case RPC_FC_HYPER: + case FC_HYPER: BASE_TYPE_UNMARSHALL(ULONGLONG); TRACE("value: %s\n", wine_dbgstr_longlong(**(ULONGLONG **)ppMemory)); break; - case RPC_FC_ENUM16: + case FC_ENUM16: { USHORT val; align_pointer(&pStubMsg->Buffer, sizeof(USHORT)); @@ -6734,7 +6732,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall( TRACE("value: 0x%08x\n", **(UINT **)ppMemory); break; } - case RPC_FC_INT3264: + case FC_INT3264: if (sizeof(INT_PTR) == sizeof(INT)) BASE_TYPE_UNMARSHALL(INT); else { @@ -6749,7 +6747,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall( TRACE("value: 0x%08lx\n", **(INT_PTR **)ppMemory); } break; - case RPC_FC_UINT3264: + case FC_UINT3264: if (sizeof(UINT_PTR) == sizeof(UINT)) BASE_TYPE_UNMARSHALL(UINT); else { @@ -6764,7 +6762,7 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall( TRACE("value: 0x%08lx\n", **(UINT_PTR **)ppMemory); } break; - case RPC_FC_IGNORE: + case FC_IGNORE: break; default: FIXME("Unhandled base type: 0x%02x\n", *pFormat); @@ -6788,44 +6786,44 @@ static void WINAPI NdrBaseTypeBufferSize(
switch(*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: safe_buffer_length_increment(pStubMsg, sizeof(UCHAR)); break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_ENUM16: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: + case FC_ENUM16: align_length(&pStubMsg->BufferLength, sizeof(USHORT)); safe_buffer_length_increment(pStubMsg, sizeof(USHORT)); break; - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: + case FC_INT3264: + case FC_UINT3264: align_length(&pStubMsg->BufferLength, sizeof(ULONG)); safe_buffer_length_increment(pStubMsg, sizeof(ULONG)); break; - case RPC_FC_FLOAT: + case FC_FLOAT: align_length(&pStubMsg->BufferLength, sizeof(float)); safe_buffer_length_increment(pStubMsg, sizeof(float)); break; - case RPC_FC_DOUBLE: + case FC_DOUBLE: align_length(&pStubMsg->BufferLength, sizeof(double)); safe_buffer_length_increment(pStubMsg, sizeof(double)); break; - case RPC_FC_HYPER: + case FC_HYPER: align_length(&pStubMsg->BufferLength, sizeof(ULONGLONG)); safe_buffer_length_increment(pStubMsg, sizeof(ULONGLONG)); break; - case RPC_FC_ERROR_STATUS_T: + case FC_ERROR_STATUS_T: align_length(&pStubMsg->BufferLength, sizeof(error_status_t)); safe_buffer_length_increment(pStubMsg, sizeof(error_status_t)); break; - case RPC_FC_IGNORE: + case FC_IGNORE: break; default: FIXME("Unhandled base type: 0x%02x\n", *pFormat); @@ -6843,67 +6841,67 @@ static ULONG WINAPI NdrBaseTypeMemorySize(
switch(*pFormat) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: safe_buffer_increment(pStubMsg, sizeof(UCHAR)); pStubMsg->MemorySize += sizeof(UCHAR); return sizeof(UCHAR); - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: align_pointer(&pStubMsg->Buffer, sizeof(USHORT)); safe_buffer_increment(pStubMsg, sizeof(USHORT)); align_length(&pStubMsg->MemorySize, sizeof(USHORT)); pStubMsg->MemorySize += sizeof(USHORT); return sizeof(USHORT); - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM32: + case FC_LONG: + case FC_ULONG: + case FC_ENUM32: align_pointer(&pStubMsg->Buffer, sizeof(ULONG)); safe_buffer_increment(pStubMsg, sizeof(ULONG)); align_length(&pStubMsg->MemorySize, sizeof(ULONG)); pStubMsg->MemorySize += sizeof(ULONG); return sizeof(ULONG); - case RPC_FC_FLOAT: + case FC_FLOAT: align_pointer(&pStubMsg->Buffer, sizeof(float)); safe_buffer_increment(pStubMsg, sizeof(float)); align_length(&pStubMsg->MemorySize, sizeof(float)); pStubMsg->MemorySize += sizeof(float); return sizeof(float); - case RPC_FC_DOUBLE: + case FC_DOUBLE: align_pointer(&pStubMsg->Buffer, sizeof(double)); safe_buffer_increment(pStubMsg, sizeof(double)); align_length(&pStubMsg->MemorySize, sizeof(double)); pStubMsg->MemorySize += sizeof(double); return sizeof(double); - case RPC_FC_HYPER: + case FC_HYPER: align_pointer(&pStubMsg->Buffer, sizeof(ULONGLONG)); safe_buffer_increment(pStubMsg, sizeof(ULONGLONG)); align_length(&pStubMsg->MemorySize, sizeof(ULONGLONG)); pStubMsg->MemorySize += sizeof(ULONGLONG); return sizeof(ULONGLONG); - case RPC_FC_ERROR_STATUS_T: + case FC_ERROR_STATUS_T: align_pointer(&pStubMsg->Buffer, sizeof(error_status_t)); safe_buffer_increment(pStubMsg, sizeof(error_status_t)); align_length(&pStubMsg->MemorySize, sizeof(error_status_t)); pStubMsg->MemorySize += sizeof(error_status_t); return sizeof(error_status_t); - case RPC_FC_ENUM16: + case FC_ENUM16: align_pointer(&pStubMsg->Buffer, sizeof(USHORT)); safe_buffer_increment(pStubMsg, sizeof(USHORT)); align_length(&pStubMsg->MemorySize, sizeof(UINT)); pStubMsg->MemorySize += sizeof(UINT); return sizeof(UINT); - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: align_pointer(&pStubMsg->Buffer, sizeof(UINT)); safe_buffer_increment(pStubMsg, sizeof(UINT)); align_length(&pStubMsg->MemorySize, sizeof(UINT_PTR)); pStubMsg->MemorySize += sizeof(UINT_PTR); return sizeof(UINT_PTR); - case RPC_FC_IGNORE: + case FC_IGNORE: align_length(&pStubMsg->MemorySize, sizeof(void *)); pStubMsg->MemorySize += sizeof(void *); return sizeof(void *); @@ -6935,7 +6933,7 @@ static void WINAPI NdrContextHandleBufferSize( { TRACE("pStubMsg %p, pMemory %p, type 0x%02x\n", pStubMsg, pMemory, *pFormat);
- if (*pFormat != RPC_FC_BIND_CONTEXT) + if (*pFormat != FC_BIND_CONTEXT) { ERR("invalid format type %x\n", *pFormat); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6954,7 +6952,7 @@ static unsigned char *WINAPI NdrContextHandleMarshall( { TRACE("pStubMsg %p, pMemory %p, type 0x%02x\n", pStubMsg, pMemory, *pFormat);
- if (*pFormat != RPC_FC_BIND_CONTEXT) + if (*pFormat != FC_BIND_CONTEXT) { ERR("invalid format type %x\n", *pFormat); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -6990,7 +6988,7 @@ static unsigned char *WINAPI NdrContextHandleUnmarshall( TRACE("pStubMsg %p, ppMemory %p, pFormat %p, fMustAlloc %s\n", pStubMsg, ppMemory, pFormat, fMustAlloc ? "TRUE": "FALSE");
- if (*pFormat != RPC_FC_BIND_CONTEXT) + if (*pFormat != FC_BIND_CONTEXT) { ERR("invalid format type %x\n", *pFormat); RpcRaiseException(RPC_S_INTERNAL_ERROR); @@ -7126,7 +7124,7 @@ NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg,
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE) flags |= RPC_CONTEXT_HANDLE_SERIALIZE; - if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE) + if (pFormat[1] & NDR_CONTEXT_HANDLE_NOSERIALIZE) flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE; if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE) { @@ -7160,7 +7158,7 @@ void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE) flags |= RPC_CONTEXT_HANDLE_SERIALIZE; - if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE) + if (pFormat[1] & NDR_CONTEXT_HANDLE_NOSERIALIZE) flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE; if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE) { @@ -7193,7 +7191,7 @@ NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
if (pFormat[1] & NDR_CONTEXT_HANDLE_SERIALIZE) flags |= RPC_CONTEXT_HANDLE_SERIALIZE; - if (pFormat[1] & NDR_CONTEXT_HANDLE_NO_SERIALIZE) + if (pFormat[1] & NDR_CONTEXT_HANDLE_NOSERIALIZE) flags |= RPC_CONTEXT_HANDLE_DONT_SERIALIZE; if (pFormat[1] & NDR_STRICT_CONTEXT_HANDLE) { diff --git a/dlls/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c index 0f0b7e7..8608691 100644 --- a/dlls/rpcrt4/ndr_ole.c +++ b/dlls/rpcrt4/ndr_ole.c @@ -36,8 +36,8 @@
#include "ndr_misc.h" #include "rpcndr.h" +#include "ndrtypes.h" #include "rpcproxy.h" -#include "wine/rpcfc.h" #include "cpsf.h"
#include "wine/debug.h" @@ -288,8 +288,8 @@ static const IID* get_ip_iid(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory const IID *riid; if (!pFormat) return &IID_IUnknown; TRACE("format=%02x %02x\n", pFormat[0], pFormat[1]); - if (pFormat[0] != RPC_FC_IP) FIXME("format=%d\n", pFormat[0]); - if (pFormat[1] == RPC_FC_CONSTANT_IID) { + if (pFormat[0] != FC_IP) FIXME("format=%d\n", pFormat[0]); + if (pFormat[1] == FC_CONSTANT_IID) { riid = (const IID *)&pFormat[2]; } else { ComputeConformance(pStubMsg, pMemory, pFormat+2, 0); diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index f84c617..a645a24 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -40,7 +40,6 @@
#include "wine/exception.h" #include "wine/debug.h" -#include "wine/rpcfc.h"
#include "cpsf.h" #include "ndr_misc.h" @@ -154,8 +153,8 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) DWORD size; switch(*pFormat) { - case RPC_FC_RP: - if (pFormat[1] & RPC_FC_P_SIMPLEPOINTER) + case FC_RP: + if (pFormat[1] & FC_SIMPLE_POINTER) { FIXME("Simple reference pointer (type %#x).\n", pFormat[2]); size = sizeof(void *); @@ -163,52 +162,52 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) } size = calc_arg_size(pStubMsg, &pFormat[2] + *(const SHORT*)&pFormat[2]); break; - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: + case FC_STRUCT: + case FC_PSTRUCT: size = *(const WORD*)(pFormat + 2); break; - case RPC_FC_BOGUS_STRUCT: + case FC_BOGUS_STRUCT: size = *(const WORD*)(pFormat + 2); if(*(const WORD*)(pFormat + 4)) FIXME("Unhandled conformant description\n"); break; - case RPC_FC_CARRAY: - case RPC_FC_CVARRAY: + case FC_CARRAY: + case FC_CVARRAY: size = *(const WORD*)(pFormat + 2); ComputeConformance(pStubMsg, NULL, pFormat + 4, 0); size *= pStubMsg->MaxCount; break; - case RPC_FC_SMFARRAY: - case RPC_FC_SMVARRAY: + case FC_SMFARRAY: + case FC_SMVARRAY: size = *(const WORD*)(pFormat + 2); break; - case RPC_FC_LGFARRAY: - case RPC_FC_LGVARRAY: + case FC_LGFARRAY: + case FC_LGVARRAY: size = *(const DWORD*)(pFormat + 2); break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: pFormat = ComputeConformance(pStubMsg, NULL, pFormat + 4, *(const WORD*)&pFormat[2]); TRACE("conformance = %ld\n", pStubMsg->MaxCount); pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount); size = ComplexStructSize(pStubMsg, pFormat); size *= pStubMsg->MaxCount; break; - case RPC_FC_USER_MARSHAL: + case FC_USER_MARSHAL: size = *(const WORD*)(pFormat + 4); break; - case RPC_FC_CSTRING: + case FC_CSTRING: size = *(const WORD*)(pFormat + 2); break; - case RPC_FC_WSTRING: + case FC_WSTRING: size = *(const WORD*)(pFormat + 2) * sizeof(WCHAR); break; - case RPC_FC_C_CSTRING: - case RPC_FC_C_WSTRING: - if (*pFormat == RPC_FC_C_CSTRING) + case FC_C_CSTRING: + case FC_C_WSTRING: + if (*pFormat == FC_C_CSTRING) size = sizeof(CHAR); else size = sizeof(WCHAR); - if (pFormat[1] == RPC_FC_STRING_SIZED) + if (pFormat[1] == FC_STRING_SIZED) ComputeConformance(pStubMsg, NULL, pFormat + 2, 0); else pStubMsg->MaxCount = 0; @@ -217,7 +216,7 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) default: FIXME("Unhandled type %02x\n", *pFormat); /* fallthrough */ - case RPC_FC_IP: + case FC_IP: size = sizeof(void *); break; } @@ -279,10 +278,10 @@ static PFORMAT_STRING client_get_handle( switch (pProcHeader->handle_type) { /* explicit binding: parse additional section */ - case RPC_FC_BIND_EXPLICIT: + case 0: switch (*pFormat) /* handle_type */ { - case RPC_FC_BIND_PRIMITIVE: /* explicit primitive */ + case FC_BIND_PRIMITIVE: /* explicit primitive */ { const NDR_EHD_PRIMITIVE *pDesc = (const NDR_EHD_PRIMITIVE *)pFormat;
@@ -294,7 +293,7 @@ static PFORMAT_STRING client_get_handle( *phBinding = *(handle_t *)ARG_FROM_OFFSET(pStubMsg->StackTop, pDesc->offset); return pFormat + sizeof(NDR_EHD_PRIMITIVE); } - case RPC_FC_BIND_GENERIC: /* explicit generic */ + case FC_BIND_GENERIC: /* explicit generic */ { const NDR_EHD_GENERIC *pDesc = (const NDR_EHD_GENERIC *)pFormat; void *pObject = NULL; @@ -312,7 +311,7 @@ static PFORMAT_STRING client_get_handle( *phBinding = pGenPair->pfnBind(pObject); return pFormat + sizeof(NDR_EHD_GENERIC); } - case RPC_FC_BIND_CONTEXT: /* explicit context */ + case FC_BIND_CONTEXT: /* explicit context */ { const NDR_EHD_CONTEXT *pDesc = (const NDR_EHD_CONTEXT *)pFormat; NDR_CCONTEXT context_handle; @@ -340,22 +339,22 @@ static PFORMAT_STRING client_get_handle( RpcRaiseException(RPC_X_BAD_STUB_DATA); } break; - case RPC_FC_BIND_GENERIC: /* implicit generic */ - FIXME("RPC_FC_BIND_GENERIC\n"); + case FC_BIND_GENERIC: /* implicit generic */ + FIXME("FC_BIND_GENERIC\n"); RpcRaiseException(RPC_X_BAD_STUB_DATA); /* FIXME: remove when implemented */ break; - case RPC_FC_BIND_PRIMITIVE: /* implicit primitive */ + case FC_BIND_PRIMITIVE: /* implicit primitive */ TRACE("Implicit primitive handle\n"); *phBinding = *pStubMsg->StubDesc->IMPLICIT_HANDLE_INFO.pPrimitiveHandle; break; - case RPC_FC_CALLBACK_HANDLE: /* implicit callback */ - TRACE("RPC_FC_CALLBACK_HANDLE\n"); + case FC_CALLBACK_HANDLE: /* implicit callback */ + TRACE("FC_CALLBACK_HANDLE\n"); /* server calls callback procedures only in response to remote call, and most recent binding handle is used. Calling back to a client can potentially result in another callback with different current handle. */ *phBinding = I_RpcGetCurrentCallHandle(); break; - case RPC_FC_AUTO_HANDLE: /* implicit auto handle */ + case FC_AUTO_HANDLE: /* implicit auto handle */ /* strictly speaking, it isn't necessary to set hBinding here * since it isn't actually used (hence the automatic in its name), * but then why does MIDL generate a valid entry in the @@ -378,10 +377,10 @@ static void client_free_handle( switch (pProcHeader->handle_type) { /* explicit binding: parse additional section */ - case RPC_FC_BIND_EXPLICIT: + case 0: switch (*pFormat) /* handle_type */ { - case RPC_FC_BIND_GENERIC: /* explicit generic */ + case FC_BIND_GENERIC: /* explicit generic */ { const NDR_EHD_GENERIC *pDesc = (const NDR_EHD_GENERIC *)pFormat; void *pObject = NULL; @@ -399,21 +398,21 @@ static void client_free_handle( pGenPair->pfnUnbind(pObject, hBinding); break; } - case RPC_FC_BIND_CONTEXT: /* explicit context */ - case RPC_FC_BIND_PRIMITIVE: /* explicit primitive */ + case FC_BIND_CONTEXT: /* explicit context */ + case FC_BIND_PRIMITIVE: /* explicit primitive */ break; default: ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type); RpcRaiseException(RPC_X_BAD_STUB_DATA); } break; - case RPC_FC_BIND_GENERIC: /* implicit generic */ - FIXME("RPC_FC_BIND_GENERIC\n"); + case FC_BIND_GENERIC: /* implicit generic */ + FIXME("FC_BIND_GENERIC\n"); RpcRaiseException(RPC_X_BAD_STUB_DATA); /* FIXME: remove when implemented */ break; - case RPC_FC_CALLBACK_HANDLE: /* implicit callback */ - case RPC_FC_BIND_PRIMITIVE: /* implicit primitive */ - case RPC_FC_AUTO_HANDLE: /* implicit auto handle */ + case FC_CALLBACK_HANDLE: /* implicit callback */ + case FC_BIND_PRIMITIVE: /* implicit primitive */ + case FC_AUTO_HANDLE: /* implicit auto handle */ break; default: ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type); @@ -436,7 +435,7 @@ void client_do_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum s float f;
if (params[i].attr.IsBasetype && - params[i].u.type_format_char == RPC_FC_FLOAT && + params[i].u.type_format_char == FC_FLOAT && !params[i].attr.IsSimpleRef && !fpu_args) { @@ -487,26 +486,26 @@ static unsigned int type_stack_size(unsigned char fc) { switch (fc) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_INT3264: - case RPC_FC_UINT3264: - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: - case RPC_FC_FLOAT: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_IGNORE: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: + case FC_LONG: + case FC_ULONG: + case FC_INT3264: + case FC_UINT3264: + case FC_ENUM16: + case FC_ENUM32: + case FC_FLOAT: + case FC_ERROR_STATUS_T: + case FC_IGNORE: return sizeof(void *); - case RPC_FC_DOUBLE: + case FC_DOUBLE: return sizeof(double); - case RPC_FC_HYPER: + case FC_HYPER: return sizeof(ULONGLONG); default: ERR("invalid base type 0x%x\n", fc); @@ -518,13 +517,13 @@ static BOOL is_by_value( PFORMAT_STRING format ) { switch (*format) { - case RPC_FC_USER_MARSHAL: - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_BOGUS_STRUCT: + case FC_USER_MARSHAL: + case FC_STRUCT: + case FC_PSTRUCT: + case FC_CSTRUCT: + case FC_CPSTRUCT: + case FC_CVSTRUCT: + case FC_BOGUS_STRUCT: return TRUE; default: return FALSE; @@ -554,32 +553,32 @@ PFORMAT_STRING convert_old_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFo
switch (param->param_direction) { - case RPC_FC_IN_PARAM_BASETYPE: + case FC_IN_PARAM_BASETYPE: args[i].attr.IsIn = 1; args[i].attr.IsBasetype = 1; break; - case RPC_FC_RETURN_PARAM_BASETYPE: + case FC_RETURN_PARAM_BASETYPE: args[i].attr.IsOut = 1; args[i].attr.IsReturn = 1; args[i].attr.IsBasetype = 1; break; - case RPC_FC_IN_PARAM: + case FC_IN_PARAM: args[i].attr.IsIn = 1; args[i].attr.MustFree = 1; break; - case RPC_FC_IN_PARAM_NO_FREE_INST: + case FC_IN_PARAM_NO_FREE_INST: args[i].attr.IsIn = 1; args[i].attr.IsDontCallFreeInst = 1; break; - case RPC_FC_IN_OUT_PARAM: + case FC_IN_OUT_PARAM: args[i].attr.IsIn = 1; args[i].attr.IsOut = 1; args[i].attr.MustFree = 1; break; - case RPC_FC_OUT_PARAM: + case FC_OUT_PARAM: args[i].attr.IsOut = 1; break; - case RPC_FC_RETURN_PARAM: + case FC_RETURN_PARAM: args[i].attr.IsOut = 1; args[i].attr.IsReturn = 1; break; @@ -633,7 +632,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM
TRACE("NDR Version: 0x%x\n", pStubDesc->Version);
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) { const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0]; stack_size = header_rpc->stack_size; @@ -650,10 +649,10 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM TRACE("proc num: %d\n", procedure_number);
/* create the full pointer translation tables, if requested */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) stubMsg.FullPtrXlatTables = NdrFullPointerXlatInit(0,XLAT_CLIENT);
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { /* object is always the first argument */ This = stack_top[0]; @@ -669,7 +668,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM pHandleFormat = pFormat;
/* we only need a handle if this isn't an object method */ - if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)) + if (!(pProcHeader->Oi_flags & Oi_OBJECT_PROC)) { pFormat = client_get_handle(&stubMsg, pProcHeader, pHandleFormat, &hBinding); if (!pFormat) goto done; @@ -710,7 +709,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM else { pFormat = convert_old_args( &stubMsg, pFormat, stack_size, - pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT, + pProcHeader->Oi_flags & Oi_OBJECT_PROC, /* reuse the correlation cache, it's not needed for v1 format */ NdrCorrCache, sizeof(NdrCorrCache), &number_of_params ); } @@ -718,11 +717,11 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM stubMsg.BufferLength = 0;
/* store the RPC flags away */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) rpcMsg.RpcFlags = ((const NDR_PROC_HEADER_RPC *)pProcHeader)->rpc_flags;
/* use alternate memory allocation routines */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCSSALLOC) + if (pProcHeader->Oi_flags & Oi_RPCSS_ALLOC_USED) NdrRpcSmSetClientToOsf(&stubMsg);
if (Oif_flags.HasPipes) @@ -749,11 +748,11 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM * 6. UNMARSHAL - unmarshal [out] params from buffer * 7. FREE - clear [out] parameters (for proxies, and only on error) */ - if ((pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) || - (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_HAS_COMM_OR_FAULT)) + if ((pProcHeader->Oi_flags & Oi_OBJECT_PROC) || + (pProcHeader->Oi_flags & Oi_HAS_COMM_OR_FAULT)) { /* 1. INITOUT */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { TRACE( "INITOUT\n" ); client_do_args(&stubMsg, pFormat, STUBLESS_INITOUT, fpu_stack, @@ -769,7 +768,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM
/* 3. GETBUFFER */ TRACE( "GETBUFFER\n" ); - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { /* allocate the buffer */ NdrProxyGetBuffer(This, &stubMsg); @@ -782,7 +781,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsGetBuffer(&stubMsg, stubMsg.BufferLength, hBinding); #else @@ -800,7 +799,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM
/* 5. SENDRECEIVE */ TRACE( "SENDRECEIVE\n" ); - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { /* send the [in] params and receive the [out] and [retval] * params */ @@ -815,7 +814,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsSendReceive(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle); #else @@ -838,7 +837,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM } __EXCEPT_ALL { - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { /* 7. FREE */ TRACE( "FREE\n" ); @@ -888,7 +887,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsGetBuffer(&stubMsg, stubMsg.BufferLength, hBinding); #else @@ -910,7 +909,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsSendReceive(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle); #else @@ -943,11 +942,11 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORM }
/* free the full pointer translation tables */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) NdrFullPointerXlatFree(stubMsg.FullPtrXlatTables);
/* free marshalling buffer */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) NdrProxyFreeBuffer(This, &stubMsg); else { @@ -1180,13 +1179,13 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, else if (param_needs_alloc(params[i].attr) && (!params[i].attr.MustFree || params[i].attr.IsSimpleRef)) { - if (*pTypeFormat != RPC_FC_BIND_CONTEXT) pStubMsg->pfnFree(*(void **)pArg); + if (*pTypeFormat != FC_BIND_CONTEXT) pStubMsg->pfnFree(*(void **)pArg); } break; case STUBLESS_INITOUT: if (param_needs_alloc(params[i].attr) && !params[i].attr.ServerAllocSize) { - if (*pTypeFormat == RPC_FC_BIND_CONTEXT) + if (*pTypeFormat == FC_BIND_CONTEXT) { NDR_SCONTEXT ctxt = NdrContextHandleInitialize(pStubMsg, pTypeFormat); *(void **)pArg = NDRSContextValue(ctxt); @@ -1276,7 +1275,7 @@ LONG WINAPI NdrStubCall2(
TRACE("NDR Version: 0x%x\n", pStubDesc->Version);
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) { const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0]; stack_size = header_rpc->stack_size; @@ -1295,16 +1294,16 @@ LONG WINAPI NdrStubCall2( switch (pProcHeader->handle_type) { /* explicit binding: parse additional section */ - case RPC_FC_BIND_EXPLICIT: + case 0: switch (*pFormat) /* handle_type */ { - case RPC_FC_BIND_PRIMITIVE: /* explicit primitive */ + case FC_BIND_PRIMITIVE: /* explicit primitive */ pFormat += sizeof(NDR_EHD_PRIMITIVE); break; - case RPC_FC_BIND_GENERIC: /* explicit generic */ + case FC_BIND_GENERIC: /* explicit generic */ pFormat += sizeof(NDR_EHD_GENERIC); break; - case RPC_FC_BIND_CONTEXT: /* explicit context */ + case FC_BIND_CONTEXT: /* explicit context */ pFormat += sizeof(NDR_EHD_CONTEXT); break; default: @@ -1312,31 +1311,31 @@ LONG WINAPI NdrStubCall2( RpcRaiseException(RPC_X_BAD_STUB_DATA); } break; - case RPC_FC_BIND_GENERIC: /* implicit generic */ - case RPC_FC_BIND_PRIMITIVE: /* implicit primitive */ - case RPC_FC_CALLBACK_HANDLE: /* implicit callback */ - case RPC_FC_AUTO_HANDLE: /* implicit auto handle */ + case FC_BIND_GENERIC: /* implicit generic */ + case FC_BIND_PRIMITIVE: /* implicit primitive */ + case FC_CALLBACK_HANDLE: /* implicit callback */ + case FC_AUTO_HANDLE: /* implicit auto handle */ break; default: ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type); RpcRaiseException(RPC_X_BAD_STUB_DATA); }
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) NdrStubInitialize(pRpcMsg, &stubMsg, pStubDesc, pChannel); else NdrServerInitializeNew(pRpcMsg, &stubMsg, pStubDesc);
/* create the full pointer translation tables, if requested */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) stubMsg.FullPtrXlatTables = NdrFullPointerXlatInit(0,XLAT_SERVER);
/* store the RPC flags away */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) pRpcMsg->RpcFlags = ((const NDR_PROC_HEADER_RPC *)pProcHeader)->rpc_flags;
/* use alternate memory allocation routines */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCSSALLOC) + if (pProcHeader->Oi_flags & Oi_RPCSS_ALLOC_USED) #if 0 NdrRpcSsEnableAllocate(&stubMsg); #else @@ -1389,7 +1388,7 @@ LONG WINAPI NdrStubCall2( else { pFormat = convert_old_args( &stubMsg, pFormat, stack_size, - pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT, + pProcHeader->Oi_flags & Oi_OBJECT_PROC, /* reuse the correlation cache, it's not needed for v1 format */ NdrCorrCache, sizeof(NdrCorrCache), &number_of_params ); } @@ -1413,7 +1412,7 @@ LONG WINAPI NdrStubCall2( SERVER_ROUTINE func; LONG_PTR retval;
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { SERVER_ROUTINE *vtbl = *(SERVER_ROUTINE **)((CStdStubBuffer *)pThis)->pvServerObject; func = vtbl[pRpcMsg->ProcNum]; @@ -1438,7 +1437,7 @@ LONG WINAPI NdrStubCall2(
break; case STUBLESS_GETBUFFER: - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) NdrStubGetBuffer(pThis, pChannel, &stubMsg); else { @@ -1480,7 +1479,7 @@ LONG WINAPI NdrStubCall2( }
/* free the full pointer translation tables */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) NdrFullPointerXlatFree(stubMsg.FullPtrXlatTables);
/* free server function stack */ @@ -1565,7 +1564,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, async_call_data->pStubMsg = pStubMsg = (PMIDL_STUB_MESSAGE)(async_call_data + 1); pRpcMsg = (PRPC_MESSAGE)(pStubMsg + 1);
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) { const NDR_PROC_HEADER_RPC *header_rpc = (const NDR_PROC_HEADER_RPC *)&pFormat[0]; async_call_data->stack_size = header_rpc->stack_size; @@ -1582,10 +1581,10 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, TRACE("proc num: %d\n", procedure_number);
/* create the full pointer translation tables, if requested */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) pStubMsg->FullPtrXlatTables = NdrFullPointerXlatInit(0,XLAT_CLIENT);
- if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) + if (pProcHeader->Oi_flags & Oi_OBJECT_PROC) { ERR("objects not supported\n"); I_RpcFree(async_call_data); @@ -1631,7 +1630,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, else { pFormat = convert_old_args( pStubMsg, pFormat, async_call_data->stack_size, - pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT, + pProcHeader->Oi_flags & Oi_OBJECT_PROC, async_call_data->NdrCorrCache, sizeof(async_call_data->NdrCorrCache), &async_call_data->number_of_params ); } @@ -1641,11 +1640,11 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, pStubMsg->BufferLength = 0;
/* store the RPC flags away */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCFLAGS) + if (pProcHeader->Oi_flags & Oi_HAS_RPCFLAGS) pRpcMsg->RpcFlags = ((const NDR_PROC_HEADER_RPC *)pProcHeader)->rpc_flags;
/* use alternate memory allocation routines */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCSSALLOC) + if (pProcHeader->Oi_flags & Oi_RPCSS_ALLOC_USED) NdrRpcSmSetClientToOsf(pStubMsg);
if (Oif_flags.HasPipes) @@ -1684,7 +1683,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsGetBuffer(pStubMsg, pStubMsg->BufferLength, async_call_data->hBinding); #else @@ -1711,7 +1710,7 @@ LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, FIXME("pipes not supported yet\n"); else { - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsSend(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle); #else @@ -1761,7 +1760,7 @@ RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) TRACE( "RECEIVE\n" ); pStubMsg->RpcMsg->RpcFlags |= RPC_BUFFER_ASYNC; /* receive the [out] params */ - if (pProcHeader->handle_type == RPC_FC_AUTO_HANDLE) + if (pProcHeader->handle_type == FC_AUTO_HANDLE) #if 0 NdrNsReceive(&stubMsg, stubMsg.Buffer, pStubDesc->IMPLICIT_HANDLE_INFO.pAutoHandle); #else @@ -1798,7 +1797,7 @@ cleanup: }
/* free the full pointer translation tables */ - if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) + if (pProcHeader->Oi_flags & Oi_FULL_PTR_USED) NdrFullPointerXlatFree(pStubMsg->FullPtrXlatTables);
/* free marshalling buffer */ diff --git a/dlls/rpcrt4/ndr_stubless.h b/dlls/rpcrt4/ndr_stubless.h index 2e7beba..ebdb8c8 100644 --- a/dlls/rpcrt4/ndr_stubless.h +++ b/dlls/rpcrt4/ndr_stubless.h @@ -26,16 +26,16 @@ typedef struct _NDR_PROC_HEADER { /* type of handle to use: - * RPC_FC_BIND_EXPLICIT = 0 - Explicit handle. + * 0 - Explicit handle. * Handle is passed as a parameter to the function. * Indicates that explicit handle information follows the header, * which actually describes the handle. - * RPC_FC_BIND_GENERIC = 31 - Implicit handle with custom binding routines + * FC_BIND_GENERIC = 31 - Implicit handle with custom binding routines * (MIDL_STUB_DESC::IMPLICIT_HANDLE_INFO::pGenericBindingInfo) - * RPC_FC_BIND_PRIMITIVE = 32 - Implicit handle using handle_t created by + * FC_BIND_PRIMITIVE = 32 - Implicit handle using handle_t created by * calling application - * RPC_FC_AUTO_HANDLE = 33 - Automatic handle - * RPC_FC_CALLBACK_HANDLE = 34 - Implicit handle used for a callback: current handle + * FC_AUTO_HANDLE = 33 - Automatic handle + * FC_CALLBACK_HANDLE = 34 - Implicit handle used for a callback: current handle * from last remote call */ unsigned char handle_type; @@ -95,13 +95,11 @@ typedef struct _NDR_PROC_HEADER_RPC typedef struct _NDR_PROC_PARTIAL_OIF_HEADER { /* the pre-computed client buffer size so that interpreter can skip all - * or some (if the flag RPC_FC_PROC_OI2F_CLTMUSTSIZE is specified) of the - * sizing pass */ + * or some (if the flag ClientMustSize is specified) of the sizing pass */ unsigned short constant_client_buffer_size;
/* the pre-computed server buffer size so that interpreter can skip all - * or some (if the flag RPC_FC_PROC_OI2F_SRVMUSTSIZE is specified) of the - * sizing pass */ + * or some (if the flag ServerMustSize is specified) of the sizing pass */ unsigned short constant_server_buffer_size;
INTERPRETER_OPT_FLAGS Oi2Flags;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- include/wine/rpcfc.h | 205 ------------- tools/widl/client.c | 12 +- tools/widl/expr.c | 6 +- tools/widl/header.c | 12 +- tools/widl/parser.y | 20 +- tools/widl/proxy.c | 2 +- tools/widl/server.c | 2 +- tools/widl/typegen.c | 798 ++++++++++++++++++++++++------------------------- tools/widl/widltypes.h | 2 +- 9 files changed, 427 insertions(+), 632 deletions(-) delete mode 100644 include/wine/rpcfc.h
diff --git a/include/wine/rpcfc.h b/include/wine/rpcfc.h deleted file mode 100644 index 53dd163..0000000 --- a/include/wine/rpcfc.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * RPC format chars, as found by studying MIDL output. - * Some, but not all, usage of these are explained on MSDN. - */ - -#ifndef __WINE_RPCFC_H -#define __WINE_RPCFC_H - -/* base types */ -#define RPC_FC_BYTE 0x01 -#define RPC_FC_CHAR 0x02 -#define RPC_FC_SMALL 0x03 -#define RPC_FC_USMALL 0x04 -#define RPC_FC_WCHAR 0x05 -#define RPC_FC_SHORT 0x06 -#define RPC_FC_USHORT 0x07 -#define RPC_FC_LONG 0x08 -#define RPC_FC_ULONG 0x09 -#define RPC_FC_FLOAT 0x0a -#define RPC_FC_HYPER 0x0b -#define RPC_FC_DOUBLE 0x0c -#define RPC_FC_ENUM16 0x0d -#define RPC_FC_ENUM32 0x0e -#define RPC_FC_IGNORE 0x0f -#define RPC_FC_ERROR_STATUS_T 0x10 - -/* other stuff */ -#define RPC_FC_RP 0x11 /* reference pointer */ -#define RPC_FC_UP 0x12 /* unique pointer */ -#define RPC_FC_OP 0x13 /* unique pointer in object ? */ -#define RPC_FC_FP 0x14 /* full pointer */ - -#define RPC_FC_STRUCT 0x15 /* simple structure */ -/* FC_STRUCT: align-1, NdrFcShort(size), fields */ - -#define RPC_FC_PSTRUCT 0x16 /* simple structure w/ pointers */ -/* FC_PTRUCT: align-1, NdrFcShort(size), ptrs, fields */ - -#define RPC_FC_CSTRUCT 0x17 /* conformant structure */ - -#define RPC_FC_CPSTRUCT 0x18 /* conformant structure w/ pointers */ - -#define RPC_FC_CVSTRUCT 0x19 /* conformant varying struct */ - -#define RPC_FC_BOGUS_STRUCT 0x1a /* complex structure */ - -#define RPC_FC_CARRAY 0x1b /* conformant array */ -/* FC_CARRAY: align-1, NdrFcShort(size), conformance, ptrs, fields */ -#define RPC_FC_CVARRAY 0x1c /* conformant varying array */ -/* FC_CARRAY: align-1, NdrFcShort(size), conformance, variance, ptrs, fields */ -#define RPC_FC_SMFARRAY 0x1d /* small (<64K) fixed array */ -/* FC_SMFARRAY: align-1, NdrFcShort(size), ptrs, fields */ - -#define RPC_FC_LGFARRAY 0x1e /* large (>= 64k) fixed array */ - -#define RPC_FC_SMVARRAY 0x1f /* small (<64k) varying array */ - -#define RPC_FC_LGVARRAY 0x20 /* large (>= 64k) varying array */ - -#define RPC_FC_BOGUS_ARRAY 0x21 /* complex array */ - -#define RPC_FC_C_CSTRING 0x22 -#define RPC_FC_C_SSTRING 0x24 -#define RPC_FC_C_WSTRING 0x25 -#define RPC_FC_CSTRING 0x26 -#define RPC_FC_SSTRING 0x28 -#define RPC_FC_WSTRING 0x29 - -#define RPC_FC_ENCAPSULATED_UNION 0x2a -#define RPC_FC_NON_ENCAPSULATED_UNION 0x2b - -#define RPC_FC_BYTE_COUNT_POINTER 0x2c /* [byte_count] ACF attribute */ - -#define RPC_FC_TRANSMIT_AS 0x2d -#define RPC_FC_REPRESENT_AS 0x2e - -#define RPC_FC_IP 0x2f /* interface pointer */ -/* FC_IP: FC_CONSTANT_IID iid */ -/* FC_IP: FC_PAD correlation */ - -#define RPC_FC_BIND_CONTEXT 0x30 - -#define RPC_FC_BIND_GENERIC 0x31 -#define RPC_FC_BIND_PRIMITIVE 0x32 -#define RPC_FC_AUTO_HANDLE 0x33 -#define RPC_FC_CALLBACK_HANDLE 0x34 - -#define RPC_FC_POINTER 0x36 - -#define RPC_FC_ALIGNM2 0x37 -#define RPC_FC_ALIGNM4 0x38 -#define RPC_FC_ALIGNM8 0x39 - -#define RPC_FC_STRUCTPAD1 0x3d -#define RPC_FC_STRUCTPAD2 0x3e -#define RPC_FC_STRUCTPAD3 0x3f -#define RPC_FC_STRUCTPAD4 0x40 -#define RPC_FC_STRUCTPAD5 0x41 -#define RPC_FC_STRUCTPAD6 0x42 -#define RPC_FC_STRUCTPAD7 0x43 - -#define RPC_FC_STRING_SIZED 0x44 - -#define RPC_FC_NO_REPEAT 0x46 -#define RPC_FC_FIXED_REPEAT 0x47 -#define RPC_FC_VARIABLE_REPEAT 0x48 -#define RPC_FC_FIXED_OFFSET 0x49 -#define RPC_FC_VARIABLE_OFFSET 0x4a - -#define RPC_FC_PP 0x4b /* pointer layout */ -/* FC_PP: FC_PAD layouts */ -/* layouts: FC_NO_REPEAT FC_PAD instance */ -/* instance: NdrFcShort(memofs), NdrFcShort(bufofs), desc */ - -#define RPC_FC_EMBEDDED_COMPLEX 0x4c -/* FC_EMBEDDED_COMPLEX: padding, NdrFcShort(typeofs) */ - -#define RPC_FC_IN_PARAM 0x4d -/* FC_IN_PARAM: stacksiz, NdrFcShort(typeofs) */ -#define RPC_FC_IN_PARAM_BASETYPE 0x4e -/* FC_IN_PARAM_BASETYPE: basetype */ -#define RPC_FC_IN_PARAM_NO_FREE_INST 0x4f -#define RPC_FC_IN_OUT_PARAM 0x50 -/* FC_IN_OUT_PARAM: stacksiz, NdrFcShort(typeofs) */ -#define RPC_FC_OUT_PARAM 0x51 -/* FC_OUT_PARAM: stacksiz, NdrFcShort(typeofs) */ -#define RPC_FC_RETURN_PARAM 0x52 -/* FC_RETURN_PARAM: stacksiz, NdrFcShort(typeofs) */ -#define RPC_FC_RETURN_PARAM_BASETYPE 0x53 -/* FC_RETURN_PARAM_BASETYPE: basetype */ - -#define RPC_FC_DEREFERENCE 0x54 -#define RPC_FC_DIV_2 0x55 -#define RPC_FC_MULT_2 0x56 -#define RPC_FC_ADD_1 0x57 -#define RPC_FC_SUB_1 0x58 - -#define RPC_FC_CALLBACK 0x59 - -#define RPC_FC_CONSTANT_IID 0x5a -/* FC_CONSTANT_IID: NdrFcLong(), NdrFcShort(), NdrFcShort(), 8x () */ - -#define RPC_FC_END 0x5b -#define RPC_FC_PAD 0x5c - -#define RPC_FC_USER_MARSHAL 0xb4 - -#define RPC_FC_RANGE 0xb7 - -#define RPC_FC_INT3264 0xb8 -#define RPC_FC_UINT3264 0xb9 - -/* FC_RP/UP/OP/FP: flags, NdrFcShort(typeofs)/basetype */ -#define RPC_FC_P_ALLOCALLNODES 0x01 -#define RPC_FC_P_DONTFREE 0x02 -#define RPC_FC_P_ONSTACK 0x04 /* [alloced_on_stack] */ -#define RPC_FC_P_SIMPLEPOINTER 0x08 /* [simple_pointer] */ -#define RPC_FC_P_DEREF 0x10 - -#define RPC_FC_BIND_EXPLICIT 0x00 - -/* proc header: oiflags, NdrFcLong(rpcflags), NdrFcShort(procnum), NdrFcShort(stacksiz), - * oi2 header: NdrFcShort(clientbuf), NdrFcShort(servbuf), oi2flags, parmcount - * oi2 parameters: NdrFcShort(flags), NdrFcShort(stackofs), NdrFcShort(typeofs)/basetype */ -#define RPC_FC_PROC_OIF_FULLPTR 0x01 -#define RPC_FC_PROC_OIF_RPCSSALLOC 0x02 -#define RPC_FC_PROC_OIF_OBJECT 0x04 -#define RPC_FC_PROC_OIF_RPCFLAGS 0x08 -#define RPC_FC_PROC_OIF_OBJ_V2 0x20 -#define RPC_FC_PROC_OIF_HAS_COMM_OR_FAULT 0x20 -#define RPC_FC_PROC_OIF_NEWINIT 0x40 - -#define RPC_FC_PROC_PF_MUSTSIZE 0x0001 -#define RPC_FC_PROC_PF_MUSTFREE 0x0002 -#define RPC_FC_PROC_PF_PIPE 0x0004 -#define RPC_FC_PROC_PF_IN 0x0008 -#define RPC_FC_PROC_PF_OUT 0x0010 -#define RPC_FC_PROC_PF_RETURN 0x0020 -#define RPC_FC_PROC_PF_BASETYPE 0x0040 -#define RPC_FC_PROC_PF_BYVAL 0x0080 -#define RPC_FC_PROC_PF_SIMPLEREF 0x0100 -#define RPC_FC_PROC_PF_DONTFREEINST 0x0200 -#define RPC_FC_PROC_PF_SAVEASYNC 0x0400 -#define RPC_FC_PROC_PF_SRVALLOCSIZE 0xe000 /* in 8 byte units */ - -/* correlation types */ -#define RPC_FC_NORMAL_CONFORMANCE 0x00 -#define RPC_FC_POINTER_CONFORMANCE 0x10 -#define RPC_FC_TOP_LEVEL_CONFORMANCE 0x20 -#define RPC_FC_CONSTANT_CONFORMANCE 0x40 -#define RPC_FC_TOP_LEVEL_MULTID_CONFORMANCE 0x80 - -/* user marshal flags */ -#define USER_MARSHAL_UNIQUE 0x80 -#define USER_MARSHAL_REF 0x40 -#define USER_MARSHAL_POINTER 0xc0 -#define USER_MARSHAL_IID 0x20 - -/* context handle flags */ -#define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL 0x01 -#define NDR_CONTEXT_HANDLE_SERIALIZE 0x02 -#define NDR_CONTEXT_HANDLE_NO_SERIALIZE 0x04 -#define NDR_STRICT_CONTEXT_HANDLE 0x08 - -#endif /* __WINE_RPCFC_H */ diff --git a/tools/widl/client.c b/tools/widl/client.c index 739dba9..8b3b139 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -91,7 +91,7 @@ static void write_function_stub( const type_t *iface, const var_t *func, print_client("MIDL_STUB_MESSAGE _StubMsg;\n"); if (handle_var) { - if (explicit_fc == RPC_FC_BIND_GENERIC) + if (explicit_fc == FC_BIND_GENERIC) print_client("%s %s;\n", get_explicit_generic_handle_type(handle_var)->name, handle_var->name ); print_client("RPC_BINDING_HANDLE _Handle;\n"); @@ -113,7 +113,7 @@ static void write_function_stub( const type_t *iface, const var_t *func,
print_client("NdrFreeBuffer(&__frame->_StubMsg);\n");
- if (explicit_fc == RPC_FC_BIND_GENERIC) + if (explicit_fc == FC_BIND_GENERIC) { fprintf(client, "\n"); print_client("if (__frame->_Handle)\n"); @@ -144,7 +144,7 @@ static void write_function_stub( const type_t *iface, const var_t *func, if (handle_var) { print_client( "__frame->_Handle = 0;\n" ); - if (explicit_fc == RPC_FC_BIND_GENERIC) + if (explicit_fc == FC_BIND_GENERIC) print_client("__frame->%s = %s;\n", handle_var->name, handle_var->name ); } if (has_ret && decl_indirect(retval->type)) @@ -180,16 +180,16 @@ static void write_function_stub( const type_t *iface, const var_t *func,
switch (explicit_fc) { - case RPC_FC_BIND_PRIMITIVE: + case FC_BIND_PRIMITIVE: print_client("__frame->_Handle = %s;\n", handle_var->name); fprintf(client, "\n"); break; - case RPC_FC_BIND_GENERIC: + case FC_BIND_GENERIC: print_client("__frame->_Handle = %s_bind(%s);\n", get_explicit_generic_handle_type(handle_var)->name, handle_var->name); fprintf(client, "\n"); break; - case RPC_FC_BIND_CONTEXT: + case FC_BIND_CONTEXT: { /* if the context_handle attribute appears in the chain of types * without pointers being followed, then the context handle must diff --git a/tools/widl/expr.c b/tools/widl/expr.c index cf97c7e..b461aee 100644 --- a/tools/widl/expr.c +++ b/tools/widl/expr.c @@ -519,11 +519,11 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc break; case EXPR_STRLIT: result.is_temporary = TRUE; - result.type = type_new_pointer(RPC_FC_UP, type_new_int(TYPE_BASIC_CHAR, 0), NULL); + result.type = type_new_pointer(FC_UP, type_new_int(TYPE_BASIC_CHAR, 0), NULL); break; case EXPR_WSTRLIT: result.is_temporary = TRUE; - result.type = type_new_pointer(RPC_FC_UP, type_new_int(TYPE_BASIC_WCHAR, 0), NULL); + result.type = type_new_pointer(FC_UP, type_new_int(TYPE_BASIC_WCHAR, 0), NULL); break; case EXPR_CHARCONST: result.is_temporary = TRUE; @@ -573,7 +573,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc expr_loc->attr ? expr_loc->attr : ""); result.is_variable = FALSE; result.is_temporary = TRUE; - result.type = type_new_pointer(RPC_FC_UP, result.type, NULL); + result.type = type_new_pointer(FC_UP, result.type, NULL); break; case EXPR_PPTR: result = resolve_expression(expr_loc, cont_type, e->ref); diff --git a/tools/widl/header.c b/tools/widl/header.c index 9f92127..e0c6d38 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -805,17 +805,17 @@ const var_t *get_func_handle_var( const type_t *iface, const var_t *func, if (!is_attr( var->attrs, ATTR_IN ) && is_attr( var->attrs, ATTR_OUT )) continue; if (type_get_type( var->type ) == TYPE_BASIC && type_basic_get_type( var->type ) == TYPE_BASIC_HANDLE) { - *explicit_fc = RPC_FC_BIND_PRIMITIVE; + *explicit_fc = FC_BIND_PRIMITIVE; return var; } if (get_explicit_generic_handle_type( var )) { - *explicit_fc = RPC_FC_BIND_GENERIC; + *explicit_fc = FC_BIND_GENERIC; return var; } if (is_context_handle( var->type )) { - *explicit_fc = RPC_FC_BIND_CONTEXT; + *explicit_fc = FC_BIND_CONTEXT; return var; } } @@ -824,13 +824,13 @@ const var_t *get_func_handle_var( const type_t *iface, const var_t *func, { if (type_get_type( var->type ) == TYPE_BASIC && type_basic_get_type( var->type ) == TYPE_BASIC_HANDLE) - *implicit_fc = RPC_FC_BIND_PRIMITIVE; + *implicit_fc = FC_BIND_PRIMITIVE; else - *implicit_fc = RPC_FC_BIND_GENERIC; + *implicit_fc = FC_BIND_GENERIC; return var; }
- *implicit_fc = RPC_FC_AUTO_HANDLE; + *implicit_fc = FC_AUTO_HANDLE; return NULL; }
diff --git a/tools/widl/parser.y b/tools/widl/parser.y index c262ca8..bf715c8 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -38,7 +38,7 @@ #include "expr.h" #include "typetree.h"
-static unsigned char pointer_default = RPC_FC_UP; +static unsigned char pointer_default = FC_UP;
typedef struct list typelist_t; struct typenode { @@ -1107,9 +1107,9 @@ threading_type: ;
pointer_type: - tREF { $$ = RPC_FC_RP; } - | tUNIQUE { $$ = RPC_FC_UP; } - | tPTR { $$ = RPC_FC_FP; } + tREF { $$ = FC_RP; } + | tUNIQUE { $$ = FC_UP; } + | tPTR { $$ = FC_FP; } ;
structdef: tSTRUCT t_ident '{' fields '}' { $$ = type_new_struct($2, current_namespace, TRUE, $4); } @@ -1501,12 +1501,12 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl } if (is_ptr(ptr)) { - if (ptr_attr && ptr_attr != RPC_FC_UP && + if (ptr_attr && ptr_attr != FC_UP && type_get_type(type_pointer_get_ref(ptr)) == TYPE_INTERFACE) warning_loc_info(&v->loc_info, "%s: pointer attribute applied to interface " "pointer type has no effect\n", v->name); - if (!ptr_attr && top && (*pt)->details.pointer.def_fc != RPC_FC_RP) + if (!ptr_attr && top && (*pt)->details.pointer.def_fc != FC_RP) { /* FIXME: this is a horrible hack to cope with the issue that we * store an offset to the typeformat string in the type object, but @@ -1531,9 +1531,9 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl t = type_pointer_get_ref(t);
if (type_get_type(t) != TYPE_BASIC && - (get_basic_fc(t) != RPC_FC_CHAR && - get_basic_fc(t) != RPC_FC_BYTE && - get_basic_fc(t) != RPC_FC_WCHAR)) + (get_basic_fc(t) != FC_CHAR && + get_basic_fc(t) != FC_BYTE && + get_basic_fc(t) != FC_WCHAR)) { error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n", v->name); @@ -1764,7 +1764,7 @@ static declarator_t *make_declarator(var_t *var) static type_t *make_safearray(type_t *type) { return type_new_array(NULL, type_new_alias(type, "SAFEARRAY"), TRUE, 0, - NULL, NULL, RPC_FC_RP); + NULL, NULL, FC_RP); }
static typelib_t *make_library(const char *name, const attr_list_t *attrs) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index f4fe6f5..c56ef48 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -152,7 +152,7 @@ static void free_variable( const var_t *arg, const char *local_var_prefix ) break;
case TGT_STRUCT: - if (get_struct_fc(type) != RPC_FC_STRUCT) + if (get_struct_fc(type) != FC_STRUCT) print_proxy("/* FIXME: %s code for %s struct type 0x%x missing */\n", __FUNCTION__, arg->name, get_struct_fc(type) ); break;
diff --git a/tools/widl/server.c b/tools/widl/server.c index 29b5bec..783ff90 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -104,7 +104,7 @@ static void write_function_stub(const type_t *iface, const var_t *func, unsigned
write_parameters_init(server, indent, func, "__frame->");
- if (explicit_fc == RPC_FC_BIND_PRIMITIVE) + if (explicit_fc == FC_BIND_PRIMITIVE) { print_server("__frame->%s = _pRpcMessage->Handle;\n", handle_var->name); fprintf(server, "\n"); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 38cbfa0..da9ffd0 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -102,86 +102,86 @@ static const char *string_of_type(unsigned char type) { switch (type) { - case RPC_FC_BYTE: return "FC_BYTE"; - case RPC_FC_CHAR: return "FC_CHAR"; - case RPC_FC_SMALL: return "FC_SMALL"; - case RPC_FC_USMALL: return "FC_USMALL"; - case RPC_FC_WCHAR: return "FC_WCHAR"; - case RPC_FC_SHORT: return "FC_SHORT"; - case RPC_FC_USHORT: return "FC_USHORT"; - case RPC_FC_LONG: return "FC_LONG"; - case RPC_FC_ULONG: return "FC_ULONG"; - case RPC_FC_FLOAT: return "FC_FLOAT"; - case RPC_FC_HYPER: return "FC_HYPER"; - case RPC_FC_DOUBLE: return "FC_DOUBLE"; - case RPC_FC_ENUM16: return "FC_ENUM16"; - case RPC_FC_ENUM32: return "FC_ENUM32"; - case RPC_FC_IGNORE: return "FC_IGNORE"; - case RPC_FC_ERROR_STATUS_T: return "FC_ERROR_STATUS_T"; - case RPC_FC_RP: return "FC_RP"; - case RPC_FC_UP: return "FC_UP"; - case RPC_FC_OP: return "FC_OP"; - case RPC_FC_FP: return "FC_FP"; - case RPC_FC_ENCAPSULATED_UNION: return "FC_ENCAPSULATED_UNION"; - case RPC_FC_NON_ENCAPSULATED_UNION: return "FC_NON_ENCAPSULATED_UNION"; - case RPC_FC_STRUCT: return "FC_STRUCT"; - case RPC_FC_PSTRUCT: return "FC_PSTRUCT"; - case RPC_FC_CSTRUCT: return "FC_CSTRUCT"; - case RPC_FC_CPSTRUCT: return "FC_CPSTRUCT"; - case RPC_FC_CVSTRUCT: return "FC_CVSTRUCT"; - case RPC_FC_BOGUS_STRUCT: return "FC_BOGUS_STRUCT"; - case RPC_FC_SMFARRAY: return "FC_SMFARRAY"; - case RPC_FC_LGFARRAY: return "FC_LGFARRAY"; - case RPC_FC_SMVARRAY: return "FC_SMVARRAY"; - case RPC_FC_LGVARRAY: return "FC_LGVARRAY"; - case RPC_FC_CARRAY: return "FC_CARRAY"; - case RPC_FC_CVARRAY: return "FC_CVARRAY"; - case RPC_FC_BOGUS_ARRAY: return "FC_BOGUS_ARRAY"; - case RPC_FC_ALIGNM2: return "FC_ALIGNM2"; - case RPC_FC_ALIGNM4: return "FC_ALIGNM4"; - case RPC_FC_ALIGNM8: return "FC_ALIGNM8"; - case RPC_FC_POINTER: return "FC_POINTER"; - case RPC_FC_C_CSTRING: return "FC_C_CSTRING"; - case RPC_FC_C_WSTRING: return "FC_C_WSTRING"; - case RPC_FC_CSTRING: return "FC_CSTRING"; - case RPC_FC_WSTRING: return "FC_WSTRING"; - case RPC_FC_BYTE_COUNT_POINTER: return "FC_BYTE_COUNT_POINTER"; - case RPC_FC_TRANSMIT_AS: return "FC_TRANSMIT_AS"; - case RPC_FC_REPRESENT_AS: return "FC_REPRESENT_AS"; - case RPC_FC_IP: return "FC_IP"; - case RPC_FC_BIND_CONTEXT: return "FC_BIND_CONTEXT"; - case RPC_FC_BIND_GENERIC: return "FC_BIND_GENERIC"; - case RPC_FC_BIND_PRIMITIVE: return "FC_BIND_PRIMITIVE"; - case RPC_FC_AUTO_HANDLE: return "FC_AUTO_HANDLE"; - case RPC_FC_CALLBACK_HANDLE: return "FC_CALLBACK_HANDLE"; - case RPC_FC_STRUCTPAD1: return "FC_STRUCTPAD1"; - case RPC_FC_STRUCTPAD2: return "FC_STRUCTPAD2"; - case RPC_FC_STRUCTPAD3: return "FC_STRUCTPAD3"; - case RPC_FC_STRUCTPAD4: return "FC_STRUCTPAD4"; - case RPC_FC_STRUCTPAD5: return "FC_STRUCTPAD5"; - case RPC_FC_STRUCTPAD6: return "FC_STRUCTPAD6"; - case RPC_FC_STRUCTPAD7: return "FC_STRUCTPAD7"; - case RPC_FC_STRING_SIZED: return "FC_STRING_SIZED"; - case RPC_FC_NO_REPEAT: return "FC_NO_REPEAT"; - case RPC_FC_FIXED_REPEAT: return "FC_FIXED_REPEAT"; - case RPC_FC_VARIABLE_REPEAT: return "FC_VARIABLE_REPEAT"; - case RPC_FC_FIXED_OFFSET: return "FC_FIXED_OFFSET"; - case RPC_FC_VARIABLE_OFFSET: return "FC_VARIABLE_OFFSET"; - case RPC_FC_PP: return "FC_PP"; - case RPC_FC_EMBEDDED_COMPLEX: return "FC_EMBEDDED_COMPLEX"; - case RPC_FC_DEREFERENCE: return "FC_DEREFERENCE"; - case RPC_FC_DIV_2: return "FC_DIV_2"; - case RPC_FC_MULT_2: return "FC_MULT_2"; - case RPC_FC_ADD_1: return "FC_ADD_1"; - case RPC_FC_SUB_1: return "FC_SUB_1"; - case RPC_FC_CALLBACK: return "FC_CALLBACK"; - case RPC_FC_CONSTANT_IID: return "FC_CONSTANT_IID"; - case RPC_FC_END: return "FC_END"; - case RPC_FC_PAD: return "FC_PAD"; - case RPC_FC_USER_MARSHAL: return "FC_USER_MARSHAL"; - case RPC_FC_RANGE: return "FC_RANGE"; - case RPC_FC_INT3264: return "FC_INT3264"; - case RPC_FC_UINT3264: return "FC_UINT3264"; + case FC_BYTE: return "FC_BYTE"; + case FC_CHAR: return "FC_CHAR"; + case FC_SMALL: return "FC_SMALL"; + case FC_USMALL: return "FC_USMALL"; + case FC_WCHAR: return "FC_WCHAR"; + case FC_SHORT: return "FC_SHORT"; + case FC_USHORT: return "FC_USHORT"; + case FC_LONG: return "FC_LONG"; + case FC_ULONG: return "FC_ULONG"; + case FC_FLOAT: return "FC_FLOAT"; + case FC_HYPER: return "FC_HYPER"; + case FC_DOUBLE: return "FC_DOUBLE"; + case FC_ENUM16: return "FC_ENUM16"; + case FC_ENUM32: return "FC_ENUM32"; + case FC_IGNORE: return "FC_IGNORE"; + case FC_ERROR_STATUS_T: return "FC_ERROR_STATUS_T"; + case FC_RP: return "FC_RP"; + case FC_UP: return "FC_UP"; + case FC_OP: return "FC_OP"; + case FC_FP: return "FC_FP"; + case FC_ENCAPSULATED_UNION: return "FC_ENCAPSULATED_UNION"; + case FC_NON_ENCAPSULATED_UNION: return "FC_NON_ENCAPSULATED_UNION"; + case FC_STRUCT: return "FC_STRUCT"; + case FC_PSTRUCT: return "FC_PSTRUCT"; + case FC_CSTRUCT: return "FC_CSTRUCT"; + case FC_CPSTRUCT: return "FC_CPSTRUCT"; + case FC_CVSTRUCT: return "FC_CVSTRUCT"; + case FC_BOGUS_STRUCT: return "FC_BOGUS_STRUCT"; + case FC_SMFARRAY: return "FC_SMFARRAY"; + case FC_LGFARRAY: return "FC_LGFARRAY"; + case FC_SMVARRAY: return "FC_SMVARRAY"; + case FC_LGVARRAY: return "FC_LGVARRAY"; + case FC_CARRAY: return "FC_CARRAY"; + case FC_CVARRAY: return "FC_CVARRAY"; + case FC_BOGUS_ARRAY: return "FC_BOGUS_ARRAY"; + case FC_ALIGNM2: return "FC_ALIGNM2"; + case FC_ALIGNM4: return "FC_ALIGNM4"; + case FC_ALIGNM8: return "FC_ALIGNM8"; + case FC_POINTER: return "FC_POINTER"; + case FC_C_CSTRING: return "FC_C_CSTRING"; + case FC_C_WSTRING: return "FC_C_WSTRING"; + case FC_CSTRING: return "FC_CSTRING"; + case FC_WSTRING: return "FC_WSTRING"; + case FC_BYTE_COUNT_POINTER: return "FC_BYTE_COUNT_POINTER"; + case FC_TRANSMIT_AS: return "FC_TRANSMIT_AS"; + case FC_REPRESENT_AS: return "FC_REPRESENT_AS"; + case FC_IP: return "FC_IP"; + case FC_BIND_CONTEXT: return "FC_BIND_CONTEXT"; + case FC_BIND_GENERIC: return "FC_BIND_GENERIC"; + case FC_BIND_PRIMITIVE: return "FC_BIND_PRIMITIVE"; + case FC_AUTO_HANDLE: return "FC_AUTO_HANDLE"; + case FC_CALLBACK_HANDLE: return "FC_CALLBACK_HANDLE"; + case FC_STRUCTPAD1: return "FC_STRUCTPAD1"; + case FC_STRUCTPAD2: return "FC_STRUCTPAD2"; + case FC_STRUCTPAD3: return "FC_STRUCTPAD3"; + case FC_STRUCTPAD4: return "FC_STRUCTPAD4"; + case FC_STRUCTPAD5: return "FC_STRUCTPAD5"; + case FC_STRUCTPAD6: return "FC_STRUCTPAD6"; + case FC_STRUCTPAD7: return "FC_STRUCTPAD7"; + case FC_STRING_SIZED: return "FC_STRING_SIZED"; + case FC_NO_REPEAT: return "FC_NO_REPEAT"; + case FC_FIXED_REPEAT: return "FC_FIXED_REPEAT"; + case FC_VARIABLE_REPEAT: return "FC_VARIABLE_REPEAT"; + case FC_FIXED_OFFSET: return "FC_FIXED_OFFSET"; + case FC_VARIABLE_OFFSET: return "FC_VARIABLE_OFFSET"; + case FC_PP: return "FC_PP"; + case FC_EMBEDDED_COMPLEX: return "FC_EMBEDDED_COMPLEX"; + case FC_DEREFERENCE: return "FC_DEREFERENCE"; + case FC_DIV_2: return "FC_DIV_2"; + case FC_MULT_2: return "FC_MULT_2"; + case FC_ADD_1: return "FC_ADD_1"; + case FC_SUB_1: return "FC_SUB_1"; + case FC_CALLBACK: return "FC_CALLBACK"; + case FC_CONSTANT_IID: return "FC_CONSTANT_IID"; + case FC_END: return "FC_END"; + case FC_PAD: return "FC_PAD"; + case FC_USER_MARSHAL: return "FC_USER_MARSHAL"; + case FC_RANGE: return "FC_RANGE"; + case FC_INT3264: return "FC_INT3264"; + case FC_UINT3264: return "FC_UINT3264"; default: error("string_of_type: unknown type 0x%02x\n", type); return NULL; @@ -206,20 +206,20 @@ unsigned char get_basic_fc(const type_t *type) int sign = type_basic_get_sign(type); switch (type_basic_get_type(type)) { - case TYPE_BASIC_INT8: return (sign <= 0 ? RPC_FC_SMALL : RPC_FC_USMALL); - case TYPE_BASIC_INT16: return (sign <= 0 ? RPC_FC_SHORT : RPC_FC_USHORT); - case TYPE_BASIC_INT32: return (sign <= 0 ? RPC_FC_LONG : RPC_FC_ULONG); - case TYPE_BASIC_INT64: return RPC_FC_HYPER; - case TYPE_BASIC_INT: return (sign <= 0 ? RPC_FC_LONG : RPC_FC_ULONG); - case TYPE_BASIC_INT3264: return (sign <= 0 ? RPC_FC_INT3264 : RPC_FC_UINT3264); - case TYPE_BASIC_BYTE: return RPC_FC_BYTE; - case TYPE_BASIC_CHAR: return RPC_FC_CHAR; - case TYPE_BASIC_WCHAR: return RPC_FC_WCHAR; - case TYPE_BASIC_HYPER: return RPC_FC_HYPER; - case TYPE_BASIC_FLOAT: return RPC_FC_FLOAT; - case TYPE_BASIC_DOUBLE: return RPC_FC_DOUBLE; - case TYPE_BASIC_ERROR_STATUS_T: return RPC_FC_ERROR_STATUS_T; - case TYPE_BASIC_HANDLE: return RPC_FC_BIND_PRIMITIVE; + case TYPE_BASIC_INT8: return (sign <= 0 ? FC_SMALL : FC_USMALL); + case TYPE_BASIC_INT16: return (sign <= 0 ? FC_SHORT : FC_USHORT); + case TYPE_BASIC_INT32: return (sign <= 0 ? FC_LONG : FC_ULONG); + case TYPE_BASIC_INT64: return FC_HYPER; + case TYPE_BASIC_INT: return (sign <= 0 ? FC_LONG : FC_ULONG); + case TYPE_BASIC_INT3264: return (sign <= 0 ? FC_INT3264 : FC_UINT3264); + case TYPE_BASIC_BYTE: return FC_BYTE; + case TYPE_BASIC_CHAR: return FC_CHAR; + case TYPE_BASIC_WCHAR: return FC_WCHAR; + case TYPE_BASIC_HYPER: return FC_HYPER; + case TYPE_BASIC_FLOAT: return FC_FLOAT; + case TYPE_BASIC_DOUBLE: return FC_DOUBLE; + case TYPE_BASIC_ERROR_STATUS_T: return FC_ERROR_STATUS_T; + case TYPE_BASIC_HANDLE: return FC_BIND_PRIMITIVE; } return 0; } @@ -228,20 +228,20 @@ static unsigned char get_basic_fc_signed(const type_t *type) { switch (type_basic_get_type(type)) { - case TYPE_BASIC_INT8: return RPC_FC_SMALL; - case TYPE_BASIC_INT16: return RPC_FC_SHORT; - case TYPE_BASIC_INT32: return RPC_FC_LONG; - case TYPE_BASIC_INT64: return RPC_FC_HYPER; - case TYPE_BASIC_INT: return RPC_FC_LONG; - case TYPE_BASIC_INT3264: return RPC_FC_INT3264; - case TYPE_BASIC_BYTE: return RPC_FC_BYTE; - case TYPE_BASIC_CHAR: return RPC_FC_CHAR; - case TYPE_BASIC_WCHAR: return RPC_FC_WCHAR; - case TYPE_BASIC_HYPER: return RPC_FC_HYPER; - case TYPE_BASIC_FLOAT: return RPC_FC_FLOAT; - case TYPE_BASIC_DOUBLE: return RPC_FC_DOUBLE; - case TYPE_BASIC_ERROR_STATUS_T: return RPC_FC_ERROR_STATUS_T; - case TYPE_BASIC_HANDLE: return RPC_FC_BIND_PRIMITIVE; + case TYPE_BASIC_INT8: return FC_SMALL; + case TYPE_BASIC_INT16: return FC_SHORT; + case TYPE_BASIC_INT32: return FC_LONG; + case TYPE_BASIC_INT64: return FC_HYPER; + case TYPE_BASIC_INT: return FC_LONG; + case TYPE_BASIC_INT3264: return FC_INT3264; + case TYPE_BASIC_BYTE: return FC_BYTE; + case TYPE_BASIC_CHAR: return FC_CHAR; + case TYPE_BASIC_WCHAR: return FC_WCHAR; + case TYPE_BASIC_HYPER: return FC_HYPER; + case TYPE_BASIC_FLOAT: return FC_FLOAT; + case TYPE_BASIC_DOUBLE: return FC_DOUBLE; + case TYPE_BASIC_ERROR_STATUS_T: return FC_ERROR_STATUS_T; + case TYPE_BASIC_HANDLE: return FC_BIND_PRIMITIVE; } return 0; } @@ -272,7 +272,7 @@ unsigned char get_pointer_fc(const type_t *type, const attr_list_t *attrs, int t }
if (toplevel_param) - return RPC_FC_RP; + return FC_RP; else if (is_ptr(type)) return type_pointer_get_default_fc(type); else @@ -284,9 +284,9 @@ static unsigned char get_pointer_fc_context( const type_t *type, const attr_list { int pointer_fc = get_pointer_fc(type, attrs, context == TYPE_CONTEXT_TOPLEVELPARAM);
- if (pointer_fc == RPC_FC_UP && is_attr( attrs, ATTR_OUT ) && + if (pointer_fc == FC_UP && is_attr( attrs, ATTR_OUT ) && context == TYPE_CONTEXT_PARAM && is_object( current_iface )) - pointer_fc = RPC_FC_OP; + pointer_fc = FC_OP;
return pointer_fc; } @@ -295,9 +295,9 @@ static unsigned char get_enum_fc(const type_t *type) { assert(type_get_type(type) == TYPE_ENUM); if (is_aliaschain_attr(type, ATTR_V1ENUM)) - return RPC_FC_ENUM32; + return FC_ENUM32; else - return RPC_FC_ENUM16; + return FC_ENUM16; }
static type_t *get_user_type(const type_t *t, const char **pname) @@ -382,7 +382,7 @@ static int cant_be_null(const var_t *v) if (!type_array_is_decl_as_ptr( v->type )) return 0; /* fall through */ case TGT_POINTER: - return (get_pointer_fc(v->type, v->attrs, TRUE) == RPC_FC_RP); + return (get_pointer_fc(v->type, v->attrs, TRUE) == FC_RP); case TGT_CTXT_HANDLE_POINTER: return TRUE; default: @@ -484,7 +484,7 @@ unsigned char get_struct_fc(const type_t *type) fields = type_struct_get_fields(type);
if (get_padding(fields)) - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT;
if (fields) LIST_FOR_EACH_ENTRY( field, fields, var_t, entry ) { @@ -504,7 +504,7 @@ unsigned char get_struct_fc(const type_t *type) }
if (is_array(type_array_get_element(field->type))) - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT;
if (type_array_has_conformance(field->type)) { @@ -524,37 +524,37 @@ unsigned char get_struct_fc(const type_t *type) { case TGT_USER_TYPE: case TGT_IFACE_POINTER: - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT; case TGT_BASIC: if (type_basic_get_type(t) == TYPE_BASIC_INT3264 && pointer_size != 4) - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT; break; case TGT_ENUM: - if (get_enum_fc(t) == RPC_FC_ENUM16) - return RPC_FC_BOGUS_STRUCT; + if (get_enum_fc(t) == FC_ENUM16) + return FC_BOGUS_STRUCT; break; case TGT_POINTER: case TGT_ARRAY: - if (get_pointer_fc(t, field->attrs, FALSE) == RPC_FC_RP || pointer_size != 4) - return RPC_FC_BOGUS_STRUCT; + if (get_pointer_fc(t, field->attrs, FALSE) == FC_RP || pointer_size != 4) + return FC_BOGUS_STRUCT; has_pointer = 1; break; case TGT_UNION: - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT; case TGT_STRUCT: { unsigned char fc = get_struct_fc(t); switch (fc) { - case RPC_FC_STRUCT: + case FC_STRUCT: break; - case RPC_FC_CVSTRUCT: + case FC_CVSTRUCT: has_conformance = 1; has_variance = 1; has_pointer = 1; break;
- case RPC_FC_CPSTRUCT: + case FC_CPSTRUCT: has_conformance = 1; if (list_next( fields, &field->entry )) error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n", @@ -562,14 +562,14 @@ unsigned char get_struct_fc(const type_t *type) has_pointer = 1; break;
- case RPC_FC_CSTRUCT: + case FC_CSTRUCT: has_conformance = 1; if (list_next( fields, &field->entry )) error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n", field->name); break;
- case RPC_FC_PSTRUCT: + case FC_PSTRUCT: has_pointer = 1; break;
@@ -578,13 +578,13 @@ unsigned char get_struct_fc(const type_t *type) /* fallthru - treat it as complex */
/* as soon as we see one of these these members, it's bogus... */ - case RPC_FC_BOGUS_STRUCT: - return RPC_FC_BOGUS_STRUCT; + case FC_BOGUS_STRUCT: + return FC_BOGUS_STRUCT; } break; } case TGT_RANGE: - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT; case TGT_STRING: /* shouldn't get here because of TDT_IGNORE_STRINGS above. fall through */ case TGT_INVALID: @@ -599,17 +599,17 @@ unsigned char get_struct_fc(const type_t *type) if( has_variance ) { if ( has_conformance ) - return RPC_FC_CVSTRUCT; + return FC_CVSTRUCT; else - return RPC_FC_BOGUS_STRUCT; + return FC_BOGUS_STRUCT; } if( has_conformance && has_pointer ) - return RPC_FC_CPSTRUCT; + return FC_CPSTRUCT; if( has_conformance ) - return RPC_FC_CSTRUCT; + return FC_CSTRUCT; if( has_pointer ) - return RPC_FC_PSTRUCT; - return RPC_FC_STRUCT; + return FC_PSTRUCT; + return FC_STRUCT; }
static unsigned char get_array_fc(const type_t *type) @@ -625,60 +625,60 @@ static unsigned char get_array_fc(const type_t *type) { unsigned int size = type_memsize(elem_type); if (size * type_array_get_dim(type) > 0xffffuL) - fc = RPC_FC_LGFARRAY; + fc = FC_LGFARRAY; else - fc = RPC_FC_SMFARRAY; + fc = FC_SMFARRAY; } else - fc = RPC_FC_CARRAY; + fc = FC_CARRAY;
if (type_array_has_variance(type)) { - if (fc == RPC_FC_SMFARRAY) - fc = RPC_FC_SMVARRAY; - else if (fc == RPC_FC_LGFARRAY) - fc = RPC_FC_LGVARRAY; - else if (fc == RPC_FC_CARRAY) - fc = RPC_FC_CVARRAY; + if (fc == FC_SMFARRAY) + fc = FC_SMVARRAY; + else if (fc == FC_LGFARRAY) + fc = FC_LGVARRAY; + else if (fc == FC_CARRAY) + fc = FC_CVARRAY; }
switch (typegen_detect_type(elem_type, NULL, TDT_IGNORE_STRINGS)) { case TGT_USER_TYPE: - fc = RPC_FC_BOGUS_ARRAY; + fc = FC_BOGUS_ARRAY; break; case TGT_BASIC: if (type_basic_get_type(elem_type) == TYPE_BASIC_INT3264 && pointer_size != 4) - fc = RPC_FC_BOGUS_ARRAY; + fc = FC_BOGUS_ARRAY; break; case TGT_STRUCT: switch (get_struct_fc(elem_type)) { - case RPC_FC_BOGUS_STRUCT: - fc = RPC_FC_BOGUS_ARRAY; + case FC_BOGUS_STRUCT: + fc = FC_BOGUS_ARRAY; break; } break; case TGT_ENUM: /* is 16-bit enum - if so, wire size differs from mem size and so * the array cannot be block copied, which means the array is complex */ - if (get_enum_fc(elem_type) == RPC_FC_ENUM16) - fc = RPC_FC_BOGUS_ARRAY; + if (get_enum_fc(elem_type) == FC_ENUM16) + fc = FC_BOGUS_ARRAY; break; case TGT_UNION: case TGT_IFACE_POINTER: - fc = RPC_FC_BOGUS_ARRAY; + fc = FC_BOGUS_ARRAY; break; case TGT_POINTER: /* ref pointers cannot just be block copied. unique pointers to * interfaces need special treatment. either case means the array is * complex */ - if (get_pointer_fc(elem_type, NULL, FALSE) == RPC_FC_RP || pointer_size != 4) - fc = RPC_FC_BOGUS_ARRAY; + if (get_pointer_fc(elem_type, NULL, FALSE) == FC_RP || pointer_size != 4) + fc = FC_BOGUS_ARRAY; break; case TGT_RANGE: - fc = RPC_FC_BOGUS_ARRAY; + fc = FC_BOGUS_ARRAY; break; case TGT_CTXT_HANDLE: case TGT_CTXT_HANDLE_POINTER: @@ -695,7 +695,7 @@ static unsigned char get_array_fc(const type_t *type) static int is_non_complex_struct(const type_t *type) { return (type_get_type(type) == TYPE_STRUCT && - get_struct_fc(type) != RPC_FC_BOGUS_STRUCT); + get_struct_fc(type) != FC_BOGUS_STRUCT); }
static int type_has_pointers(const type_t *type) @@ -753,12 +753,12 @@ static int type_has_full_pointer(const type_t *type, const attr_list_t *attrs, case TGT_USER_TYPE: return FALSE; case TGT_POINTER: - if (get_pointer_fc(type, attrs, toplevel_param) == RPC_FC_FP) + if (get_pointer_fc(type, attrs, toplevel_param) == FC_FP) return TRUE; else return FALSE; case TGT_ARRAY: - if (get_pointer_fc(type, attrs, toplevel_param) == RPC_FC_FP) + if (get_pointer_fc(type, attrs, toplevel_param) == FC_FP) return TRUE; else return type_has_full_pointer(type_array_get_element(type), NULL, FALSE); @@ -861,7 +861,7 @@ static const char *get_context_handle_type_name(const type_t *type) do { \ if (file) \ fprintf(file, "/* %2u */\n", typestring_offset); \ - print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", RPC_##fctype); \ + print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", fctype); \ } \ while (0)
@@ -981,10 +981,10 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned case TGT_BASIC: *flags |= IsBasetype; fc = get_basic_fc_signed( var->type ); - if (fc == RPC_FC_BIND_PRIMITIVE) + if (fc == FC_BIND_PRIMITIVE) { buffer_size = 4; /* actually 0 but avoids setting MustSize */ - fc = RPC_FC_LONG; + fc = FC_LONG; } break; case TGT_ENUM: @@ -1005,7 +1005,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned case TGT_ARRAY: *flags |= MustFree; if (type_array_is_decl_as_ptr(var->type) && var->type->details.array.ptr_tfsoff && - get_pointer_fc( var->type, var->attrs, !is_return ) == RPC_FC_RP) + get_pointer_fc( var->type, var->attrs, !is_return ) == FC_RP) { *typestring_offset = var->type->typestring_offset; *flags |= IsSimpleRef; @@ -1013,7 +1013,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned break; case TGT_STRING: *flags |= MustFree; - if (is_declptr( var->type ) && get_pointer_fc( var->type, var->attrs, !is_return ) == RPC_FC_RP) + if (is_declptr( var->type ) && get_pointer_fc( var->type, var->attrs, !is_return ) == FC_RP) { /* skip over pointer description straight to string description */ if (is_conformant_array( var->type )) *typestring_offset += 4; @@ -1029,7 +1029,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned buffer_size = 20; break; case TGT_POINTER: - if (get_pointer_fc( var->type, var->attrs, !is_return ) == RPC_FC_RP) + if (get_pointer_fc( var->type, var->attrs, !is_return ) == FC_RP) { const type_t *ref = type_pointer_get_ref( var->type );
@@ -1044,7 +1044,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned if (!is_in && is_out) server_size = pointer_size; break; case TGT_ENUM: - if ((fc = get_enum_fc( ref )) == RPC_FC_ENUM32) + if ((fc = get_enum_fc( ref )) == FC_ENUM32) { *flags |= IsSimpleRef | IsBasetype; if (!is_in && is_out) server_size = pointer_size; @@ -1078,9 +1078,9 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned *typestring_offset = ref->typestring_offset; switch (get_struct_fc(ref)) { - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_BOGUS_STRUCT: + case FC_STRUCT: + case FC_PSTRUCT: + case FC_BOGUS_STRUCT: if (!is_in && is_out) server_size = type_memsize( ref ); break; default: @@ -1201,8 +1201,8 @@ static unsigned int write_old_procformatstring_type(FILE *file, int indent, cons { fc = get_basic_fc_signed(var->type);
- if (fc == RPC_FC_BIND_PRIMITIVE) - fc = RPC_FC_IGNORE; + if (fc == FC_BIND_PRIMITIVE) + fc = FC_IGNORE; }
print_file(file, indent, "0x%02x, /* %s */\n", @@ -1294,7 +1294,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface, unsigned char explicit_fc, implicit_fc; unsigned char handle_flags; const var_t *handle_var = get_func_handle_var( iface, func, &explicit_fc, &implicit_fc ); - unsigned char oi_flags = RPC_FC_PROC_OIF_RPCFLAGS | RPC_FC_PROC_OIF_NEWINIT; + unsigned char oi_flags = Oi_HAS_RPCFLAGS | Oi_USE_NEW_INIT_ROUTINES; unsigned int rpc_flags = get_rpc_flags( func->attrs ); unsigned int nb_args = 0; unsigned int stack_size = 0; @@ -1302,11 +1302,11 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface, unsigned short handle_stack_offset = 0; unsigned short handle_param_num = 0;
- if (is_full_pointer_function( func )) oi_flags |= RPC_FC_PROC_OIF_FULLPTR; + if (is_full_pointer_function( func )) oi_flags |= Oi_FULL_PTR_USED; if (is_object( iface )) { - oi_flags |= RPC_FC_PROC_OIF_OBJECT; - if (get_stub_mode() == MODE_Oif) oi_flags |= RPC_FC_PROC_OIF_OBJ_V2; + oi_flags |= Oi_OBJECT_PROC; + if (get_stub_mode() == MODE_Oif) oi_flags |= Oi_OBJ_USE_V2_INTERPRETER; stack_size += pointer_size; }
@@ -1340,7 +1340,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface, { switch (explicit_fc) { - case RPC_FC_BIND_PRIMITIVE: + case FC_BIND_PRIMITIVE: handle_flags = 0; print_file( file, indent, "0x%02x,\t/* %s */\n", explicit_fc, string_of_type(explicit_fc) ); print_file( file, indent, "0x%02x,\n", handle_flags ); @@ -1348,17 +1348,17 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface, handle_stack_offset, handle_stack_offset ); *offset += 4; break; - case RPC_FC_BIND_GENERIC: + case FC_BIND_GENERIC: handle_flags = type_memsize( handle_var->type ); print_file( file, indent, "0x%02x,\t/* %s */\n", explicit_fc, string_of_type(explicit_fc) ); print_file( file, indent, "0x%02x,\n", handle_flags ); print_file( file, indent, "NdrFcShort(0x%hx),\t/* stack offset = %hu */\n", handle_stack_offset, handle_stack_offset ); print_file( file, indent, "0x%02x,\n", get_generic_handle_offset( handle_var->type ) ); - print_file( file, indent, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file( file, indent, "0x%x,\t/* FC_PAD */\n", FC_PAD); *offset += 6; break; - case RPC_FC_BIND_CONTEXT: + case FC_BIND_CONTEXT: handle_flags = get_contexthandle_flags( iface, handle_var->attrs, handle_var->type ); print_file( file, indent, "0x%02x,\t/* %s */\n", explicit_fc, string_of_type(explicit_fc) ); print_file( file, indent, "0x%02x,\n", handle_flags ); @@ -1550,7 +1550,7 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, const expr_t *expr) { unsigned char operator_type = 0; - unsigned char conftype = RPC_FC_NORMAL_CONFORMANCE; + unsigned char conftype = FC_NORMAL_CONFORMANCE; const char *conftype_string = "field"; const expr_t *subexpr; const type_t *iface = NULL; @@ -1570,7 +1570,7 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, UCHAR_MAX * (USHRT_MAX + 1) + USHRT_MAX);
print_file(file, 2, "0x%x, /* Corr desc: constant, val = %d */\n", - RPC_FC_CONSTANT_CONFORMANCE, expr->cval); + FC_CONSTANT_CONFORMANCE, expr->cval); print_file(file, 2, "0x%x,\n", expr->cval >> 16); print_file(file, 2, "NdrFcShort(0x%hx),\n", (unsigned short)expr->cval);
@@ -1579,7 +1579,7 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type,
if (!cont_type) /* top-level conformance */ { - conftype = RPC_FC_TOP_LEVEL_CONFORMANCE; + conftype = FC_TOP_LEVEL_CONFORMANCE; conftype_string = "parameter"; cont_type = current_func->type; name = current_func->name; @@ -1590,7 +1590,7 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, name = cont_type->name; if (is_ptr(type) || (is_array(type) && type_array_is_decl_as_ptr(type))) { - conftype = RPC_FC_POINTER_CONFORMANCE; + conftype = FC_POINTER_CONFORMANCE; conftype_string = "field pointer"; } } @@ -1600,34 +1600,34 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, { case EXPR_PPTR: subexpr = subexpr->ref; - operator_type = RPC_FC_DEREFERENCE; + operator_type = FC_DEREFERENCE; break; case EXPR_DIV: if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 2)) { subexpr = subexpr->ref; - operator_type = RPC_FC_DIV_2; + operator_type = FC_DIV_2; } break; case EXPR_MUL: if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 2)) { subexpr = subexpr->ref; - operator_type = RPC_FC_MULT_2; + operator_type = FC_MULT_2; } break; case EXPR_SUB: if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 1)) { subexpr = subexpr->ref; - operator_type = RPC_FC_SUB_1; + operator_type = FC_SUB_1; } break; case EXPR_ADD: if (subexpr->u.ext->is_const && (subexpr->u.ext->cval == 1)) { subexpr = subexpr->ref; - operator_type = RPC_FC_ADD_1; + operator_type = FC_ADD_1; } break; default: @@ -1686,26 +1686,26 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, { switch (get_basic_fc(correlation_variable)) { - case RPC_FC_CHAR: - case RPC_FC_SMALL: - param_type = RPC_FC_SMALL; + case FC_CHAR: + case FC_SMALL: + param_type = FC_SMALL; break; - case RPC_FC_BYTE: - case RPC_FC_USMALL: - param_type = RPC_FC_USMALL; + case FC_BYTE: + case FC_USMALL: + param_type = FC_USMALL; break; - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - param_type = RPC_FC_SHORT; + case FC_WCHAR: + case FC_SHORT: + param_type = FC_SHORT; break; - case RPC_FC_USHORT: - param_type = RPC_FC_USHORT; + case FC_USHORT: + param_type = FC_USHORT; break; - case RPC_FC_LONG: - param_type = RPC_FC_LONG; + case FC_LONG: + param_type = FC_LONG; break; - case RPC_FC_ULONG: - param_type = RPC_FC_ULONG; + case FC_ULONG: + param_type = FC_ULONG; break; default: error("write_conf_or_var_desc: conformance variable type not supported 0x%x\n", @@ -1714,17 +1714,17 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, } else if (type_get_type(correlation_variable) == TYPE_ENUM) { - if (get_enum_fc(correlation_variable) == RPC_FC_ENUM32) - param_type = RPC_FC_LONG; + if (get_enum_fc(correlation_variable) == FC_ENUM32) + param_type = FC_LONG; else - param_type = RPC_FC_SHORT; + param_type = FC_SHORT; } else if (type_get_type(correlation_variable) == TYPE_POINTER) { if (pointer_size == 8) - param_type = RPC_FC_HYPER; + param_type = FC_HYPER; else - param_type = RPC_FC_LONG; + param_type = FC_LONG; } else { @@ -1775,7 +1775,7 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, error("Maximum number of callback routines reached\n");
print_file(file, 2, "0x%x,\t/* Corr desc: %s in %s */\n", conftype, conftype_string, name); - print_file(file, 2, "0x%x,\t/* %s */\n", RPC_FC_CALLBACK, "FC_CALLBACK"); + print_file(file, 2, "0x%x,\t/* %s */\n", FC_CALLBACK, "FC_CALLBACK"); print_file(file, 2, "NdrFcShort(0x%hx),\t/* %u */\n", (unsigned short)callback_offset, callback_offset); } else /* output a dummy corr desc that isn't used */ @@ -1849,34 +1849,34 @@ unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align) case TYPE_BASIC: switch (get_basic_fc(t)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_USMALL: - case RPC_FC_SMALL: + case FC_BYTE: + case FC_CHAR: + case FC_USMALL: + case FC_SMALL: size = 1; if (size > *align) *align = size; break; - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: + case FC_WCHAR: + case FC_USHORT: + case FC_SHORT: size = 2; if (size > *align) *align = size; break; - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_FLOAT: + case FC_ULONG: + case FC_LONG: + case FC_ERROR_STATUS_T: + case FC_FLOAT: size = 4; if (size > *align) *align = size; break; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: size = 8; if (size > *align) *align = size; break; - case RPC_FC_INT3264: - case RPC_FC_UINT3264: - case RPC_FC_BIND_PRIMITIVE: + case FC_INT3264: + case FC_UINT3264: + case FC_BIND_PRIMITIVE: assert( pointer_size ); size = pointer_size; if (size > *align) *align = size; @@ -1889,8 +1889,8 @@ unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align) case TYPE_ENUM: switch (get_enum_fc(t)) { - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: + case FC_ENUM16: + case FC_ENUM32: size = 4; if (size > *align) *align = size; break; @@ -1966,24 +1966,24 @@ static unsigned int type_buffer_alignment(const type_t *t) case TYPE_BASIC: switch (get_basic_fc(t)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_USMALL: - case RPC_FC_SMALL: + case FC_BYTE: + case FC_CHAR: + case FC_USMALL: + case FC_SMALL: return 1; - case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: + case FC_WCHAR: + case FC_USHORT: + case FC_SHORT: return 2; - case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_ERROR_STATUS_T: - case RPC_FC_FLOAT: - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_ULONG: + case FC_LONG: + case FC_ERROR_STATUS_T: + case FC_FLOAT: + case FC_INT3264: + case FC_UINT3264: return 4; - case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: return 8; default: error("type_buffer_alignment: Unknown type 0x%x\n", get_basic_fc(t)); @@ -1992,9 +1992,9 @@ static unsigned int type_buffer_alignment(const type_t *t) case TYPE_ENUM: switch (get_enum_fc(t)) { - case RPC_FC_ENUM16: + case FC_ENUM16: return 2; - case RPC_FC_ENUM32: + case FC_ENUM32: return 4; default: error("type_buffer_alignment: Unknown enum type\n"); @@ -2093,14 +2093,14 @@ static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs out_attr = is_attr(attrs, ATTR_OUT); if (!in_attr && !out_attr) in_attr = 1;
- if (out_attr && !in_attr && pointer_type == RPC_FC_RP) - flags |= RPC_FC_P_ONSTACK; + if (out_attr && !in_attr && pointer_type == FC_RP) + flags |= FC_ALLOCED_ON_STACK;
if (is_ptr(type)) { type_t *ref = type_pointer_get_ref(type); if(is_declptr(ref) && !is_user_type(ref)) - flags |= RPC_FC_P_DEREF; + flags |= FC_POINTER_DEREF; }
print_file(file, 2, "0x%x, 0x%x,\t\t/* %s", @@ -2109,9 +2109,9 @@ static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs string_of_type(pointer_type)); if (file) { - if (flags & RPC_FC_P_ONSTACK) + if (flags & FC_ALLOCED_ON_STACK) fprintf(file, " [allocated_on_stack]"); - if (flags & RPC_FC_P_DEREF) + if (flags & FC_POINTER_DEREF) fprintf(file, " [pointer_deref]"); fprintf(file, " */\n"); } @@ -2130,7 +2130,7 @@ static unsigned int write_simple_pointer(FILE *file, const attr_list_t *attrs, const type_t *ref; int in_attr = is_attr(attrs, ATTR_IN); int out_attr = is_attr(attrs, ATTR_OUT); - unsigned char flags = RPC_FC_P_SIMPLEPOINTER; + unsigned char flags = FC_SIMPLE_POINTER;
/* for historical reasons, write_simple_pointer also handled string types, * but no longer does. catch bad uses of the function with this check */ @@ -2146,11 +2146,11 @@ static unsigned int write_simple_pointer(FILE *file, const attr_list_t *attrs, fc = get_basic_fc(ref);
if (out_attr && !in_attr) - flags |= RPC_FC_P_ONSTACK; + flags |= FC_ALLOCED_ON_STACK;
print_file(file, 2, "0x%02x, 0x%x,\t/* %s %s[simple_pointer] */\n", pointer_fc, flags, string_of_type(pointer_fc), - flags & RPC_FC_P_ONSTACK ? "[allocated_on_stack] " : ""); + flags & FC_ALLOCED_ON_STACK ? "[allocated_on_stack] " : ""); print_file(file, 2, "0x%02x,\t/* %s */\n", fc, string_of_type(fc)); print_file(file, 2, "0x5c,\t/* FC_PAD */\n"); return 4; @@ -2202,10 +2202,10 @@ static int user_type_has_variable_size(const type_t *t) { switch (get_struct_fc(t)) { - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CVSTRUCT: + case FC_PSTRUCT: + case FC_CSTRUCT: + case FC_CPSTRUCT: + case FC_CVSTRUCT: return TRUE; } } @@ -2254,9 +2254,9 @@ static unsigned int write_user_tfs(FILE *file, type_t *type, unsigned int *tfsof absoff = utype->typestring_offset; }
- if (type_get_type(utype) == TYPE_POINTER && get_pointer_fc(utype, NULL, FALSE) == RPC_FC_RP) + if (type_get_type(utype) == TYPE_POINTER && get_pointer_fc(utype, NULL, FALSE) == FC_RP) flags = 0x40; - else if (type_get_type(utype) == TYPE_POINTER && get_pointer_fc(utype, NULL, FALSE) == RPC_FC_UP) + else if (type_get_type(utype) == TYPE_POINTER && get_pointer_fc(utype, NULL, FALSE) == FC_UP) flags = 0x80; else flags = 0; @@ -2264,7 +2264,7 @@ static unsigned int write_user_tfs(FILE *file, type_t *type, unsigned int *tfsof start = *tfsoff; update_tfsoff(type, start, file); print_start_tfs_comment(file, type, start); - print_file(file, 2, "0x%x,\t/* FC_USER_MARSHAL */\n", RPC_FC_USER_MARSHAL); + print_file(file, 2, "0x%x,\t/* FC_USER_MARSHAL */\n", FC_USER_MARSHAL); print_file(file, 2, "0x%x,\t/* Alignment= %d, Flags= %02x */\n", flags | (ualign - 1), ualign - 1, flags); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Function offset= %hu */\n", funoff, funoff); @@ -2309,7 +2309,7 @@ static void write_member_type(FILE *file, const type_t *cont, } else if (is_ptr(type) || is_conformant_array(type)) { - unsigned char fc = cont_is_complex ? RPC_FC_POINTER : RPC_FC_LONG; + unsigned char fc = cont_is_complex ? FC_POINTER : FC_LONG; print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc)); *tfsoff += 1; } @@ -2351,10 +2351,10 @@ static void write_end(FILE *file, unsigned int *tfsoff) { if (*tfsoff % 2 == 0) { - print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", FC_PAD); *tfsoff += 1; } - print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); + print_file(file, 2, "0x%x,\t/* FC_END */\n", FC_END); *tfsoff += 1; }
@@ -2376,8 +2376,8 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff) absoff += 8; /* we already have a corr descr, skip it */ reloff = absoff - (*tfsoff + 6); print_file(file, 0, "/* %d */\n", *tfsoff); - print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", RPC_FC_NON_ENCAPSULATED_UNION); - print_file(file, 2, "0x%x,\t/* FIXME: always FC_LONG */\n", RPC_FC_LONG); + print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", FC_NON_ENCAPSULATED_UNION); + print_file(file, 2, "0x%x,\t/* FIXME: always FC_LONG */\n", FC_LONG); write_conf_or_var_desc(file, current_structure, offset, ft, get_attrp(f->attrs, ATTR_SWITCHIS)); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", @@ -2496,8 +2496,8 @@ static int write_no_repeat_pointer_descriptions( if (is_ptr(type) || (is_conformant_array(type) && type_array_is_decl_as_ptr(type))) { - print_file(file, 2, "0x%02x, /* FC_NO_REPEAT */\n", RPC_FC_NO_REPEAT); - print_file(file, 2, "0x%02x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%02x, /* FC_NO_REPEAT */\n", FC_NO_REPEAT); + print_file(file, 2, "0x%02x, /* FC_PAD */\n", FC_PAD); *typestring_offset += 2;
return write_pointer_description_offsets(file, attrs, type, @@ -2560,8 +2560,8 @@ static int write_fixed_array_pointer_descriptions(
increment_size = type_memsize(type_array_get_element(type));
- print_file(file, 2, "0x%02x, /* FC_FIXED_REPEAT */\n", RPC_FC_FIXED_REPEAT); - print_file(file, 2, "0x%02x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%02x, /* FC_FIXED_REPEAT */\n", FC_FIXED_REPEAT); + print_file(file, 2, "0x%02x, /* FC_PAD */\n", FC_PAD); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Iterations = %d */\n", (unsigned short)type_array_get_dim(type), type_array_get_dim(type)); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Increment = %d */\n", (unsigned short)increment_size, increment_size); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (unsigned short)*offset_in_memory, *offset_in_memory); @@ -2634,8 +2634,8 @@ static int write_conformant_array_pointer_descriptions( if (increment_size > USHRT_MAX) error("array size of %u bytes is too large\n", increment_size);
- print_file(file, 2, "0x%02x, /* FC_VARIABLE_REPEAT */\n", RPC_FC_VARIABLE_REPEAT); - print_file(file, 2, "0x%02x, /* FC_FIXED_OFFSET */\n", RPC_FC_FIXED_OFFSET); + print_file(file, 2, "0x%02x, /* FC_VARIABLE_REPEAT */\n", FC_VARIABLE_REPEAT); + print_file(file, 2, "0x%02x, /* FC_FIXED_OFFSET */\n", FC_FIXED_OFFSET); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Increment = %d */\n", (unsigned short)increment_size, increment_size); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (unsigned short)offset_in_memory, offset_in_memory); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Number of pointers = %d */\n", (unsigned short)pointer_count, pointer_count); @@ -2676,8 +2676,8 @@ static int write_varying_array_pointer_descriptions( if (increment_size > USHRT_MAX) error("array size of %u bytes is too large\n", increment_size);
- print_file(file, 2, "0x%02x, /* FC_VARIABLE_REPEAT */\n", RPC_FC_VARIABLE_REPEAT); - print_file(file, 2, "0x%02x, /* FC_VARIABLE_OFFSET */\n", RPC_FC_VARIABLE_OFFSET); + print_file(file, 2, "0x%02x, /* FC_VARIABLE_REPEAT */\n", FC_VARIABLE_REPEAT); + print_file(file, 2, "0x%02x, /* FC_VARIABLE_OFFSET */\n", FC_VARIABLE_OFFSET); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Increment = %d */\n", (unsigned short)increment_size, increment_size); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (unsigned short)*offset_in_memory, *offset_in_memory); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Number of pointers = %d */\n", (unsigned short)pointer_count, pointer_count); @@ -2760,7 +2760,7 @@ static void write_pointer_description(FILE *file, const attr_list_t *attrs, type write_conformant_array_pointer_descriptions( file, attrs, type, 0, typestring_offset); else if (type_get_type(type) == TYPE_STRUCT && - get_struct_fc(type) == RPC_FC_CPSTRUCT) + get_struct_fc(type) == FC_CPSTRUCT) { type_t *carray = find_array_or_string_in_struct(type)->type; write_conformant_array_pointer_descriptions( file, NULL, carray, @@ -2788,10 +2788,10 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
if (is_declptr(type)) { - unsigned char flag = is_conformant_array(type) ? 0 : RPC_FC_P_SIMPLEPOINTER; + unsigned char flag = is_conformant_array(type) ? 0 : FC_SIMPLE_POINTER; int pointer_type = get_pointer_fc_context(type, attrs, context); if (!pointer_type) - pointer_type = RPC_FC_RP; + pointer_type = FC_RP; print_start_tfs_comment(file, type, *typestring_offset); print_file(file, 2,"0x%x, 0x%x,\t/* %s%s */\n", pointer_type, flag, string_of_type(pointer_type), @@ -2820,7 +2820,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, }
rtype = get_basic_fc(elem_type); - if ((rtype != RPC_FC_BYTE) && (rtype != RPC_FC_CHAR) && (rtype != RPC_FC_WCHAR)) + if ((rtype != FC_BYTE) && (rtype != FC_CHAR) && (rtype != FC_WCHAR)) { error("write_string_tfs: Unimplemented for type 0x%x of name: %s\n", rtype, name); return start_offset; @@ -2837,11 +2837,11 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, error("array size for parameter %s exceeds %u bytes by %u bytes\n", name, 0xffffu, dim - 0xffffu);
- if (rtype == RPC_FC_WCHAR) + if (rtype == FC_WCHAR) WRITE_FCTYPE(file, FC_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", FC_PAD); *typestring_offset += 2;
print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", (unsigned short)dim, dim); @@ -2852,11 +2852,11 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, } else if (is_conformant_array(type)) { - if (rtype == RPC_FC_WCHAR) + if (rtype == FC_WCHAR) WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x,\t/* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); + print_file(file, 2, "0x%x,\t/* FC_STRING_SIZED */\n", FC_STRING_SIZED); *typestring_offset += 2;
*typestring_offset += write_conf_or_var_desc( @@ -2873,11 +2873,11 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, { if (is_processed) return start_offset;
- if (rtype == RPC_FC_WCHAR) + if (rtype == FC_WCHAR) WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", FC_PAD); *typestring_offset += 2;
update_tfsoff(type, start_offset, file); @@ -2901,7 +2901,7 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t : 0;
if (!pointer_type) - pointer_type = RPC_FC_RP; + pointer_type = FC_RP;
if (!is_string_type(attrs, type_array_get_element(type))) write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); @@ -2918,9 +2918,9 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *typestring_offset += 2;
align = 0; - if (fc != RPC_FC_BOGUS_ARRAY) + if (fc != FC_BOGUS_ARRAY) { - if (fc == RPC_FC_LGFARRAY || fc == RPC_FC_LGVARRAY) + if (fc == FC_LGFARRAY || fc == FC_LGVARRAY) { print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", size, size); *typestring_offset += 4; @@ -2936,12 +2936,12 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t += write_conf_or_var_desc(file, current_structure, baseoff, type, size_is);
- if (fc == RPC_FC_SMVARRAY || fc == RPC_FC_LGVARRAY) + if (fc == FC_SMVARRAY || fc == FC_LGVARRAY) { unsigned int elsize = type_memsize(type_array_get_element(type)); unsigned int dim = type_array_get_dim(type);
- if (fc == RPC_FC_LGVARRAY) + if (fc == FC_LGVARRAY) { print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", dim, dim); *typestring_offset += 4; @@ -2964,11 +2964,11 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t if (type_has_pointers(type_array_get_element(type)) && (type_array_is_decl_as_ptr(type) || !current_structure)) { - print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", FC_PAD); *typestring_offset += 2; write_pointer_description(file, is_string_type(attrs, type) ? attrs : NULL, type, typestring_offset); - print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); + print_file(file, 2, "0x%x,\t/* FC_END */\n", FC_END); *typestring_offset += 1; }
@@ -3041,13 +3041,13 @@ static void write_struct_members(FILE *file, const type_t *type, switch (align) { case 2: - fc = RPC_FC_ALIGNM2; + fc = FC_ALIGNM2; break; case 4: - fc = RPC_FC_ALIGNM4; + fc = FC_ALIGNM4; break; case 8: - fc = RPC_FC_ALIGNM8; + fc = FC_ALIGNM8; break; default: error("write_struct_members: cannot align type %d\n", type_get_type(ft)); @@ -3066,7 +3066,7 @@ static void write_struct_members(FILE *file, const type_t *type, if (padding) { print_file(file, 2, "0x%x,\t/* FC_STRUCTPAD%d */\n", - RPC_FC_STRUCTPAD1 + padding - 1, + FC_STRUCTPAD1 + padding - 1, padding); *typestring_offset += 1; } @@ -3129,13 +3129,13 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type, reloff, reloff, absoff); *tfsoff += 2; } - else if (fc == RPC_FC_BOGUS_STRUCT) + else if (fc == FC_BOGUS_STRUCT) { print_file(file, 2, "NdrFcShort(0x0),\n"); *tfsoff += 2; }
- if (fc == RPC_FC_BOGUS_STRUCT) + if (fc == FC_BOGUS_STRUCT) { /* On the sizing pass, type->ptrdesc may be zero, but it's ok as nothing is written to file yet. On the actual writing pass, @@ -3147,22 +3147,22 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type, (unsigned short)reloff, reloff, absoff); *tfsoff += 2; } - else if ((fc == RPC_FC_PSTRUCT) || - (fc == RPC_FC_CPSTRUCT) || - (fc == RPC_FC_CVSTRUCT && type_has_pointers(type))) + else if ((fc == FC_PSTRUCT) || + (fc == FC_CPSTRUCT) || + (fc == FC_CVSTRUCT && type_has_pointers(type))) { - print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", FC_PAD); *tfsoff += 2; write_pointer_description(file, NULL, type, tfsoff); - print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); + print_file(file, 2, "0x%x,\t/* FC_END */\n", FC_END); *tfsoff += 1; }
- write_struct_members(file, type, fc == RPC_FC_BOGUS_STRUCT, &corroff, + write_struct_members(file, type, fc == FC_BOGUS_STRUCT, &corroff, tfsoff);
- if (fc == RPC_FC_BOGUS_STRUCT) + if (fc == FC_BOGUS_STRUCT) { const var_t *f;
@@ -3284,15 +3284,15 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs, fc = get_basic_fc(st); switch (fc) { - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_BYTE: - case RPC_FC_USMALL: - case RPC_FC_WCHAR: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_LONG: - case RPC_FC_ULONG: + case FC_CHAR: + case FC_SMALL: + case FC_BYTE: + case FC_USMALL: + case FC_WCHAR: + case FC_SHORT: + case FC_USHORT: + case FC_LONG: + case FC_ULONG: break; default: fc = 0; @@ -3311,7 +3311,7 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs, type_memsize_and_alignment(f->type, &align); }
- print_file(file, 2, "0x%x,\t/* FC_ENCAPSULATED_UNION */\n", RPC_FC_ENCAPSULATED_UNION); + print_file(file, 2, "0x%x,\t/* FC_ENCAPSULATED_UNION */\n", FC_ENCAPSULATED_UNION); print_file(file, 2, "0x%x,\t/* Switch type= %s */\n", (align << 4) | fc, string_of_type(fc)); *tfsoff += 2; @@ -3327,15 +3327,15 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs, fc = get_basic_fc(st); switch (fc) { - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: - case RPC_FC_SHORT: - case RPC_FC_USHORT: - case RPC_FC_LONG: - case RPC_FC_ULONG: - case RPC_FC_ENUM16: - case RPC_FC_ENUM32: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: + case FC_SHORT: + case FC_USHORT: + case FC_LONG: + case FC_ULONG: + case FC_ENUM16: + case FC_ENUM32: break; default: fc = 0; @@ -3347,7 +3347,7 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs, else error("union switch type must be an integer, char, or enum\n");
- print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", RPC_FC_NON_ENCAPSULATED_UNION); + print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", FC_NON_ENCAPSULATED_UNION); print_file(file, 2, "0x%x,\t/* Switch type= %s */\n", fc, string_of_type(fc)); *tfsoff += 2; @@ -3461,21 +3461,21 @@ static unsigned int write_contexthandle_tfs(FILE *file, if (flags & 0x80) /* via ptr */ { int pointer_type = get_pointer_fc( type, attrs, toplevel_param ); - if (!pointer_type) pointer_type = RPC_FC_RP; + if (!pointer_type) pointer_type = FC_RP; *typeformat_offset += 4; print_file(file, 2,"0x%x, 0x0,\t/* %s */\n", pointer_type, string_of_type(pointer_type) ); print_file(file, 2, "NdrFcShort(0x2),\t /* Offset= 2 (%u) */\n", *typeformat_offset); print_file(file, 0, "/* %2u */\n", *typeformat_offset); }
- print_file(file, 2, "0x%02x,\t/* FC_BIND_CONTEXT */\n", RPC_FC_BIND_CONTEXT); + print_file(file, 2, "0x%02x,\t/* FC_BIND_CONTEXT */\n", FC_BIND_CONTEXT); print_file(file, 2, "0x%x,\t/* Context flags: ", flags); /* return and can't be null values overlap */ if (((flags & 0x21) != 0x21) && (flags & NDR_CONTEXT_HANDLE_CANNOT_BE_NULL)) print_file(file, 0, "can't be null, "); if (flags & NDR_CONTEXT_HANDLE_SERIALIZE) print_file(file, 0, "serialize, "); - if (flags & NDR_CONTEXT_HANDLE_NO_SERIALIZE) + if (flags & NDR_CONTEXT_HANDLE_NOSERIALIZE) print_file(file, 0, "no serialize, "); if (flags & NDR_STRICT_CONTEXT_HANDLE) print_file(file, 0, "strict, "); @@ -3514,7 +3514,7 @@ static unsigned int write_range_tfs(FILE *file, const attr_list_t *attrs, assert(fc <= 0xf);
print_file(file, 0, "/* %u */\n", *typeformat_offset); - print_file(file, 2, "0x%x,\t/* FC_RANGE */\n", RPC_FC_RANGE); + print_file(file, 2, "0x%x,\t/* FC_RANGE */\n", FC_RANGE); print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc)); print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", range_min->cval, range_min->cval); print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", range_max->cval, range_max->cval); @@ -3558,7 +3558,7 @@ static unsigned int write_type_tfs(FILE *file, int indent, int ptr_type; ptr_type = get_pointer_fc(type, attrs, context == TYPE_CONTEXT_TOPLEVELPARAM); - if (ptr_type != RPC_FC_RP || type_array_is_decl_as_ptr(type)) + if (ptr_type != FC_RP || type_array_is_decl_as_ptr(type)) { unsigned int absoff = type->typestring_offset; short reloff = absoff - (*typeformat_offset + 2); @@ -3568,7 +3568,7 @@ static unsigned int write_type_tfs(FILE *file, int indent, string_of_type(ptr_type)); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", reloff, reloff, absoff); - if (ptr_type != RPC_FC_RP) update_tfsoff( type, off, file ); + if (ptr_type != FC_RP) update_tfsoff( type, off, file ); *typeformat_offset += 4; } type->details.array.ptr_tfsoff = off; @@ -3721,39 +3721,39 @@ static unsigned int get_required_buffer_size_type( case TGT_BASIC: switch (get_basic_fc(type)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_USMALL: - case RPC_FC_SMALL: + case FC_BYTE: + case FC_CHAR: + case FC_USMALL: + case FC_SMALL: *alignment = 4; return 1;
- case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: + case FC_WCHAR: + case FC_USHORT: + case FC_SHORT: *alignment = 4; return 2;
- case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - case RPC_FC_ERROR_STATUS_T: + case FC_ULONG: + case FC_LONG: + case FC_FLOAT: + case FC_ERROR_STATUS_T: *alignment = 4; return 4;
- case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: *alignment = 8; return 8;
- case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: assert( pointer_size ); *alignment = pointer_size; return pointer_size;
- case RPC_FC_IGNORE: - case RPC_FC_BIND_PRIMITIVE: + case FC_IGNORE: + case FC_BIND_PRIMITIVE: return 0;
default: @@ -3766,17 +3766,17 @@ static unsigned int get_required_buffer_size_type( case TGT_ENUM: switch (get_enum_fc(type)) { - case RPC_FC_ENUM32: + case FC_ENUM32: *alignment = 4; return 4; - case RPC_FC_ENUM16: + case FC_ENUM16: *alignment = 4; return 2; } break;
case TGT_STRUCT: - if (get_struct_fc(type) == RPC_FC_STRUCT) + if (get_struct_fc(type) == FC_STRUCT) { if (!type_struct_get_fields(type)) return 0; return fields_memsize(type_struct_get_fields(type), alignment); @@ -3789,7 +3789,7 @@ static unsigned int get_required_buffer_size_type( const type_t *ref = type_pointer_get_ref(type); if (is_string_type( attrs, ref )) break; if (!(size = get_required_buffer_size_type( ref, name, NULL, FALSE, &align ))) break; - if (get_pointer_fc(type, attrs, toplevel_param) != RPC_FC_RP) + if (get_pointer_fc(type, attrs, toplevel_param) != FC_RP) { size += 4 + align; align = 4; @@ -3799,12 +3799,12 @@ static unsigned int get_required_buffer_size_type( }
case TGT_ARRAY: - if (get_pointer_fc(type, attrs, toplevel_param) == RPC_FC_RP) + if (get_pointer_fc(type, attrs, toplevel_param) == FC_RP) { switch (get_array_fc(type)) { - case RPC_FC_SMFARRAY: - case RPC_FC_LGFARRAY: + case FC_SMFARRAY: + case FC_LGFARRAY: return type_array_get_dim(type) * get_required_buffer_size_type(type_array_get_element(type), name, NULL, FALSE, alignment); @@ -3946,36 +3946,36 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, const type_t *ref = is_ptr(type) ? type_pointer_get_ref(type) : type; switch (get_basic_fc(ref)) { - case RPC_FC_BYTE: - case RPC_FC_CHAR: - case RPC_FC_SMALL: - case RPC_FC_USMALL: + case FC_BYTE: + case FC_CHAR: + case FC_SMALL: + case FC_USMALL: alignment = 1; break;
- case RPC_FC_WCHAR: - case RPC_FC_USHORT: - case RPC_FC_SHORT: + case FC_WCHAR: + case FC_USHORT: + case FC_SHORT: alignment = 2; break;
- case RPC_FC_ULONG: - case RPC_FC_LONG: - case RPC_FC_FLOAT: - case RPC_FC_ERROR_STATUS_T: + case FC_ULONG: + case FC_LONG: + case FC_FLOAT: + case FC_ERROR_STATUS_T: /* pointer_size must be 4 if we got here in these two cases */ - case RPC_FC_INT3264: - case RPC_FC_UINT3264: + case FC_INT3264: + case FC_UINT3264: alignment = 4; break;
- case RPC_FC_HYPER: - case RPC_FC_DOUBLE: + case FC_HYPER: + case FC_DOUBLE: alignment = 8; break;
- case RPC_FC_IGNORE: - case RPC_FC_BIND_PRIMITIVE: + case FC_IGNORE: + case FC_BIND_PRIMITIVE: /* no marshalling needed */ return;
@@ -4209,14 +4209,14 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const break; case TGT_STRING: if (phase == PHASE_FREE || pass == PASS_RETURN || - pointer_type != RPC_FC_RP) + pointer_type != FC_RP) { /* strings returned are assumed to be global and hence don't * need freeing */ if (is_declptr(type) && !(phase == PHASE_FREE && pass == PASS_RETURN)) print_phase_function(file, indent, "Pointer", local_var_prefix, phase, var, start_offset); - else if (pointer_type == RPC_FC_RP && phase == PHASE_FREE && + else if (pointer_type == FC_RP && phase == PHASE_FREE && !in_attr && is_conformant_array(type)) { print_file(file, indent, "if (%s%s)\n", local_var_prefix, var->name); @@ -4258,34 +4258,34 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
switch (tc) { - case RPC_FC_SMFARRAY: - case RPC_FC_LGFARRAY: + case FC_SMFARRAY: + case FC_LGFARRAY: array_type = "FixedArray"; break; - case RPC_FC_SMVARRAY: - case RPC_FC_LGVARRAY: + case FC_SMVARRAY: + case FC_LGVARRAY: array_type = "VaryingArray"; break; - case RPC_FC_CARRAY: + case FC_CARRAY: array_type = "ConformantArray"; break; - case RPC_FC_CVARRAY: + case FC_CVARRAY: array_type = "ConformantVaryingArray"; break; - case RPC_FC_BOGUS_ARRAY: + case FC_BOGUS_ARRAY: array_type = "ComplexArray"; break; }
- if (pointer_type != RPC_FC_RP) array_type = "Pointer"; + if (pointer_type != FC_RP) array_type = "Pointer";
- if (phase == PHASE_FREE && pointer_type == RPC_FC_RP) + if (phase == PHASE_FREE && pointer_type == FC_RP) { /* these are all unmarshalled by allocating memory */ - if (tc == RPC_FC_BOGUS_ARRAY || - tc == RPC_FC_CVARRAY || - ((tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY) && in_attr) || - (tc == RPC_FC_CARRAY && !in_attr)) + if (tc == FC_BOGUS_ARRAY || + tc == FC_CVARRAY || + ((tc == FC_SMVARRAY || tc == FC_LGVARRAY) && in_attr) || + (tc == FC_CARRAY && !in_attr)) { if (type_array_is_decl_as_ptr(type) && type->details.array.ptr_tfsoff) { @@ -4336,21 +4336,21 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const case TGT_STRUCT: switch (get_struct_fc(type)) { - case RPC_FC_STRUCT: + case FC_STRUCT: if (phase == PHASE_MARSHAL || phase == PHASE_UNMARSHAL) print_phase_function(file, indent, "SimpleStruct", local_var_prefix, phase, var, start_offset); break; - case RPC_FC_PSTRUCT: + case FC_PSTRUCT: print_phase_function(file, indent, "SimpleStruct", local_var_prefix, phase, var, start_offset); break; - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: + case FC_CSTRUCT: + case FC_CPSTRUCT: print_phase_function(file, indent, "ConformantStruct", local_var_prefix, phase, var, start_offset); break; - case RPC_FC_CVSTRUCT: + case FC_CVSTRUCT: print_phase_function(file, indent, "ConformantVaryingStruct", local_var_prefix, phase, var, start_offset); break; - case RPC_FC_BOGUS_STRUCT: + case FC_BOGUS_STRUCT: print_phase_function(file, indent, "ComplexStruct", local_var_prefix, phase, var, start_offset); break; default: @@ -4373,7 +4373,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const case TGT_POINTER: { const type_t *ref = type_pointer_get_ref(type); - if (pointer_type == RPC_FC_RP) switch (typegen_detect_type(ref, NULL, TDT_ALL_TYPES)) + if (pointer_type == FC_RP) switch (typegen_detect_type(ref, NULL, TDT_ALL_TYPES)) { case TGT_BASIC: print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); @@ -4388,7 +4388,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const case TGT_STRUCT: switch (get_struct_fc(ref)) { - case RPC_FC_STRUCT: + case FC_STRUCT: /* simple structs have known sizes, so don't need a sizing * pass and don't have any memory to free and so don't * need a freeing pass */ @@ -4402,17 +4402,17 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const indent--; } break; - case RPC_FC_PSTRUCT: + case FC_PSTRUCT: type_str = "SimpleStruct"; break; - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: + case FC_CSTRUCT: + case FC_CPSTRUCT: type_str = "ConformantStruct"; break; - case RPC_FC_CVSTRUCT: + case FC_CVSTRUCT: type_str = "ConformantVaryingStruct"; break; - case RPC_FC_BOGUS_STRUCT: + case FC_BOGUS_STRUCT: type_str = "ComplexStruct"; break; default: diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 0387846..a391964 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -24,7 +24,7 @@ #include <stdarg.h> #include <assert.h> #include "guiddef.h" -#include "wine/rpcfc.h" +#include "ndrtypes.h" #include "wine/list.h"
#ifndef UUID_DEFINED