ReactOS  0.4.15-dev-326-g1c504f4
ndr_marshall.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "ndr_misc.h"
#include "rpcndr.h"
#include "ndrtypes.h"
#include "wine/debug.h"
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for ndr_marshall.c:

Go to the source code of this file.

Classes

struct  _NDR_MEMORY_LIST
 
struct  NDR_RANGE
 
struct  _NDR_CSTRUCT_FORMAT
 
struct  NDR_SMFARRAY_FORMAT
 
struct  NDR_LGFARRAY_FORMAT
 

Macros

#define NONAMELESSUNION
 
#define LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32)
 
#define LITTLE_ENDIAN_UINT32_READ(pchar)
 
#define BIG_ENDIAN_UINT32_WRITE(pchar, uint32)
 
#define BIG_ENDIAN_UINT32_READ(pchar)
 
#define NDR_LOCAL_UINT32_WRITE(pchar, uint32)   LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32)
 
#define NDR_LOCAL_UINT32_READ(pchar)   LITTLE_ENDIAN_UINT32_READ(pchar)
 
#define STD_OVERFLOW_CHECK(_Msg)
 
#define NDR_POINTER_ID_BASE   0x20000
 
#define NDR_POINTER_ID(pStubMsg)   (NDR_POINTER_ID_BASE + ((pStubMsg)->UniquePtrCount++) * 4)
 
#define NDR_TABLE_SIZE   128
 
#define NDR_TABLE_MASK   127
 
#define MEML_MAGIC   ('M' << 24 | 'E' << 16 | 'M' << 8 | 'L')
 
#define BASE_TYPE_UNMARSHALL(type)
 
#define USER_MARSHAL_PTR_PREFIX
 
#define RANGE_UNMARSHALL(mem_type, wire_type, format_spec)
 
#define BASE_TYPE_UNMARSHALL(type)
 

Typedefs

typedef struct _NDR_MEMORY_LIST NDR_MEMORY_LIST
 
typedef struct _NDR_CSTRUCT_FORMAT NDR_CSTRUCT_FORMAT
 
typedef struct _NDR_CSTRUCT_FORMAT NDR_CVSTRUCT_FORMAT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static void align_length (ULONG *len, unsigned int align)
 
static void align_pointer (unsigned char **ptr, unsigned int align)
 
static void align_pointer_clear (unsigned char **ptr, unsigned int align)
 
static void align_pointer_offset (unsigned char **ptr, unsigned char *base, unsigned int align)
 
static void align_pointer_offset_clear (unsigned char **ptr, unsigned char *base, unsigned int align)
 
static unsigned char *WINAPI NdrBaseTypeMarshall (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static unsigned char *WINAPI NdrBaseTypeUnmarshall (PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char)
 
static void WINAPI NdrBaseTypeBufferSize (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static void WINAPI NdrBaseTypeFree (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static ULONG WINAPI NdrBaseTypeMemorySize (PMIDL_STUB_MESSAGE, PFORMAT_STRING)
 
static unsigned char *WINAPI NdrContextHandleMarshall (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static void WINAPI NdrContextHandleBufferSize (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static unsigned char *WINAPI NdrContextHandleUnmarshall (PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char)
 
static unsigned char *WINAPI NdrRangeMarshall (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static void WINAPI NdrRangeBufferSize (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static ULONG WINAPI NdrRangeMemorySize (PMIDL_STUB_MESSAGE, PFORMAT_STRING)
 
static void WINAPI NdrRangeFree (PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
 
static ULONG WINAPI NdrByteCountPointerMemorySize (PMIDL_STUB_MESSAGE, PFORMAT_STRING)
 
static unsigned charComplexBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
 
static unsigned charComplexMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
 
static unsigned charComplexUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer, unsigned char fMustAlloc)
 
static ULONG ComplexStructMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
 
static unsigned charComplexFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
 
void *WINAPI NdrAllocate (MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len)
 
static voidNdrAllocateZero (MIDL_STUB_MESSAGE *stubmsg, SIZE_T len)
 
static void NdrFree (MIDL_STUB_MESSAGE *pStubMsg, unsigned char *Pointer)
 
static BOOL IsConformanceOrVariancePresent (PFORMAT_STRING pFormat)
 
static PFORMAT_STRING SkipConformance (const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
 
static PFORMAT_STRING ReadConformance (MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
 
static PFORMAT_STRING ReadVariance (MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue)
 
static void WriteConformance (MIDL_STUB_MESSAGE *pStubMsg)
 
static void WriteVariance (MIDL_STUB_MESSAGE *pStubMsg)
 
static void SizeConformance (MIDL_STUB_MESSAGE *pStubMsg)
 
static void SizeVariance (MIDL_STUB_MESSAGE *pStubMsg)
 
PFORMAT_STRING ComputeConformanceOrVariance (MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG_PTR def, ULONG_PTR *pCount)
 
static PFORMAT_STRING SkipVariance (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
static ULONG safe_multiply (ULONG a, ULONG b)
 
static void safe_buffer_increment (MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
 
static void safe_buffer_length_increment (MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
 
static void safe_copy_from_buffer (MIDL_STUB_MESSAGE *pStubMsg, void *p, ULONG size)
 
static void safe_copy_to_buffer (MIDL_STUB_MESSAGE *pStubMsg, const void *p, ULONG size)
 
static void validate_string_data (MIDL_STUB_MESSAGE *pStubMsg, ULONG bufsize, ULONG esize)
 
static void dump_pointer_attr (unsigned char attr)
 
static void PointerMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, unsigned char *Pointer, PFORMAT_STRING pFormat)
 
static void PointerUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, unsigned char **pPointer, unsigned char *pSrcPointer, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
static void PointerBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Pointer, PFORMAT_STRING pFormat)
 
static ULONG PointerMemorySize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, PFORMAT_STRING pFormat)
 
static void PointerFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Pointer, PFORMAT_STRING pFormat)
 
static unsigned charEmbeddedPointerMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static unsigned charEmbeddedPointerUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pDstBuffer, unsigned char *pSrcMemoryPtrs, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
static void EmbeddedPointerBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static ULONG EmbeddedPointerMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
static void EmbeddedPointerFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrPointerMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrPointerUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrPointerBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrPointerMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrPointerFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
void WINAPI NdrSimpleTypeMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, unsigned char FormatChar)
 
void WINAPI NdrSimpleTypeUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, unsigned char FormatChar)
 
unsigned char *WINAPI NdrSimpleStructMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrSimpleStructUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrSimpleStructBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrSimpleStructMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrSimpleStructFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static void array_compute_and_size_conformance (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static void array_buffer_size (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers)
 
static void array_compute_and_write_conformance (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static void array_write_variance_and_marshall (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers)
 
static ULONG array_read_conformance (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
static ULONG array_read_variance_and_unmarshall (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc, unsigned char fUseBufferMemoryServer, unsigned char fUnmarshall)
 
static void array_memory_size (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, unsigned char fHasPointers)
 
static void array_free (unsigned char fc, PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, unsigned char fHasPointers)
 
unsigned char *WINAPI NdrConformantStringMarshall (MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pszMessage, PFORMAT_STRING pFormat)
 
void WINAPI NdrConformantStringBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrConformantStringMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantStringUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
unsigned char *WINAPI NdrNonConformantStringMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrNonConformantStringUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrNonConformantStringBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrNonConformantStringMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
static ULONG EmbeddedComplexSize (MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
 
static ULONG EmbeddedComplexMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
ULONG ComplexStructSize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrComplexStructMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrComplexStructUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrComplexStructBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrComplexStructMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrComplexStructFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantArrayMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantArrayUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrConformantArrayBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrConformantArrayMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrConformantArrayFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantVaryingArrayMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantVaryingArrayUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrConformantVaryingArrayFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
void WINAPI NdrConformantVaryingArrayBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrConformantVaryingArrayMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrComplexArrayMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrComplexArrayUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrComplexArrayBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrComplexArrayMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrComplexArrayFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static void UserMarshalCB (PMIDL_STUB_MESSAGE pStubMsg, USER_MARSHAL_CB_TYPE cbtype, PFORMAT_STRING pFormat, USER_MARSHAL_CB *umcb)
 
unsigned char *WINAPI NdrUserMarshalMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrUserMarshalUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrUserMarshalBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrUserMarshalMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrUserMarshalFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
RPC_STATUS RPC_ENTRY NdrGetUserMarshalInfo (ULONG *flags, ULONG level, NDR_USER_MARSHAL_INFO *umi)
 
void WINAPI NdrClearOutParameters (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, void *ArgAddr)
 
void WINAPI NdrConvert (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrConvert2 (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, LONG NumberParams)
 
unsigned char *WINAPI NdrConformantStructMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantStructUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrConformantStructBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrConformantStructMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrConformantStructFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantVaryingStructMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrConformantVaryingStructUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrConformantVaryingStructBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrConformantVaryingStructMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrConformantVaryingStructFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrFixedArrayMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrFixedArrayUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrFixedArrayBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrFixedArrayMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrFixedArrayFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrVaryingArrayMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrVaryingArrayUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrVaryingArrayBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrVaryingArrayMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrVaryingArrayFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static ULONG get_discriminant (unsigned char fc, const unsigned char *pMemory)
 
static PFORMAT_STRING get_arm_offset_from_union_arm_selector (PMIDL_STUB_MESSAGE pStubMsg, ULONG discriminant, PFORMAT_STRING pFormat)
 
static unsigned charunion_arm_marshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, ULONG discriminant, PFORMAT_STRING pFormat)
 
static unsigned charunion_arm_unmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, ULONG discriminant, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
static void union_arm_buffer_size (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, ULONG discriminant, PFORMAT_STRING pFormat)
 
static ULONG union_arm_memory_size (PMIDL_STUB_MESSAGE pStubMsg, ULONG discriminant, PFORMAT_STRING pFormat)
 
static void union_arm_free (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, ULONG discriminant, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrEncapsulatedUnionMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrEncapsulatedUnionUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrEncapsulatedUnionBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrEncapsulatedUnionMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrEncapsulatedUnionFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrNonEncapsulatedUnionMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
static LONG unmarshall_discriminant (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING *ppFormat)
 
unsigned char *WINAPI NdrNonEncapsulatedUnionUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrNonEncapsulatedUnionBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrNonEncapsulatedUnionMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrNonEncapsulatedUnionFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrByteCountPointerMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrByteCountPointerUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrByteCountPointerBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
void WINAPI NdrByteCountPointerFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrXmitOrRepAsMarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrXmitOrRepAsUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrXmitOrRepAsBufferSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
ULONG WINAPI NdrXmitOrRepAsMemorySize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrXmitOrRepAsFree (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
unsigned char *WINAPI NdrRangeUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, unsigned char **ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
 
void WINAPI NdrClientContextMarshall (PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck)
 
void WINAPI NdrClientContextUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT *pContextHandle, RPC_BINDING_HANDLE BindHandle)
 
void WINAPI NdrServerContextMarshall (PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine)
 
NDR_SCONTEXT WINAPI NdrServerContextUnmarshall (PMIDL_STUB_MESSAGE pStubMsg)
 
void WINAPI NdrContextHandleSize (PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
 
NDR_SCONTEXT WINAPI NdrContextHandleInitialize (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrServerContextNewMarshall (PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine, PFORMAT_STRING pFormat)
 
NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall (PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
 
void WINAPI NdrCorrelationInitialize (PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags)
 
void WINAPI NdrCorrelationPass (PMIDL_STUB_MESSAGE pStubMsg)
 
void WINAPI NdrCorrelationFree (PMIDL_STUB_MESSAGE pStubMsg)
 

Variables

const NDR_MARSHALL NdrMarshaller [NDR_TABLE_SIZE]
 
const NDR_UNMARSHALL NdrUnmarshaller [NDR_TABLE_SIZE]
 
const NDR_BUFFERSIZE NdrBufferSizer [NDR_TABLE_SIZE]
 
const NDR_MEMORYSIZE NdrMemorySizer [NDR_TABLE_SIZE]
 
const NDR_FREE NdrFreer [NDR_TABLE_SIZE]
 

Macro Definition Documentation

◆ BASE_TYPE_UNMARSHALL [1/2]

#define BASE_TYPE_UNMARSHALL (   type)
Value:
align_pointer(&pStubMsg->Buffer, sizeof(type)); \
TRACE("pMemory: %p\n", pMemory); \
*(type *)pMemory = *(type *)pStubMsg->Buffer; \
pStubMsg->Buffer += sizeof(type);
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void align_pointer(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:97

◆ BASE_TYPE_UNMARSHALL [2/2]

#define BASE_TYPE_UNMARSHALL (   type)
Value:
do { \
align_pointer(&pStubMsg->Buffer, sizeof(type)); \
if (!fMustAlloc && !pStubMsg->IsClient && !*ppMemory) \
{ \
*ppMemory = pStubMsg->Buffer; \
TRACE("*ppMemory: %p\n", *ppMemory); \
safe_buffer_increment(pStubMsg, sizeof(type)); \
} \
else \
{ \
if (fMustAlloc) \
*ppMemory = NdrAllocate(pStubMsg, sizeof(type)); \
TRACE("*ppMemory: %p\n", *ppMemory); \
safe_copy_from_buffer(pStubMsg, *ppMemory, sizeof(type)); \
} \
} while (0)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void *WINAPI NdrAllocate(MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len)
Definition: ndr_marshall.c:419

◆ BIG_ENDIAN_UINT32_READ

#define BIG_ENDIAN_UINT32_READ (   pchar)
Value:
MAKEWORD(*((pchar)+3), *((pchar)+2)), \
MAKEWORD(*((pchar)+1), *(pchar))))
#define MAKEWORD(a, b)
Definition: typedefs.h:247
#define MAKELONG(a, b)
Definition: typedefs.h:248

Definition at line 75 of file ndr_marshall.c.

◆ BIG_ENDIAN_UINT32_WRITE

#define BIG_ENDIAN_UINT32_WRITE (   pchar,
  uint32 
)
Value:
(*((pchar)+3) = LOBYTE(LOWORD(uint32)), \
*((pchar)+2) = HIBYTE(LOWORD(uint32)), \
*((pchar)+1) = LOBYTE(HIWORD(uint32)), \
*(pchar) = HIBYTE(HIWORD(uint32)))
#define LOBYTE(W)
Definition: jmemdos.c:487
unsigned int uint32
Definition: types.h:32
#define HIBYTE(W)
Definition: jmemdos.c:486
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82

Definition at line 69 of file ndr_marshall.c.

◆ LITTLE_ENDIAN_UINT32_READ

#define LITTLE_ENDIAN_UINT32_READ (   pchar)
Value:
MAKEWORD(*(pchar), *((pchar)+1)), \
MAKEWORD(*((pchar)+2), *((pchar)+3))))
#define MAKEWORD(a, b)
Definition: typedefs.h:247
#define MAKELONG(a, b)
Definition: typedefs.h:248

Definition at line 63 of file ndr_marshall.c.

◆ LITTLE_ENDIAN_UINT32_WRITE

#define LITTLE_ENDIAN_UINT32_WRITE (   pchar,
  uint32 
)
Value:
(*(pchar) = LOBYTE(LOWORD(uint32)), \
*((pchar)+1) = HIBYTE(LOWORD(uint32)), \
*((pchar)+2) = LOBYTE(HIWORD(uint32)), \
*((pchar)+3) = HIBYTE(HIWORD(uint32)))
#define LOBYTE(W)
Definition: jmemdos.c:487
unsigned int uint32
Definition: types.h:32
#define HIBYTE(W)
Definition: jmemdos.c:486
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82

Definition at line 57 of file ndr_marshall.c.

◆ MEML_MAGIC

#define MEML_MAGIC   ('M' << 24 | 'E' << 16 | 'M' << 8 | 'L')

Definition at line 400 of file ndr_marshall.c.

◆ NDR_LOCAL_UINT32_READ

#define NDR_LOCAL_UINT32_READ (   pchar)    LITTLE_ENDIAN_UINT32_READ(pchar)

Definition at line 88 of file ndr_marshall.c.

◆ NDR_LOCAL_UINT32_WRITE

#define NDR_LOCAL_UINT32_WRITE (   pchar,
  uint32 
)    LITTLE_ENDIAN_UINT32_WRITE(pchar, uint32)

Definition at line 86 of file ndr_marshall.c.

◆ NDR_POINTER_ID

#define NDR_POINTER_ID (   pStubMsg)    (NDR_POINTER_ID_BASE + ((pStubMsg)->UniquePtrCount++) * 4)

Definition at line 130 of file ndr_marshall.c.

◆ NDR_POINTER_ID_BASE

#define NDR_POINTER_ID_BASE   0x20000

Definition at line 129 of file ndr_marshall.c.

◆ NDR_TABLE_MASK

#define NDR_TABLE_MASK   127

Definition at line 132 of file ndr_marshall.c.

◆ NDR_TABLE_SIZE

#define NDR_TABLE_SIZE   128

Definition at line 131 of file ndr_marshall.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 36 of file ndr_marshall.c.

◆ RANGE_UNMARSHALL

#define RANGE_UNMARSHALL (   mem_type,
  wire_type,
  format_spec 
)
Value:
do \
{ \
align_pointer(&pStubMsg->Buffer, sizeof(wire_type)); \
if (!fMustAlloc && !*ppMemory) \
fMustAlloc = TRUE; \
if (fMustAlloc) \
*ppMemory = NdrAllocate(pStubMsg, sizeof(mem_type)); \
if (pStubMsg->Buffer + sizeof(wire_type) > pStubMsg->BufferEnd) \
{ \
ERR("buffer overflow - Buffer = %p, BufferEnd = %p\n", \
pStubMsg->Buffer, (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength); \
RpcRaiseException(RPC_X_BAD_STUB_DATA); \
} \
if ((*(wire_type *)pStubMsg->Buffer < (mem_type)pRange->low_value) || \
(*(wire_type *)pStubMsg->Buffer > (mem_type)pRange->high_value)) \
{ \
ERR("value exceeded bounds: " format_spec ", low: " format_spec ", high: " format_spec "\n", \
*(wire_type *)pStubMsg->Buffer, (mem_type)pRange->low_value, \
(mem_type)pRange->high_value); \
RpcRaiseException(RPC_S_INVALID_BOUND); \
return NULL; \
} \
TRACE("*ppMemory: %p\n", *ppMemory); \
**(mem_type **)ppMemory = *(wire_type *)pStubMsg->Buffer; \
pStubMsg->Buffer += sizeof(wire_type); \
} while (0)
#define TRUE
Definition: types.h:120
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
void *WINAPI NdrAllocate(MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len)
Definition: ndr_marshall.c:419
smooth NULL
Definition: ftsmooth.c:416
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090

◆ STD_OVERFLOW_CHECK

#define STD_OVERFLOW_CHECK (   _Msg)
Value:
do { \
TRACE("buffer=%d/%d\n", (ULONG)(_Msg->Buffer - (unsigned char *)_Msg->RpcMsg->Buffer), _Msg->BufferLength); \
if (_Msg->Buffer > (unsigned char *)_Msg->RpcMsg->Buffer + _Msg->BufferLength) \
ERR("buffer overflow %d bytes\n", (ULONG)(_Msg->Buffer - ((unsigned char *)_Msg->RpcMsg->Buffer + _Msg->BufferLength))); \
} while (0)
unsigned int ULONG
Definition: retypes.h:1

Definition at line 123 of file ndr_marshall.c.

◆ USER_MARSHAL_PTR_PREFIX

#define USER_MARSHAL_PTR_PREFIX
Value:
( (DWORD)'U' | ( (DWORD)'s' << 8 ) | \
( (DWORD)'e' << 16 ) | ( (DWORD)'r' << 24 ) )
#define DWORD
Definition: nt_native.h:44
unsigned long DWORD
Definition: ntddk_ex.h:95

Definition at line 4389 of file ndr_marshall.c.

Typedef Documentation

◆ NDR_CSTRUCT_FORMAT

◆ NDR_CVSTRUCT_FORMAT

◆ NDR_MEMORY_LIST

Function Documentation

◆ align_length()

◆ align_pointer()

◆ align_pointer_clear()

static void align_pointer_clear ( unsigned char **  ptr,
unsigned int  align 
)
inlinestatic

◆ align_pointer_offset()

static void align_pointer_offset ( unsigned char **  ptr,
unsigned char base,
unsigned int  align 
)
inlinestatic

Definition at line 110 of file ndr_marshall.c.

111 {
112  ULONG_PTR mask = align - 1;
113  *ptr = base + (((ULONG_PTR)(*ptr - base) + mask) & ~mask);
114 }
int align(int length, int align)
Definition: dsound8.c:36
uint32_t ULONG_PTR
Definition: typedefs.h:64
GLenum GLint GLuint mask
Definition: glext.h:6028
static PVOID ptr
Definition: dispmode.c:27
#define ULONG_PTR
Definition: config.h:101

Referenced by ComplexBufferSize(), ComplexFree(), and ComplexMarshall().

◆ align_pointer_offset_clear()

static void align_pointer_offset_clear ( unsigned char **  ptr,
unsigned char base,
unsigned int  align 
)
inlinestatic

Definition at line 116 of file ndr_marshall.c.

117 {
118  ULONG_PTR mask = align - 1;
119  memset( *ptr, 0, (align - (ULONG_PTR)(*ptr - base)) & mask );
120  *ptr = base + (((ULONG_PTR)(*ptr - base) + mask) & ~mask);
121 }
int align(int length, int align)
Definition: dsound8.c:36
uint32_t ULONG_PTR
Definition: typedefs.h:64
GLenum GLint GLuint mask
Definition: glext.h:6028
static PVOID ptr
Definition: dispmode.c:27
#define ULONG_PTR
Definition: config.h:101
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ComplexUnmarshall().

◆ array_buffer_size()

static void array_buffer_size ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
unsigned char  fHasPointers 
)
inlinestatic

Definition at line 1896 of file ndr_marshall.c.

1899 {
1900  DWORD i, size;
1901  DWORD esize;
1902  unsigned char alignment;
1903 
1904  switch (fc)
1905  {
1906  case FC_CARRAY:
1907  esize = *(const WORD*)(pFormat+2);
1908  alignment = pFormat[1] + 1;
1909 
1910  pFormat = SkipConformance(pStubMsg, pFormat + 4);
1911 
1912  align_length(&pStubMsg->BufferLength, alignment);
1913 
1914  size = safe_multiply(esize, pStubMsg->MaxCount);
1915  /* conformance value plus array */
1917 
1918  if (fHasPointers)
1919  EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat);
1920  break;
1921  case FC_CVARRAY:
1922  esize = *(const WORD*)(pFormat+2);
1923  alignment = pFormat[1] + 1;
1924 
1925  pFormat = SkipConformance(pStubMsg, pFormat + 4);
1926  pFormat = SkipVariance(pStubMsg, pFormat);
1927 
1928  SizeVariance(pStubMsg);
1929 
1930  align_length(&pStubMsg->BufferLength, alignment);
1931 
1932  size = safe_multiply(esize, pStubMsg->ActualCount);
1934 
1935  if (fHasPointers)
1936  EmbeddedPointerBufferSize(pStubMsg, pMemory, pFormat);
1937  break;
1938  case FC_C_CSTRING:
1939  case FC_C_WSTRING:
1940  if (fc == FC_C_CSTRING)
1941  esize = 1;
1942  else
1943  esize = 2;
1944 
1945  SizeVariance(pStubMsg);
1946 
1947  size = safe_multiply(esize, pStubMsg->ActualCount);
1949  break;
1950  case FC_BOGUS_ARRAY:
1951  alignment = pFormat[1] + 1;
1952  pFormat = SkipConformance(pStubMsg, pFormat + 4);
1953  if (IsConformanceOrVariancePresent(pFormat)) SizeVariance(pStubMsg);
1954  pFormat = SkipVariance(pStubMsg, pFormat);
1955 
1956  align_length(&pStubMsg->BufferLength, alignment);
1957 
1958  size = pStubMsg->ActualCount;
1959  for (i = 0; i < size; i++)
1960  pMemory = ComplexBufferSize(pStubMsg, pMemory, pFormat, NULL);
1961  break;
1962  default:
1963  ERR("unknown array format 0x%x\n", fc);
1965  }
1966 }
static void SizeVariance(MIDL_STUB_MESSAGE *pStubMsg)
Definition: ndr_marshall.c:548
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static ULONG safe_multiply(ULONG a, ULONG b)
Definition: ndr_marshall.c:702
static PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:695
static void align_length(ULONG *len, unsigned int align)
Definition: ndr_marshall.c:92
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
ULONG_PTR MaxCount
Definition: rpcndr.h:221
GLsizeiptr size
Definition: glext.h:5919
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
static void safe_buffer_length_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:721
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
ULONG BufferLength
Definition: rpcndr.h:207
static unsigned char * ComplexBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
#define ERR(fmt,...)
Definition: debug.h:110
static void EmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090

Referenced by NdrComplexArrayBufferSize(), NdrComplexStructBufferSize(), NdrConformantArrayBufferSize(), NdrConformantStringBufferSize(), NdrConformantVaryingArrayBufferSize(), and NdrConformantVaryingStructBufferSize().

◆ array_compute_and_size_conformance()

static void array_compute_and_size_conformance ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat 
)
inlinestatic

Definition at line 1846 of file ndr_marshall.c.

1849 {
1850  DWORD count;
1851 
1852  switch (fc)
1853  {
1854  case FC_CARRAY:
1855  ComputeConformance(pStubMsg, pMemory, pFormat+4, 0);
1856  SizeConformance(pStubMsg);
1857  break;
1858  case FC_CVARRAY:
1859  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, 0);
1860  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0);
1861  SizeConformance(pStubMsg);
1862  break;
1863  case FC_C_CSTRING:
1864  case FC_C_WSTRING:
1865  if (fc == FC_C_CSTRING)
1866  {
1867  TRACE("string=%s\n", debugstr_a((const char *)pMemory));
1868  pStubMsg->ActualCount = strlen((const char *)pMemory)+1;
1869  }
1870  else
1871  {
1872  TRACE("string=%s\n", debugstr_w((LPCWSTR)pMemory));
1873  pStubMsg->ActualCount = lstrlenW((LPCWSTR)pMemory)+1;
1874  }
1875 
1876  if (pFormat[1] == FC_STRING_SIZED)
1877  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0);
1878  else
1879  pStubMsg->MaxCount = pStubMsg->ActualCount;
1880 
1881  SizeConformance(pStubMsg);
1882  break;
1883  case FC_BOGUS_ARRAY:
1884  count = *(const WORD *)(pFormat + 2);
1885  pFormat += 4;
1886  if (IsConformanceOrVariancePresent(pFormat)) SizeConformance(pStubMsg);
1887  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, count);
1888  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
1889  break;
1890  default:
1891  ERR("unknown array format 0x%x\n", fc);
1893  }
1894 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static PFORMAT_STRING ComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:37
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
#define lstrlenW
Definition: compat.h:416
#define debugstr_w
Definition: kernel32.h:32
ULONG ActualCount
Definition: rpcndr.h:223
static PFORMAT_STRING ComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:42
#define TRACE(s)
Definition: solgame.cpp:4
ULONG_PTR MaxCount
Definition: rpcndr.h:221
#define debugstr_a
Definition: kernel32.h:31
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
static void SizeConformance(MIDL_STUB_MESSAGE *pStubMsg)
Definition: ndr_marshall.c:539
#define ERR(fmt,...)
Definition: debug.h:110
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090

Referenced by NdrComplexArrayBufferSize(), NdrComplexStructBufferSize(), NdrConformantArrayBufferSize(), NdrConformantStringBufferSize(), NdrConformantVaryingArrayBufferSize(), and NdrConformantVaryingStructBufferSize().

◆ array_compute_and_write_conformance()

static void array_compute_and_write_conformance ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat 
)
inlinestatic

Definition at line 1968 of file ndr_marshall.c.

1971 {
1972  ULONG def;
1973  BOOL conformance_present;
1974 
1975  switch (fc)
1976  {
1977  case FC_CARRAY:
1978  ComputeConformance(pStubMsg, pMemory, pFormat+4, 0);
1979  WriteConformance(pStubMsg);
1980  break;
1981  case FC_CVARRAY:
1982  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, 0);
1983  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0);
1984  WriteConformance(pStubMsg);
1985  break;
1986  case FC_C_CSTRING:
1987  case FC_C_WSTRING:
1988  if (fc == FC_C_CSTRING)
1989  {
1990  TRACE("string=%s\n", debugstr_a((const char *)pMemory));
1991  pStubMsg->ActualCount = strlen((const char *)pMemory)+1;
1992  }
1993  else
1994  {
1995  TRACE("string=%s\n", debugstr_w((LPCWSTR)pMemory));
1996  pStubMsg->ActualCount = lstrlenW((LPCWSTR)pMemory)+1;
1997  }
1998  if (pFormat[1] == FC_STRING_SIZED)
1999  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0);
2000  else
2001  pStubMsg->MaxCount = pStubMsg->ActualCount;
2002  pStubMsg->Offset = 0;
2003  WriteConformance(pStubMsg);
2004  break;
2005  case FC_BOGUS_ARRAY:
2006  def = *(const WORD *)(pFormat + 2);
2007  pFormat += 4;
2008  conformance_present = IsConformanceOrVariancePresent(pFormat);
2009  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat, def);
2010  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
2011  if (conformance_present) WriteConformance(pStubMsg);
2012  break;
2013  default:
2014  ERR("unknown array format 0x%x\n", fc);
2016  }
2017 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static PFORMAT_STRING ComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:37
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static void WriteConformance(MIDL_STUB_MESSAGE *pStubMsg)
Definition: ndr_marshall.c:517
#define lstrlenW
Definition: compat.h:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
ULONG ActualCount
Definition: rpcndr.h:223
static PFORMAT_STRING ComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:42
#define TRACE(s)
Definition: solgame.cpp:4
ULONG_PTR MaxCount
Definition: rpcndr.h:221
#define debugstr_a
Definition: kernel32.h:31
unsigned short WORD
Definition: ntddk_ex.h:93
LPFOR_CONTEXT fc
Definition: for.c:53
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
#define ERR(fmt,...)
Definition: debug.h:110
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
unsigned int ULONG
Definition: retypes.h:1

Referenced by NdrComplexArrayMarshall(), NdrComplexStructMarshall(), NdrConformantArrayMarshall(), NdrConformantStringMarshall(), NdrConformantVaryingArrayMarshall(), and NdrConformantVaryingStructMarshall().

◆ array_free()

static void array_free ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
unsigned char  fHasPointers 
)
inlinestatic

Definition at line 2401 of file ndr_marshall.c.

2404 {
2405  DWORD i, count;
2406 
2407  switch (fc)
2408  {
2409  case FC_CARRAY:
2410  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat+4, 0);
2411  if (fHasPointers)
2412  EmbeddedPointerFree(pStubMsg, pMemory, pFormat);
2413  break;
2414  case FC_CVARRAY:
2415  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat+4, 0);
2416  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, 0);
2417  if (fHasPointers)
2418  EmbeddedPointerFree(pStubMsg, pMemory, pFormat);
2419  break;
2420  case FC_C_CSTRING:
2421  case FC_C_WSTRING:
2422  /* No embedded pointers so nothing to do */
2423  break;
2424  case FC_BOGUS_ARRAY:
2425  count = *(const WORD *)(pFormat + 2);
2426  pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 4, count);
2427  pFormat = ComputeVariance(pStubMsg, pMemory, pFormat, pStubMsg->MaxCount);
2428 
2429  count = pStubMsg->ActualCount;
2430  for (i = 0; i < count; i++)
2431  pMemory = ComplexFree(pStubMsg, pMemory, pFormat, NULL);
2432  break;
2433  default:
2434  ERR("unknown array format 0x%x\n", fc);
2436  }
2437 }
static PFORMAT_STRING ComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:37
GLuint GLuint GLsizei count
Definition: gl.h:1545
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static unsigned char * ComplexFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void EmbeddedPointerFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
static PFORMAT_STRING ComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
Definition: ndr_misc.h:42
ULONG_PTR MaxCount
Definition: rpcndr.h:221
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
#define ERR(fmt,...)
Definition: debug.h:110
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090

Referenced by NdrComplexStructFree(), NdrConformantArrayFree(), NdrConformantVaryingArrayFree(), and NdrConformantVaryingStructFree().

◆ array_memory_size()

static void array_memory_size ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
PFORMAT_STRING  pFormat,
unsigned char  fHasPointers 
)
inlinestatic

Definition at line 2300 of file ndr_marshall.c.

2303 {
2304  ULONG i, count, SavedMemorySize;
2305  ULONG bufsize, memsize;
2306  DWORD esize;
2307  unsigned char alignment;
2308 
2309  switch (fc)
2310  {
2311  case FC_CARRAY:
2312  esize = *(const WORD*)(pFormat+2);
2313  alignment = pFormat[1] + 1;
2314 
2315  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2316 
2317  bufsize = memsize = safe_multiply(esize, pStubMsg->MaxCount);
2318  pStubMsg->MemorySize += memsize;
2319 
2320  align_pointer(&pStubMsg->Buffer, alignment);
2321  if (fHasPointers)
2322  pStubMsg->BufferMark = pStubMsg->Buffer;
2323  safe_buffer_increment(pStubMsg, bufsize);
2324 
2325  if (fHasPointers)
2326  EmbeddedPointerMemorySize(pStubMsg, pFormat);
2327  break;
2328  case FC_CVARRAY:
2329  esize = *(const WORD*)(pFormat+2);
2330  alignment = pFormat[1] + 1;
2331 
2332  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2333 
2334  pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount);
2335 
2336  bufsize = safe_multiply(esize, pStubMsg->ActualCount);
2337  memsize = safe_multiply(esize, pStubMsg->MaxCount);
2338  pStubMsg->MemorySize += memsize;
2339 
2340  align_pointer(&pStubMsg->Buffer, alignment);
2341  if (fHasPointers)
2342  pStubMsg->BufferMark = pStubMsg->Buffer;
2343  safe_buffer_increment(pStubMsg, bufsize);
2344 
2345  if (fHasPointers)
2346  EmbeddedPointerMemorySize(pStubMsg, pFormat);
2347  break;
2348  case FC_C_CSTRING:
2349  case FC_C_WSTRING:
2350  if (fc == FC_C_CSTRING)
2351  esize = 1;
2352  else
2353  esize = 2;
2354 
2355  ReadVariance(pStubMsg, NULL, pStubMsg->MaxCount);
2356 
2357  if (pFormat[1] != FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount))
2358  {
2359  ERR("buffer size %d must equal memory size %ld for non-sized conformant strings\n",
2360  pStubMsg->ActualCount, pStubMsg->MaxCount);
2362  }
2363  if (pStubMsg->Offset)
2364  {
2365  ERR("conformant strings can't have Offset (%d)\n", pStubMsg->Offset);
2367  }
2368 
2369  memsize = safe_multiply(esize, pStubMsg->MaxCount);
2370  bufsize = safe_multiply(esize, pStubMsg->ActualCount);
2371 
2372  validate_string_data(pStubMsg, bufsize, esize);
2373 
2374  safe_buffer_increment(pStubMsg, bufsize);
2375  pStubMsg->MemorySize += memsize;
2376  break;
2377  case FC_BOGUS_ARRAY:
2378  alignment = pFormat[1] + 1;
2379  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2380  pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount);
2381 
2382  align_pointer(&pStubMsg->Buffer, alignment);
2383 
2384  SavedMemorySize = pStubMsg->MemorySize;
2385 
2386  esize = ComplexStructSize(pStubMsg, pFormat);
2387  memsize = safe_multiply(pStubMsg->MaxCount, esize);
2388 
2389  count = pStubMsg->ActualCount;
2390  for (i = 0; i < count; i++)
2391  ComplexStructMemorySize(pStubMsg, pFormat, NULL);
2392 
2393  pStubMsg->MemorySize = SavedMemorySize + memsize;
2394  break;
2395  default:
2396  ERR("unknown array format 0x%x\n", fc);
2398  }
2399 }
unsigned char * BufferMark
Definition: rpcndr.h:206
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
static PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue)
Definition: ndr_marshall.c:484
ULONG MemorySize
Definition: rpcndr.h:208
GLuint GLuint GLsizei count
Definition: gl.h:1545
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static ULONG safe_multiply(ULONG a, ULONG b)
Definition: ndr_marshall.c:702
unsigned char * Buffer
Definition: rpcndr.h:203
static ULONG EmbeddedPointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
static void align_pointer(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:97
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
ULONG_PTR MaxCount
Definition: rpcndr.h:221
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
static void validate_string_data(MIDL_STUB_MESSAGE *pStubMsg, ULONG bufsize, ULONG esize)
Definition: ndr_marshall.c:766
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
#define ERR(fmt,...)
Definition: debug.h:110
static ULONG ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
static void safe_buffer_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:713
ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
unsigned int ULONG
Definition: retypes.h:1

Referenced by NdrComplexArrayMemorySize(), NdrComplexStructMemorySize(), NdrConformantArrayMemorySize(), NdrConformantStringMemorySize(), NdrConformantVaryingArrayMemorySize(), and NdrConformantVaryingStructMemorySize().

◆ array_read_conformance()

static ULONG array_read_conformance ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
PFORMAT_STRING  pFormat 
)
inlinestatic

Definition at line 2095 of file ndr_marshall.c.

2097 {
2098  DWORD def, esize;
2099 
2100  switch (fc)
2101  {
2102  case FC_CARRAY:
2103  esize = *(const WORD*)(pFormat+2);
2104  pFormat = ReadConformance(pStubMsg, pFormat+4);
2105  return safe_multiply(esize, pStubMsg->MaxCount);
2106  case FC_CVARRAY:
2107  esize = *(const WORD*)(pFormat+2);
2108  pFormat = ReadConformance(pStubMsg, pFormat+4);
2109  return safe_multiply(esize, pStubMsg->MaxCount);
2110  case FC_C_CSTRING:
2111  case FC_C_WSTRING:
2112  if (fc == FC_C_CSTRING)
2113  esize = 1;
2114  else
2115  esize = 2;
2116 
2117  if (pFormat[1] == FC_STRING_SIZED)
2118  ReadConformance(pStubMsg, pFormat + 2);
2119  else
2120  ReadConformance(pStubMsg, NULL);
2121  return safe_multiply(esize, pStubMsg->MaxCount);
2122  case FC_BOGUS_ARRAY:
2123  def = *(const WORD *)(pFormat + 2);
2124  pFormat += 4;
2125  if (IsConformanceOrVariancePresent(pFormat)) pFormat = ReadConformance(pStubMsg, pFormat);
2126  else
2127  {
2128  pStubMsg->MaxCount = def;
2129  pFormat = SkipConformance( pStubMsg, pFormat );
2130  }
2131  pFormat = SkipVariance( pStubMsg, pFormat );
2132 
2133  esize = ComplexStructSize(pStubMsg, pFormat);
2134  return safe_multiply(pStubMsg->MaxCount, esize);
2135  default:
2136  ERR("unknown array format 0x%x\n", fc);
2138  }
2139 }
static PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:473
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static ULONG safe_multiply(ULONG a, ULONG b)
Definition: ndr_marshall.c:702
static PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:695
smooth NULL
Definition: ftsmooth.c:416
ULONG_PTR MaxCount
Definition: rpcndr.h:221
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
#define ERR(fmt,...)
Definition: debug.h:110
ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090

Referenced by NdrComplexArrayMemorySize(), NdrComplexArrayUnmarshall(), NdrComplexStructMemorySize(), NdrComplexStructUnmarshall(), NdrConformantArrayMemorySize(), NdrConformantArrayUnmarshall(), NdrConformantStringMemorySize(), NdrConformantStringUnmarshall(), NdrConformantVaryingArrayMemorySize(), NdrConformantVaryingArrayUnmarshall(), NdrConformantVaryingStructMemorySize(), and NdrConformantVaryingStructUnmarshall().

◆ array_read_variance_and_unmarshall()

static ULONG array_read_variance_and_unmarshall ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char **  ppMemory,
PFORMAT_STRING  pFormat,
unsigned char  fMustAlloc,
unsigned char  fUseBufferMemoryServer,
unsigned char  fUnmarshall 
)
inlinestatic

Definition at line 2141 of file ndr_marshall.c.

2145 {
2146  ULONG bufsize, memsize;
2147  WORD esize;
2148  unsigned char alignment;
2149  unsigned char *saved_buffer, *pMemory;
2150  ULONG i, offset, count;
2151 
2152  switch (fc)
2153  {
2154  case FC_CARRAY:
2155  esize = *(const WORD*)(pFormat+2);
2156  alignment = pFormat[1] + 1;
2157 
2158  bufsize = memsize = safe_multiply(esize, pStubMsg->MaxCount);
2159 
2160  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2161 
2162  align_pointer(&pStubMsg->Buffer, alignment);
2163 
2164  if (fUnmarshall)
2165  {
2166  if (fMustAlloc)
2167  *ppMemory = NdrAllocateZero(pStubMsg, memsize);
2168  else
2169  {
2170  if (fUseBufferMemoryServer && !pStubMsg->IsClient && !*ppMemory)
2171  /* for servers, we just point straight into the RPC buffer */
2172  *ppMemory = pStubMsg->Buffer;
2173  }
2174 
2175  saved_buffer = pStubMsg->Buffer;
2176  safe_buffer_increment(pStubMsg, bufsize);
2177 
2178  pStubMsg->BufferMark = saved_buffer;
2179  EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc);
2180 
2181  TRACE("copying %p to %p\n", saved_buffer, *ppMemory);
2182  if (*ppMemory != saved_buffer)
2183  memcpy(*ppMemory, saved_buffer, bufsize);
2184  }
2185  return bufsize;
2186  case FC_CVARRAY:
2187  esize = *(const WORD*)(pFormat+2);
2188  alignment = pFormat[1] + 1;
2189 
2190  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2191 
2192  pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount);
2193 
2194  align_pointer(&pStubMsg->Buffer, alignment);
2195 
2196  bufsize = safe_multiply(esize, pStubMsg->ActualCount);
2197  memsize = safe_multiply(esize, pStubMsg->MaxCount);
2198 
2199  if (fUnmarshall)
2200  {
2201  offset = pStubMsg->Offset;
2202 
2203  if (!fMustAlloc && !*ppMemory)
2204  fMustAlloc = TRUE;
2205  if (fMustAlloc)
2206  *ppMemory = NdrAllocateZero(pStubMsg, memsize);
2207  saved_buffer = pStubMsg->Buffer;
2208  safe_buffer_increment(pStubMsg, bufsize);
2209 
2210  pStubMsg->BufferMark = saved_buffer;
2211  EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat,
2212  fMustAlloc);
2213 
2214  memcpy(*ppMemory + offset, saved_buffer, bufsize);
2215  }
2216  return bufsize;
2217  case FC_C_CSTRING:
2218  case FC_C_WSTRING:
2219  if (fc == FC_C_CSTRING)
2220  esize = 1;
2221  else
2222  esize = 2;
2223 
2224  ReadVariance(pStubMsg, NULL, pStubMsg->MaxCount);
2225 
2226  if (pFormat[1] != FC_STRING_SIZED && (pStubMsg->MaxCount != pStubMsg->ActualCount))
2227  {
2228  ERR("buffer size %d must equal memory size %ld for non-sized conformant strings\n",
2229  pStubMsg->ActualCount, pStubMsg->MaxCount);
2231  }
2232  if (pStubMsg->Offset)
2233  {
2234  ERR("conformant strings can't have Offset (%d)\n", pStubMsg->Offset);
2236  }
2237 
2238  memsize = safe_multiply(esize, pStubMsg->MaxCount);
2239  bufsize = safe_multiply(esize, pStubMsg->ActualCount);
2240 
2241  validate_string_data(pStubMsg, bufsize, esize);
2242 
2243  if (fUnmarshall)
2244  {
2245  if (fMustAlloc)
2246  *ppMemory = NdrAllocate(pStubMsg, memsize);
2247  else
2248  {
2249  if (fUseBufferMemoryServer && !pStubMsg->IsClient &&
2250  !*ppMemory && (pStubMsg->MaxCount == pStubMsg->ActualCount))
2251  /* if the data in the RPC buffer is big enough, we just point
2252  * straight into it */
2253  *ppMemory = pStubMsg->Buffer;
2254  else if (!*ppMemory)
2255  *ppMemory = NdrAllocate(pStubMsg, memsize);
2256  }
2257 
2258  if (*ppMemory == pStubMsg->Buffer)
2259  safe_buffer_increment(pStubMsg, bufsize);
2260  else
2261  safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
2262 
2263  if (*pFormat == FC_C_CSTRING)
2264  TRACE("string=%s\n", debugstr_a((char*)*ppMemory));
2265  else
2266  TRACE("string=%s\n", debugstr_w((LPWSTR)*ppMemory));
2267  }
2268  return bufsize;
2269 
2270  case FC_BOGUS_ARRAY:
2271  alignment = pFormat[1] + 1;
2272  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2273  pFormat = ReadVariance(pStubMsg, pFormat, pStubMsg->MaxCount);
2274 
2275  esize = ComplexStructSize(pStubMsg, pFormat);
2276  memsize = safe_multiply(esize, pStubMsg->MaxCount);
2277 
2278  assert( fUnmarshall );
2279 
2280  if (!fMustAlloc && !*ppMemory)
2281  fMustAlloc = TRUE;
2282  if (fMustAlloc)
2283  *ppMemory = NdrAllocateZero(pStubMsg, memsize);
2284 
2285  align_pointer(&pStubMsg->Buffer, alignment);
2286  saved_buffer = pStubMsg->Buffer;
2287 
2288  pMemory = *ppMemory;
2289  count = pStubMsg->ActualCount;
2290  for (i = 0; i < count; i++)
2291  pMemory = ComplexUnmarshall(pStubMsg, pMemory, pFormat, NULL, fMustAlloc);
2292  return pStubMsg->Buffer - saved_buffer;
2293 
2294  default:
2295  ERR("unknown array format 0x%x\n", fc);
2297  }
2298 }
unsigned char * BufferMark
Definition: rpcndr.h:206
#define TRUE
Definition: types.h:120
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pDstBuffer, unsigned char *pSrcMemoryPtrs, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
static PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, ULONG MaxValue)
Definition: ndr_marshall.c:484
GLuint GLuint GLsizei count
Definition: gl.h:1545
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static ULONG safe_multiply(ULONG a, ULONG b)
Definition: ndr_marshall.c:702
unsigned char * Buffer
Definition: rpcndr.h:203
GLintptr offset
Definition: glext.h:5920
#define assert(x)
Definition: debug.h:53
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
static void align_pointer(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:97
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void *WINAPI NdrAllocate(MIDL_STUB_MESSAGE *pStubMsg, SIZE_T len)
Definition: ndr_marshall.c:419
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
#define TRACE(s)
Definition: solgame.cpp:4
ULONG_PTR MaxCount
Definition: rpcndr.h:221
#define debugstr_a
Definition: kernel32.h:31
unsigned short WORD
Definition: ntddk_ex.h:93
LPFOR_CONTEXT fc
Definition: for.c:53
static void validate_string_data(MIDL_STUB_MESSAGE *pStubMsg, ULONG bufsize, ULONG esize)
Definition: ndr_marshall.c:766
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
static void safe_copy_from_buffer(MIDL_STUB_MESSAGE *pStubMsg, void *p, ULONG size)
Definition: ndr_marshall.c:734
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer, unsigned char fMustAlloc)
#define ERR(fmt,...)
Definition: debug.h:110
unsigned char IsClient
Definition: rpcndr.h:210
static void safe_buffer_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:713
ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static void * NdrAllocateZero(MIDL_STUB_MESSAGE *stubmsg, SIZE_T len)
Definition: ndr_marshall.c:449

Referenced by NdrComplexArrayUnmarshall(), NdrComplexStructUnmarshall(), NdrConformantArrayUnmarshall(), NdrConformantStringUnmarshall(), NdrConformantVaryingArrayUnmarshall(), and NdrConformantVaryingStructUnmarshall().

◆ array_write_variance_and_marshall()

static void array_write_variance_and_marshall ( unsigned char  fc,
PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
unsigned char  fHasPointers 
)
inlinestatic

Definition at line 2019 of file ndr_marshall.c.

2022 {
2023  DWORD i, size;
2024  DWORD esize;
2025  unsigned char alignment;
2026 
2027  switch (fc)
2028  {
2029  case FC_CARRAY:
2030  esize = *(const WORD*)(pFormat+2);
2031  alignment = pFormat[1] + 1;
2032 
2033  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2034 
2035  align_pointer_clear(&pStubMsg->Buffer, alignment);
2036 
2037  size = safe_multiply(esize, pStubMsg->MaxCount);
2038  if (fHasPointers)
2039  pStubMsg->BufferMark = pStubMsg->Buffer;
2040  safe_copy_to_buffer(pStubMsg, pMemory, size);
2041 
2042  if (fHasPointers)
2043  EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat);
2044  break;
2045  case FC_CVARRAY:
2046  esize = *(const WORD*)(pFormat+2);
2047  alignment = pFormat[1] + 1;
2048 
2049  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2050  pFormat = SkipVariance(pStubMsg, pFormat);
2051 
2052  WriteVariance(pStubMsg);
2053 
2054  align_pointer_clear(&pStubMsg->Buffer, alignment);
2055 
2056  size = safe_multiply(esize, pStubMsg->ActualCount);
2057 
2058  if (fHasPointers)
2059  pStubMsg->BufferMark = pStubMsg->Buffer;
2060  safe_copy_to_buffer(pStubMsg, pMemory + pStubMsg->Offset, size);
2061 
2062  if (fHasPointers)
2063  EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat);
2064  break;
2065  case FC_C_CSTRING:
2066  case FC_C_WSTRING:
2067  if (fc == FC_C_CSTRING)
2068  esize = 1;
2069  else
2070  esize = 2;
2071 
2072  WriteVariance(pStubMsg);
2073 
2074  size = safe_multiply(esize, pStubMsg->ActualCount);
2075  safe_copy_to_buffer(pStubMsg, pMemory, size); /* the string itself */
2076  break;
2077  case FC_BOGUS_ARRAY:
2078  alignment = pFormat[1] + 1;
2079  pFormat = SkipConformance(pStubMsg, pFormat + 4);
2080  if (IsConformanceOrVariancePresent(pFormat)) WriteVariance(pStubMsg);
2081  pFormat = SkipVariance(pStubMsg, pFormat);
2082 
2083  align_pointer_clear(&pStubMsg->Buffer, alignment);
2084 
2085  size = pStubMsg->ActualCount;
2086  for (i = 0; i < size; i++)
2087  pMemory = ComplexMarshall(pStubMsg, pMemory, pFormat, NULL);
2088  break;
2089  default:
2090  ERR("unknown array format 0x%x\n", fc);
2092  }
2093 }
unsigned char * BufferMark
Definition: rpcndr.h:206
static void WriteVariance(MIDL_STUB_MESSAGE *pStubMsg)
Definition: ndr_marshall.c:527
static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, PFORMAT_STRING pPointer)
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
static ULONG safe_multiply(ULONG a, ULONG b)
Definition: ndr_marshall.c:702
unsigned char * Buffer
Definition: rpcndr.h:203
static PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:695
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
ULONG_PTR MaxCount
Definition: rpcndr.h:221
GLsizeiptr size
Definition: glext.h:5919
static void align_pointer_clear(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:103
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
LPFOR_CONTEXT fc
Definition: for.c:53
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
#define ERR(fmt,...)
Definition: debug.h:110
static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
static void safe_copy_to_buffer(MIDL_STUB_MESSAGE *pStubMsg, const void *p, ULONG size)
Definition: ndr_marshall.c:750

Referenced by NdrComplexArrayMarshall(), NdrComplexStructMarshall(), NdrConformantArrayMarshall(), NdrConformantStringMarshall(), NdrConformantVaryingArrayMarshall(), and NdrConformantVaryingStructMarshall().

◆ ComplexBufferSize()

static unsigned char * ComplexBufferSize ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
PFORMAT_STRING  pPointer 
)
static

Definition at line 3178 of file ndr_marshall.c.

3182 {
3183  unsigned char *mem_base = pMemory;
3185  NDR_BUFFERSIZE m;
3186  ULONG size;
3187 
3188  while (*pFormat != FC_END) {
3189  switch (*pFormat) {
3190  case FC_BYTE:
3191  case FC_CHAR:
3192  case FC_SMALL:
3193  case FC_USMALL:
3194  safe_buffer_length_increment(pStubMsg, 1);
3195  pMemory += 1;
3196  break;
3197  case FC_WCHAR:
3198  case FC_SHORT:
3199  case FC_USHORT:
3200  safe_buffer_length_increment(pStubMsg, 2);
3201  pMemory += 2;
3202  break;
3203  case FC_ENUM16:
3204  safe_buffer_length_increment(pStubMsg, 2);
3205  pMemory += 4;
3206  break;
3207  case FC_LONG:
3208  case FC_ULONG:
3209  case FC_ENUM32:
3210  case FC_FLOAT:
3211  safe_buffer_length_increment(pStubMsg, 4);
3212  pMemory += 4;
3213  break;
3214  case FC_INT3264:
3215  case FC_UINT3264:
3216  safe_buffer_length_increment(pStubMsg, 4);
3217  pMemory += sizeof(INT_PTR);
3218  break;
3219  case FC_HYPER:
3220  case FC_DOUBLE:
3221  safe_buffer_length_increment(pStubMsg, 8);
3222  pMemory += 8;
3223  break;
3224  case FC_RP:
3225  case FC_UP:
3226  case FC_OP:
3227  case FC_FP:
3228  case FC_POINTER:
3229  if (*pFormat != FC_POINTER)
3230  pPointer = pFormat;
3231  if (!pStubMsg->IgnoreEmbeddedPointers)
3232  {
3233  int saved_buffer_length = pStubMsg->BufferLength;
3234  pStubMsg->BufferLength = pStubMsg->PointerLength;
3235  pStubMsg->PointerLength = 0;
3236  if(!pStubMsg->BufferLength)
3237  ERR("BufferLength == 0??\n");
3238  PointerBufferSize(pStubMsg, *(unsigned char**)pMemory, pPointer);
3239  pStubMsg->PointerLength = pStubMsg->BufferLength;
3240  pStubMsg->BufferLength = saved_buffer_length;
3241  }
3242  if (*pPointer != FC_RP)
3243  {
3244  align_length(&pStubMsg->BufferLength, 4);
3245  safe_buffer_length_increment(pStubMsg, 4);
3246  }
3247  if (*pFormat == FC_POINTER)
3248  pPointer += 4;
3249  else
3250  pFormat += 4;
3251  pMemory += sizeof(void*);
3252  break;
3253  case FC_ALIGNM2:
3254  align_pointer_offset(&pMemory, mem_base, 2);
3255  break;
3256  case FC_ALIGNM4:
3257  align_pointer_offset(&pMemory, mem_base, 4);
3258  break;
3259  case FC_ALIGNM8:
3260  align_pointer_offset(&pMemory, mem_base, 8);
3261  break;
3262  case FC_STRUCTPAD1:
3263  case FC_STRUCTPAD2:
3264  case FC_STRUCTPAD3:
3265  case FC_STRUCTPAD4:
3266  case FC_STRUCTPAD5:
3267  case FC_STRUCTPAD6:
3268  case FC_STRUCTPAD7:
3269  pMemory += *pFormat - FC_STRUCTPAD1 + 1;
3270  break;
3271  case FC_EMBEDDED_COMPLEX:
3272  pMemory += pFormat[1];
3273  pFormat += 2;
3274  desc = pFormat + *(const SHORT*)pFormat;
3275  size = EmbeddedComplexSize(pStubMsg, desc);
3277  if (m)
3278  {
3279  /* for some reason interface pointers aren't generated as
3280  * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet
3281  * they still need the dereferencing treatment that pointers are
3282  * given */
3283  if (*desc == FC_IP)
3284  m(pStubMsg, *(unsigned char **)pMemory, desc);
3285  else
3286  m(pStubMsg, pMemory, desc);
3287  }
3288  else FIXME("no buffersizer for embedded type %02x\n", *desc);
3289  pMemory += size;
3290  pFormat += 2;
3291  continue;
3292  case FC_PAD:
3293  break;
3294  default:
3295  FIXME("unhandled format 0x%02x\n", *pFormat);
3296  }
3297  pFormat++;
3298  }
3299 
3300  return pMemory;
3301 }
static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Pointer, PFORMAT_STRING pFormat)
int32_t INT_PTR
Definition: typedefs.h:63
static void align_length(ULONG *len, unsigned int align)
Definition: ndr_marshall.c:92
const GLfloat * m
Definition: glext.h:10848
int IgnoreEmbeddedPointers
Definition: rpcndr.h:216
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
static void align_pointer_offset(unsigned char **ptr, unsigned char *base, unsigned int align)
Definition: ndr_marshall.c:110
void(WINAPI * NDR_BUFFERSIZE)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:55
GLsizeiptr size
Definition: glext.h:5919
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
const NDR_BUFFERSIZE NdrBufferSizer[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:260
static void safe_buffer_length_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:721
ULONG BufferLength
Definition: rpcndr.h:207
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int ULONG
Definition: retypes.h:1
#define NDR_TABLE_MASK
Definition: ndr_marshall.c:132
ULONG PointerLength
Definition: rpcndr.h:233

Referenced by array_buffer_size(), and NdrComplexStructBufferSize().

◆ ComplexFree()

static unsigned char * ComplexFree ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
PFORMAT_STRING  pPointer 
)
static

Definition at line 3303 of file ndr_marshall.c.

3307 {
3308  unsigned char *mem_base = pMemory;
3310  NDR_FREE m;
3311  ULONG size;
3312 
3313  while (*pFormat != FC_END) {
3314  switch (*pFormat) {
3315  case FC_BYTE:
3316  case FC_CHAR:
3317  case FC_SMALL:
3318  case FC_USMALL:
3319  pMemory += 1;
3320  break;
3321  case FC_WCHAR:
3322  case FC_SHORT:
3323  case FC_USHORT:
3324  pMemory += 2;
3325  break;
3326  case FC_LONG:
3327  case FC_ULONG:
3328  case FC_ENUM16:
3329  case FC_ENUM32:
3330  case FC_FLOAT:
3331  pMemory += 4;
3332  break;
3333  case FC_INT3264:
3334  case FC_UINT3264:
3335  pMemory += sizeof(INT_PTR);
3336  break;
3337  case FC_HYPER:
3338  case FC_DOUBLE:
3339  pMemory += 8;
3340  break;
3341  case FC_RP:
3342  case FC_UP:
3343  case FC_OP:
3344  case FC_FP:
3345  case FC_POINTER:
3346  if (*pFormat != FC_POINTER)
3347  pPointer = pFormat;
3348  NdrPointerFree(pStubMsg, *(unsigned char**)pMemory, pPointer);
3349  if (*pFormat == FC_POINTER)
3350  pPointer += 4;
3351  else
3352  pFormat += 4;
3353  pMemory += sizeof(void *);
3354  break;
3355  case FC_ALIGNM2:
3356  align_pointer_offset(&pMemory, mem_base, 2);
3357  break;
3358  case FC_ALIGNM4:
3359  align_pointer_offset(&pMemory, mem_base, 4);
3360  break;
3361  case FC_ALIGNM8:
3362  align_pointer_offset(&pMemory, mem_base, 8);
3363  break;
3364  case FC_STRUCTPAD1:
3365  case FC_STRUCTPAD2:
3366  case FC_STRUCTPAD3:
3367  case FC_STRUCTPAD4:
3368  case FC_STRUCTPAD5:
3369  case FC_STRUCTPAD6:
3370  case FC_STRUCTPAD7:
3371  pMemory += *pFormat - FC_STRUCTPAD1 + 1;
3372  break;
3373  case FC_EMBEDDED_COMPLEX:
3374  pMemory += pFormat[1];
3375  pFormat += 2;
3376  desc = pFormat + *(const SHORT*)pFormat;
3377  size = EmbeddedComplexSize(pStubMsg, desc);
3378  m = NdrFreer[*desc & NDR_TABLE_MASK];
3379  if (m)
3380  {
3381  /* for some reason interface pointers aren't generated as
3382  * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet
3383  * they still need the dereferencing treatment that pointers are
3384  * given */
3385  if (*desc == FC_IP)
3386  m(pStubMsg, *(unsigned char **)pMemory, desc);
3387  else
3388  m(pStubMsg, pMemory, desc);
3389  }
3390  pMemory += size;
3391  pFormat += 2;
3392  continue;
3393  case FC_PAD:
3394  break;
3395  default:
3396  FIXME("unhandled format 0x%02x\n", *pFormat);
3397  }
3398  pFormat++;
3399  }
3400 
3401  return pMemory;
3402 }
void WINAPI NdrPointerFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat)
static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
const NDR_FREE NdrFreer[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:348
int32_t INT_PTR
Definition: typedefs.h:63
const GLfloat * m
Definition: glext.h:10848
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
static void align_pointer_offset(unsigned char **ptr, unsigned char *base, unsigned int align)
Definition: ndr_marshall.c:110
GLsizeiptr size
Definition: glext.h:5919
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
void(WINAPI * NDR_FREE)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:57
unsigned int ULONG
Definition: retypes.h:1
#define NDR_TABLE_MASK
Definition: ndr_marshall.c:132

Referenced by array_free(), NdrComplexArrayFree(), and NdrComplexStructFree().

◆ ComplexMarshall()

static unsigned char * ComplexMarshall ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
PFORMAT_STRING  pPointer 
)
static

Definition at line 2842 of file ndr_marshall.c.

2846 {
2847  unsigned char *mem_base = pMemory;
2849  NDR_MARSHALL m;
2850  ULONG size;
2851 
2852  while (*pFormat != FC_END) {
2853  switch (*pFormat) {
2854  case FC_BYTE:
2855  case FC_CHAR:
2856  case FC_SMALL:
2857  case FC_USMALL:
2858  TRACE("byte=%d <= %p\n", *(WORD*)pMemory, pMemory);
2859  safe_copy_to_buffer(pStubMsg, pMemory, 1);
2860  pMemory += 1;
2861  break;
2862  case FC_WCHAR:
2863  case FC_SHORT:
2864  case FC_USHORT:
2865  TRACE("short=%d <= %p\n", *(WORD*)pMemory, pMemory);
2866  safe_copy_to_buffer(pStubMsg, pMemory, 2);
2867  pMemory += 2;
2868  break;
2869  case FC_ENUM16:
2870  {
2871  USHORT val = *(DWORD *)pMemory;
2872  TRACE("enum16=%d <= %p\n", *(DWORD*)pMemory, pMemory);
2873  if (32767 < *(DWORD*)pMemory)
2875  safe_copy_to_buffer(pStubMsg, &val, 2);
2876  pMemory += 4;
2877  break;
2878  }
2879  case FC_LONG:
2880  case FC_ULONG:
2881  case FC_ENUM32:
2882  TRACE("long=%d <= %p\n", *(DWORD*)pMemory, pMemory);
2883  safe_copy_to_buffer(pStubMsg, pMemory, 4);
2884  pMemory += 4;
2885  break;
2886  case FC_INT3264:
2887  case FC_UINT3264:
2888  {
2889  UINT val = *(UINT_PTR *)pMemory;
2890  TRACE("int3264=%ld <= %p\n", *(UINT_PTR *)pMemory, pMemory);
2891  safe_copy_to_buffer(pStubMsg, &val, sizeof(UINT));
2892  pMemory += sizeof(UINT_PTR);
2893  break;
2894  }
2895  case FC_FLOAT:
2896  TRACE("float=%f <= %p\n", *(float*)pMemory, pMemory);
2897  safe_copy_to_buffer(pStubMsg, pMemory, sizeof(float));
2898  pMemory += sizeof(float);
2899  break;
2900  case FC_HYPER:
2901  TRACE("longlong=%s <= %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory);
2902  safe_copy_to_buffer(pStubMsg, pMemory, 8);
2903  pMemory += 8;
2904  break;
2905  case FC_DOUBLE:
2906  TRACE("double=%f <= %p\n", *(double*)pMemory, pMemory);
2907  safe_copy_to_buffer(pStubMsg, pMemory, sizeof(double));
2908  pMemory += sizeof(double);
2909  break;
2910  case FC_RP:
2911  case FC_UP:
2912  case FC_OP:
2913  case FC_FP:
2914  case FC_POINTER:
2915  {
2916  unsigned char *saved_buffer;
2917  BOOL pointer_buffer_mark_set = FALSE;
2918  TRACE("pointer=%p <= %p\n", *(unsigned char**)pMemory, pMemory);
2919  TRACE("pStubMsg->Buffer before %p\n", pStubMsg->Buffer);
2920  if (*pFormat != FC_POINTER)
2921  pPointer = pFormat;
2922  if (*pPointer != FC_RP)
2923  align_pointer_clear(&pStubMsg->Buffer, 4);
2924  saved_buffer = pStubMsg->Buffer;
2925  if (pStubMsg->PointerBufferMark)
2926  {
2927  pStubMsg->Buffer = pStubMsg->PointerBufferMark;
2928  pStubMsg->PointerBufferMark = NULL;
2929  pointer_buffer_mark_set = TRUE;
2930  }
2931  else if (*pPointer != FC_RP)
2932  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
2933  PointerMarshall(pStubMsg, saved_buffer, *(unsigned char**)pMemory, pPointer);
2934  if (pointer_buffer_mark_set)
2935  {
2936  STD_OVERFLOW_CHECK(pStubMsg);
2937  pStubMsg->PointerBufferMark = pStubMsg->Buffer;
2938  pStubMsg->Buffer = saved_buffer;
2939  if (*pPointer != FC_RP)
2940  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
2941  }
2942  TRACE("pStubMsg->Buffer after %p\n", pStubMsg->Buffer);
2943  if (*pFormat == FC_POINTER)
2944  pPointer += 4;
2945  else
2946  pFormat += 4;
2947  pMemory += sizeof(void *);
2948  break;
2949  }
2950  case FC_ALIGNM2:
2951  align_pointer_offset(&pMemory, mem_base, 2);
2952  break;
2953  case FC_ALIGNM4:
2954  align_pointer_offset(&pMemory, mem_base, 4);
2955  break;
2956  case FC_ALIGNM8:
2957  align_pointer_offset(&pMemory, mem_base, 8);
2958  break;
2959  case FC_STRUCTPAD1:
2960  case FC_STRUCTPAD2:
2961  case FC_STRUCTPAD3:
2962  case FC_STRUCTPAD4:
2963  case FC_STRUCTPAD5:
2964  case FC_STRUCTPAD6:
2965  case FC_STRUCTPAD7:
2966  pMemory += *pFormat - FC_STRUCTPAD1 + 1;
2967  break;
2968  case FC_EMBEDDED_COMPLEX:
2969  pMemory += pFormat[1];
2970  pFormat += 2;
2971  desc = pFormat + *(const SHORT*)pFormat;
2972  size = EmbeddedComplexSize(pStubMsg, desc);
2973  TRACE("embedded complex (size=%d) <= %p\n", size, pMemory);
2975  if (m)
2976  {
2977  /* for some reason interface pointers aren't generated as
2978  * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet
2979  * they still need the dereferencing treatment that pointers are
2980  * given */
2981  if (*desc == FC_IP)
2982  m(pStubMsg, *(unsigned char **)pMemory, desc);
2983  else
2984  m(pStubMsg, pMemory, desc);
2985  }
2986  else FIXME("no marshaller for embedded type %02x\n", *desc);
2987  pMemory += size;
2988  pFormat += 2;
2989  continue;
2990  case FC_PAD:
2991  break;
2992  default:
2993  FIXME("unhandled format 0x%02x\n", *pFormat);
2994  }
2995  pFormat++;
2996  }
2997 
2998  return pMemory;
2999 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
#define TRUE
Definition: types.h:120
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
unsigned char *(WINAPI * NDR_MARSHALL)(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING)
Definition: ndr_misc.h:53
unsigned char * Buffer
Definition: rpcndr.h:203
unsigned char * PointerBufferMark
Definition: rpcndr.h:217
const GLfloat * m
Definition: glext.h:10848
unsigned int BOOL
Definition: ntddk_ex.h:94
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
smooth NULL
Definition: ftsmooth.c:416
static void align_pointer_offset(unsigned char **ptr, unsigned char *base, unsigned int align)
Definition: ndr_marshall.c:110
GLuint GLfloat * val
Definition: glext.h:7180
static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, unsigned char *Pointer, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:813
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static void align_pointer_clear(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:103
uint64_t ULONGLONG
Definition: typedefs.h:66
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1088
const NDR_MARSHALL NdrMarshaller[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:172
static float(__cdecl *square_half_float)(float x
unsigned short USHORT
Definition: pedump.c:61
unsigned int UINT
Definition: ndis.h:50
static void safe_buffer_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:713
unsigned int ULONG
Definition: retypes.h:1
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
#define STD_OVERFLOW_CHECK(_Msg)
Definition: ndr_marshall.c:123
static void safe_copy_to_buffer(MIDL_STUB_MESSAGE *pStubMsg, const void *p, ULONG size)
Definition: ndr_marshall.c:750
#define NDR_TABLE_MASK
Definition: ndr_marshall.c:132

Referenced by array_write_variance_and_marshall(), and NdrComplexStructMarshall().

◆ ComplexStructMemorySize()

static ULONG ComplexStructMemorySize ( PMIDL_STUB_MESSAGE  pStubMsg,
PFORMAT_STRING  pFormat,
PFORMAT_STRING  pPointer 
)
static

Definition at line 3404 of file ndr_marshall.c.

3407 {
3409  ULONG size = 0;
3410 
3411  while (*pFormat != FC_END) {
3412  switch (*pFormat) {
3413  case FC_BYTE:
3414  case FC_CHAR:
3415  case FC_SMALL:
3416  case FC_USMALL:
3417  size += 1;
3418  safe_buffer_increment(pStubMsg, 1);
3419  break;
3420  case FC_WCHAR:
3421  case FC_SHORT:
3422  case FC_USHORT:
3423  size += 2;
3424  safe_buffer_increment(pStubMsg, 2);
3425  break;
3426  case FC_ENUM16:
3427  size += 4;
3428  safe_buffer_increment(pStubMsg, 2);
3429  break;
3430  case FC_LONG:
3431  case FC_ULONG:
3432  case FC_ENUM32:
3433  case FC_FLOAT:
3434  size += 4;
3435  safe_buffer_increment(pStubMsg, 4);
3436  break;
3437  case FC_INT3264:
3438  case FC_UINT3264:
3439  size += sizeof(INT_PTR);
3440  safe_buffer_increment(pStubMsg, 4);
3441  break;
3442  case FC_HYPER:
3443  case FC_DOUBLE:
3444  size += 8;
3445  safe_buffer_increment(pStubMsg, 8);
3446  break;
3447  case FC_RP:
3448  case FC_UP:
3449  case FC_OP:
3450  case FC_FP:
3451  case FC_POINTER:
3452  {
3453  unsigned char *saved_buffer;
3454  BOOL pointer_buffer_mark_set = FALSE;
3455  if (*pFormat != FC_POINTER)
3456  pPointer = pFormat;
3457  if (*pPointer != FC_RP)
3458  align_pointer(&pStubMsg->Buffer, 4);
3459  saved_buffer = pStubMsg->Buffer;
3460  if (pStubMsg->PointerBufferMark)
3461  {
3462  pStubMsg->Buffer = pStubMsg->PointerBufferMark;
3463  pStubMsg->PointerBufferMark = NULL;
3464  pointer_buffer_mark_set = TRUE;
3465  }
3466  else if (*pPointer != FC_RP)
3467  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
3468 
3469  if (!pStubMsg->IgnoreEmbeddedPointers)
3470  PointerMemorySize(pStubMsg, saved_buffer, pPointer);
3471  if (pointer_buffer_mark_set)
3472  {
3473  STD_OVERFLOW_CHECK(pStubMsg);
3474  pStubMsg->PointerBufferMark = pStubMsg->Buffer;
3475  pStubMsg->Buffer = saved_buffer;
3476  if (*pPointer != FC_RP)
3477  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
3478  }
3479  if (*pFormat == FC_POINTER)
3480  pPointer += 4;
3481  else
3482  pFormat += 4;
3483  size += sizeof(void *);
3484  break;
3485  }
3486  case FC_ALIGNM2:
3487  align_length(&size, 2);
3488  break;
3489  case FC_ALIGNM4:
3490  align_length(&size, 4);
3491  break;
3492  case FC_ALIGNM8:
3493  align_length(&size, 8);
3494  break;
3495  case FC_STRUCTPAD1:
3496  case FC_STRUCTPAD2:
3497  case FC_STRUCTPAD3:
3498  case FC_STRUCTPAD4:
3499  case FC_STRUCTPAD5:
3500  case FC_STRUCTPAD6:
3501  case FC_STRUCTPAD7:
3502  size += *pFormat - FC_STRUCTPAD1 + 1;
3503  break;
3504  case FC_EMBEDDED_COMPLEX:
3505  size += pFormat[1];
3506  pFormat += 2;
3507  desc = pFormat + *(const SHORT*)pFormat;
3508  size += EmbeddedComplexMemorySize(pStubMsg, desc);
3509  pFormat += 2;
3510  continue;
3511  case FC_PAD:
3512  break;
3513  default:
3514  FIXME("unhandled format 0x%02x\n", *pFormat);
3515  }
3516  pFormat++;
3517  }
3518 
3519  return size;
3520 }
static ULONG PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, PFORMAT_STRING pFormat)
#define TRUE
Definition: types.h:120
unsigned char * Buffer
Definition: rpcndr.h:203
int32_t INT_PTR
Definition: typedefs.h:63
unsigned char * PointerBufferMark
Definition: rpcndr.h:217
static void align_length(ULONG *len, unsigned int align)
Definition: ndr_marshall.c:92
static void align_pointer(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:97
unsigned int BOOL
Definition: ntddk_ex.h:94
int IgnoreEmbeddedPointers
Definition: rpcndr.h:216
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
static void safe_buffer_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:713
unsigned int ULONG
Definition: retypes.h:1
static ULONG EmbeddedComplexMemorySize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define STD_OVERFLOW_CHECK(_Msg)
Definition: ndr_marshall.c:123

Referenced by array_memory_size(), and NdrComplexStructMemorySize().

◆ ComplexStructSize()

ULONG ComplexStructSize ( PMIDL_STUB_MESSAGE  pStubMsg,
PFORMAT_STRING  pFormat 
)

Definition at line 3522 of file ndr_marshall.c.

3523 {
3525  ULONG size = 0;
3526 
3527  while (*pFormat != FC_END) {
3528  switch (*pFormat) {
3529  case FC_BYTE:
3530  case FC_CHAR:
3531  case FC_SMALL:
3532  case FC_USMALL:
3533  size += 1;
3534  break;
3535  case FC_WCHAR:
3536  case FC_SHORT:
3537  case FC_USHORT:
3538  size += 2;
3539  break;
3540  case FC_LONG:
3541  case FC_ULONG:
3542  case FC_ENUM16:
3543  case FC_ENUM32:
3544  case FC_FLOAT:
3545  size += 4;
3546  break;
3547  case FC_INT3264:
3548  case FC_UINT3264:
3549  size += sizeof(INT_PTR);
3550  break;
3551  case FC_HYPER:
3552  case FC_DOUBLE:
3553  size += 8;
3554  break;
3555  case FC_RP:
3556  case FC_UP:
3557  case FC_OP:
3558  case FC_FP:
3559  case FC_POINTER:
3560  size += sizeof(void *);
3561  if (*pFormat != FC_POINTER)
3562  pFormat += 4;
3563  break;
3564  case FC_ALIGNM2:
3565  align_length(&size, 2);
3566  break;
3567  case FC_ALIGNM4:
3568  align_length(&size, 4);
3569  break;
3570  case FC_ALIGNM8:
3571  align_length(&size, 8);
3572  break;
3573  case FC_STRUCTPAD1:
3574  case FC_STRUCTPAD2:
3575  case FC_STRUCTPAD3:
3576  case FC_STRUCTPAD4:
3577  case FC_STRUCTPAD5:
3578  case FC_STRUCTPAD6:
3579  case FC_STRUCTPAD7:
3580  size += *pFormat - FC_STRUCTPAD1 + 1;
3581  break;
3582  case FC_EMBEDDED_COMPLEX:
3583  size += pFormat[1];
3584  pFormat += 2;
3585  desc = pFormat + *(const SHORT*)pFormat;
3586  size += EmbeddedComplexSize(pStubMsg, desc);
3587  pFormat += 2;
3588  continue;
3589  case FC_PAD:
3590  break;
3591  default:
3592  FIXME("unhandled format 0x%02x\n", *pFormat);
3593  }
3594  pFormat++;
3595  }
3596 
3597  return size;
3598 }
static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
int32_t INT_PTR
Definition: typedefs.h:63
static void align_length(ULONG *len, unsigned int align)
Definition: ndr_marshall.c:92
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
GLsizeiptr size
Definition: glext.h:5919
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned int ULONG
Definition: retypes.h:1

Referenced by array_memory_size(), array_read_conformance(), array_read_variance_and_unmarshall(), calc_arg_size(), NdrComplexStructBufferSize(), and NdrComplexStructMarshall().

◆ ComplexUnmarshall()

static unsigned char * ComplexUnmarshall ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
PFORMAT_STRING  pPointer,
unsigned char  fMustAlloc 
)
static

Definition at line 3001 of file ndr_marshall.c.

3006 {
3007  unsigned char *mem_base = pMemory;
3009  NDR_UNMARSHALL m;
3010  ULONG size;
3011 
3012  while (*pFormat != FC_END) {
3013  switch (*pFormat) {
3014  case FC_BYTE:
3015  case FC_CHAR:
3016  case FC_SMALL:
3017  case FC_USMALL:
3018  safe_copy_from_buffer(pStubMsg, pMemory, 1);
3019  TRACE("byte=%d => %p\n", *(WORD*)pMemory, pMemory);
3020  pMemory += 1;
3021  break;
3022  case FC_WCHAR:
3023  case FC_SHORT:
3024  case FC_USHORT:
3025  safe_copy_from_buffer(pStubMsg, pMemory, 2);
3026  TRACE("short=%d => %p\n", *(WORD*)pMemory, pMemory);
3027  pMemory += 2;
3028  break;
3029  case FC_ENUM16:
3030  {
3031  WORD val;
3032  safe_copy_from_buffer(pStubMsg, &val, 2);
3033  *(DWORD*)pMemory = val;
3034  TRACE("enum16=%d => %p\n", *(DWORD*)pMemory, pMemory);
3035  if (32767 < *(DWORD*)pMemory)
3037  pMemory += 4;
3038  break;
3039  }
3040  case FC_LONG:
3041  case FC_ULONG:
3042  case FC_ENUM32:
3043  safe_copy_from_buffer(pStubMsg, pMemory, 4);
3044  TRACE("long=%d => %p\n", *(DWORD*)pMemory, pMemory);
3045  pMemory += 4;
3046  break;
3047  case FC_INT3264:
3048  {
3049  INT val;
3050  safe_copy_from_buffer(pStubMsg, &val, 4);
3051  *(INT_PTR *)pMemory = val;
3052  TRACE("int3264=%ld => %p\n", *(INT_PTR*)pMemory, pMemory);
3053  pMemory += sizeof(INT_PTR);
3054  break;
3055  }
3056  case FC_UINT3264:
3057  {
3058  UINT val;
3059  safe_copy_from_buffer(pStubMsg, &val, 4);
3060  *(UINT_PTR *)pMemory = val;
3061  TRACE("uint3264=%ld => %p\n", *(UINT_PTR*)pMemory, pMemory);
3062  pMemory += sizeof(UINT_PTR);
3063  break;
3064  }
3065  case FC_FLOAT:
3066  safe_copy_from_buffer(pStubMsg, pMemory, sizeof(float));
3067  TRACE("float=%f => %p\n", *(float*)pMemory, pMemory);
3068  pMemory += sizeof(float);
3069  break;
3070  case FC_HYPER:
3071  safe_copy_from_buffer(pStubMsg, pMemory, 8);
3072  TRACE("longlong=%s => %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory);
3073  pMemory += 8;
3074  break;
3075  case FC_DOUBLE:
3076  safe_copy_from_buffer(pStubMsg, pMemory, sizeof(double));
3077  TRACE("double=%f => %p\n", *(double*)pMemory, pMemory);
3078  pMemory += sizeof(double);
3079  break;
3080  case FC_RP:
3081  case FC_UP:
3082  case FC_OP:
3083  case FC_FP:
3084  case FC_POINTER:
3085  {
3086  unsigned char *saved_buffer;
3087  BOOL pointer_buffer_mark_set = FALSE;
3088  TRACE("pointer => %p\n", pMemory);
3089  if (*pFormat != FC_POINTER)
3090  pPointer = pFormat;
3091  if (*pPointer != FC_RP)
3092  align_pointer(&pStubMsg->Buffer, 4);
3093  saved_buffer = pStubMsg->Buffer;
3094  if (pStubMsg->PointerBufferMark)
3095  {
3096  pStubMsg->Buffer = pStubMsg->PointerBufferMark;
3097  pStubMsg->PointerBufferMark = NULL;
3098  pointer_buffer_mark_set = TRUE;
3099  }
3100  else if (*pPointer != FC_RP)
3101  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
3102 
3103  PointerUnmarshall(pStubMsg, saved_buffer, (unsigned char**)pMemory, *(unsigned char**)pMemory, pPointer, fMustAlloc);
3104  if (pointer_buffer_mark_set)
3105  {
3106  STD_OVERFLOW_CHECK(pStubMsg);
3107  pStubMsg->PointerBufferMark = pStubMsg->Buffer;
3108  pStubMsg->Buffer = saved_buffer;
3109  if (*pPointer != FC_RP)
3110  safe_buffer_increment(pStubMsg, 4); /* for pointer ID */
3111  }
3112  if (*pFormat == FC_POINTER)
3113  pPointer += 4;
3114  else
3115  pFormat += 4;
3116  pMemory += sizeof(void *);
3117  break;
3118  }
3119  case FC_ALIGNM2:
3120  align_pointer_offset_clear(&pMemory, mem_base, 2);
3121  break;
3122  case FC_ALIGNM4:
3123  align_pointer_offset_clear(&pMemory, mem_base, 4);
3124  break;
3125  case FC_ALIGNM8:
3126  align_pointer_offset_clear(&pMemory, mem_base, 8);
3127  break;
3128  case FC_STRUCTPAD1:
3129  case FC_STRUCTPAD2:
3130  case FC_STRUCTPAD3:
3131  case FC_STRUCTPAD4:
3132  case FC_STRUCTPAD5:
3133  case FC_STRUCTPAD6:
3134  case FC_STRUCTPAD7:
3135  memset(pMemory, 0, *pFormat - FC_STRUCTPAD1 + 1);
3136  pMemory += *pFormat - FC_STRUCTPAD1 + 1;
3137  break;
3138  case FC_EMBEDDED_COMPLEX:
3139  pMemory += pFormat[1];
3140  pFormat += 2;
3141  desc = pFormat + *(const SHORT*)pFormat;
3142  size = EmbeddedComplexSize(pStubMsg, desc);
3143  TRACE("embedded complex (size=%d) => %p\n", size, pMemory);
3144  if (fMustAlloc)
3145  /* we can't pass fMustAlloc=TRUE into the marshaller for this type
3146  * since the type is part of the memory block that is encompassed by
3147  * the whole complex type. Memory is forced to allocate when pointers
3148  * are set to NULL, so we emulate that part of fMustAlloc=TRUE by
3149  * clearing the memory we pass in to the unmarshaller */
3150  memset(pMemory, 0, size);
3152  if (m)
3153  {
3154  /* for some reason interface pointers aren't generated as
3155  * FC_POINTER, but instead as FC_EMBEDDED_COMPLEX, yet
3156  * they still need the dereferencing treatment that pointers are
3157  * given */
3158  if (*desc == FC_IP)
3159  m(pStubMsg, (unsigned char **)pMemory, desc, FALSE);
3160  else
3161  m(pStubMsg, &pMemory, desc, FALSE);
3162  }
3163  else FIXME("no unmarshaller for embedded type %02x\n", *desc);
3164  pMemory += size;
3165  pFormat += 2;
3166  continue;
3167  case FC_PAD:
3168  break;
3169  default:
3170  FIXME("unhandled format %d\n", *pFormat);
3171  }
3172  pFormat++;
3173  }
3174 
3175  return pMemory;
3176 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
static ULONG EmbeddedComplexSize(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
#define TRUE
Definition: types.h:120
static void align_pointer_offset_clear(unsigned char **ptr, unsigned char *base, unsigned int align)
Definition: ndr_marshall.c:116
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
unsigned char * Buffer
Definition: rpcndr.h:203
int32_t INT_PTR
Definition: typedefs.h:63
unsigned char * PointerBufferMark
Definition: rpcndr.h:217
int32_t INT
Definition: typedefs.h:57
const GLfloat * m
Definition: glext.h:10848
static void align_pointer(unsigned char **ptr, unsigned int align)
Definition: ndr_marshall.c:97
unsigned int BOOL
Definition: ntddk_ex.h:94
short SHORT
Definition: pedump.c:59
static const WCHAR desc[]
Definition: protectdata.c:36
#define FIXME(fmt,...)
Definition: debug.h:111
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
smooth NULL
Definition: ftsmooth.c:416
const NDR_UNMARSHALL NdrUnmarshaller[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:216
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, unsigned char **pPointer, unsigned char *pSrcPointer, PFORMAT_STRING pFormat, unsigned char fMustAlloc)
Definition: ndr_marshall.c:883
uint64_t ULONGLONG
Definition: typedefs.h:66
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static void safe_copy_from_buffer(MIDL_STUB_MESSAGE *pStubMsg, void *p, ULONG size)
Definition: ndr_marshall.c:734
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1088
static float(__cdecl *square_half_float)(float x
unsigned int UINT
Definition: ndis.h:50
unsigned char *(WINAPI * NDR_UNMARSHALL)(PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char)
Definition: ndr_misc.h:54
static void safe_buffer_increment(MIDL_STUB_MESSAGE *pStubMsg, ULONG size)
Definition: ndr_marshall.c:713
unsigned int ULONG
Definition: retypes.h:1
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
#define STD_OVERFLOW_CHECK(_Msg)
Definition: ndr_marshall.c:123
#define memset(x, y, z)
Definition: compat.h:39
#define NDR_TABLE_MASK
Definition: ndr_marshall.c:132

Referenced by array_read_variance_and_unmarshall(), and NdrComplexStructUnmarshall().

◆ ComputeConformanceOrVariance()

PFORMAT_STRING ComputeConformanceOrVariance ( MIDL_STUB_MESSAGE pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat,
ULONG_PTR  def,
ULONG_PTR pCount 
)

Definition at line 556 of file ndr_marshall.c.

559 {
560  BYTE dtype = pFormat[0] & 0xf;
561  short ofs = *(const short *)&pFormat[2];
562  LPVOID ptr = NULL;
563  ULONG_PTR data = 0;
564 
565  if (!IsConformanceOrVariancePresent(pFormat)) {
566  /* null descriptor */
567  *pCount = def;
568  goto finish_conf;
569  }
570 
571  switch (pFormat[0] & 0xf0) {
573  TRACE("normal conformance, ofs=%d\n", ofs);
574  ptr = pMemory;
575  break;
577  TRACE("pointer conformance, ofs=%d\n", ofs);
578  ptr = pStubMsg->Memory;
579  break;
581  TRACE("toplevel conformance, ofs=%d\n", ofs);
582  if (pStubMsg->StackTop) {
583  ptr = pStubMsg->StackTop;
584  }
585  else {
586  /* -Os mode, *pCount is already set */
587  goto finish_conf;
588  }
589  break;
591  data = ofs | ((DWORD)pFormat[1] << 16);
592  TRACE("constant conformance, val=%ld\n", data);
593  *pCount = data;
594  goto finish_conf;
596  FIXME("toplevel multidimensional conformance, ofs=%d\n", ofs);
597  if (pStubMsg->StackTop) {
598  ptr = pStubMsg->StackTop;
599  }
600  else {
601  /* ? */
602  goto done_conf_grab;
603  }
604  break;
605  default:
606  FIXME("unknown conformance type %x, expect crash.\n", pFormat[0] & 0xf0);
607  goto finish_conf;
608  }
609 
610  switch (pFormat[1]) {
611  case FC_DEREFERENCE:
612  ptr = *(LPVOID*)((char *)ptr + ofs);
613  break;
614  case FC_CALLBACK:
615  {
616  unsigned char *old_stack_top = pStubMsg->StackTop;
617  ULONG_PTR max_count, old_max_count = pStubMsg->MaxCount;
618 
619  pStubMsg->StackTop = ptr;
620 
621  /* ofs is index into StubDesc->apfnExprEval */
622  TRACE("callback conformance into apfnExprEval[%d]\n", ofs);
623  pStubMsg->StubDesc->apfnExprEval[ofs](pStubMsg);
624 
625  pStubMsg->StackTop = old_stack_top;
626 
627  /* the callback function always stores the computed value in MaxCount */
628  max_count = pStubMsg->MaxCount;
629  pStubMsg->MaxCount = old_max_count;
630  *pCount = max_count;
631  goto finish_conf;
632  }
633  default:
634  ptr = (char *)ptr + ofs;
635  break;
636  }
637 
638  switch (dtype) {
639  case FC_LONG:
640  case FC_ULONG:
641  data = *(DWORD*)ptr;
642  break;
643  case FC_SHORT:
644  data = *(SHORT*)ptr;
645  break;
646  case FC_USHORT:
647  data = *(USHORT*)ptr;
648  break;
649  case FC_CHAR:
650  case FC_SMALL:
651  data = *(CHAR*)ptr;
652  break;
653  case FC_BYTE:
654  case FC_USMALL:
655  data = *(UCHAR*)ptr;
656  break;
657  case FC_HYPER:
658  data = *(ULONGLONG *)ptr;
659  break;
660  default:
661  FIXME("unknown conformance data type %x\n", dtype);
662  goto done_conf_grab;
663  }
664  TRACE("dereferenced data type %x at %p, got %ld\n", dtype, ptr, data);
665 
666 done_conf_grab:
667  switch (pFormat[1]) {
668  case FC_DEREFERENCE: /* already handled */
669  case 0: /* no op */
670  *pCount = data;
671  break;
672  case FC_ADD_1:
673  *pCount = data + 1;
674  break;
675  case FC_SUB_1:
676  *pCount = data - 1;
677  break;
678  case FC_MULT_2:
679  *pCount = data * 2;
680  break;
681  case FC_DIV_2:
682  *pCount = data / 2;
683  break;
684  default:
685  FIXME("unknown conformance op %d\n", pFormat[1]);
686  goto finish_conf;
687  }
688 
689 finish_conf:
690  TRACE("resulting conformance is %ld\n", *pCount);
691 
692  return SkipConformance(pStubMsg, pFormat);
693 }
#define FC_TOP_LEVEL_CONFORMANCE
Definition: ndrtypes.h:300
char CHAR
Definition: xmlstorage.h:175
const struct _MIDL_STUB_DESC * StubDesc
Definition: rpcndr.h:230
#define FC_TOP_LEVEL_MULTID_CONFORMANCE
Definition: ndrtypes.h:302
#define DWORD
Definition: nt_native.h:44
uint32_t ULONG_PTR
Definition: typedefs.h:64
#define FC_NORMAL_CONFORMANCE
Definition: ndrtypes.h:298
short SHORT
Definition: pedump.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
unsigned char * Memory
Definition: rpcndr.h:209
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
ULONG_PTR MaxCount
Definition: rpcndr.h:221
uint64_t ULONGLONG
Definition: typedefs.h:66
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL IsConformanceOrVariancePresent(PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:463
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned char BYTE
Definition: xxhash.c:193
#define FC_CONSTANT_CONFORMANCE
Definition: ndrtypes.h:301
unsigned short USHORT
Definition: pedump.c:61
unsigned char * StackTop
Definition: rpcndr.h:226
#define FC_POINTER_CONFORMANCE
Definition: ndrtypes.h:299

Referenced by ComputeConformance(), and ComputeVariance().

◆ dump_pointer_attr()

static void dump_pointer_attr ( unsigned char  attr)
inlinestatic

Definition at line 795 of file ndr_marshall.c.

796 {
798  TRACE(" FC_ALLOCATE_ALL_NODES");
799  if (attr & FC_DONT_FREE)
800  TRACE(" FC_DONT_FREE");
802  TRACE(" FC_ALLOCED_ON_STACK");
803  if (attr & FC_SIMPLE_POINTER)
804  TRACE(" FC_SIMPLE_POINTER");
805  if (attr & FC_POINTER_DEREF)
806  TRACE(" FC_POINTER_DEREF");
807  TRACE("\n");
808 }
#define FC_POINTER_DEREF
Definition: ndrtypes.h:276
#define FC_ALLOCATE_ALL_NODES
Definition: ndrtypes.h:272
#define FC_ALLOCED_ON_STACK
Definition: ndrtypes.h:274
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:201
#define FC_DONT_FREE
Definition: ndrtypes.h:273
#define FC_SIMPLE_POINTER
Definition: ndrtypes.h:275

Referenced by PointerBufferSize(), PointerFree(), PointerMarshall(), PointerMemorySize(), and PointerUnmarshall().

◆ EmbeddedComplexMemorySize()

static ULONG EmbeddedComplexMemorySize ( PMIDL_STUB_MESSAGE  pStubMsg,
PFORMAT_STRING  pFormat 
)
static

Definition at line 2827 of file ndr_marshall.c.

2829 {
2831 
2832  if (!m)
2833  {
2834  FIXME("no memorysizer for data type=%02x\n", *pFormat);
2835  return 0;
2836  }
2837 
2838  return m(pStubMsg, pFormat);
2839 }
ULONG(WINAPI * NDR_MEMORYSIZE)(PMIDL_STUB_MESSAGE, PFORMAT_STRING)
Definition: ndr_misc.h:56
const GLfloat * m
Definition: glext.h:10848
#define FIXME(fmt,...)
Definition: debug.h:111
const NDR_MEMORYSIZE NdrMemorySizer[NDR_TABLE_SIZE]
Definition: ndr_marshall.c:304
#define NDR_TABLE_MASK
Definition: ndr_marshall.c:132

Referenced by ComplexStructMemorySize().

◆ EmbeddedComplexSize()

static ULONG EmbeddedComplexSize ( MIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING  pFormat 
)
static

Definition at line 2766 of file ndr_marshall.c.

2768 {
2769  switch (*pFormat) {
2770  case FC_STRUCT:
2771  case FC_PSTRUCT:
2772  case FC_CSTRUCT:
2773  case FC_BOGUS_STRUCT:
2774  case FC_SMFARRAY:
2775  case FC_SMVARRAY:
2776  case FC_CSTRING:
2777  return *(const WORD*)&pFormat[2];
2778  case FC_LGFARRAY:
2779  case FC_LGVARRAY:
2780  return *(const ULONG*)&pFormat[2];
2781  case FC_USER_MARSHAL:
2782  return *(const WORD*)&pFormat[4];
2783  case FC_RANGE: {
2784  switch (((const NDR_RANGE *)pFormat)->flags_type & 0xf) {
2785  case FC_BYTE:
2786  case FC_CHAR:
2787  case FC_SMALL:
2788  case FC_USMALL:
2789  return sizeof(UCHAR);
2790  case FC_WCHAR:
2791  case FC_SHORT:
2792  case FC_USHORT:
2793  return sizeof(USHORT);
2794  case FC_LONG:
2795  case FC_ULONG:
2796  case FC_ENUM32:
2797  return sizeof(ULONG);
2798  case FC_FLOAT:
2799  return sizeof(float);
2800  case FC_DOUBLE:
2801  return sizeof(double);
2802  case FC_HYPER:
2803  return sizeof(ULONGLONG);
2804  case FC_ENUM16:
2805  return sizeof(UINT);
2806  default:
2807  ERR("unknown type 0x%x\n", ((const NDR_RANGE *)pFormat)->flags_type & 0xf);
2809  }
2810  }
2812  pFormat += 2;
2813  pFormat = SkipConformance(pStubMsg, pFormat);
2814  pFormat += *(const SHORT*)pFormat;
2815  return *(const SHORT*)pFormat;
2816  case FC_IP:
2817  return sizeof(void *);
2818  case FC_WSTRING:
2819  return *(const WORD*)&pFormat[2] * 2;
2820  default:
2821  FIXME("unhandled embedded type %02x\n", *pFormat);
2822  }
2823  return 0;
2824 }
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
short SHORT
Definition: pedump.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
uint64_t ULONGLONG
Definition: typedefs.h:66
unsigned short WORD
Definition: ntddk_ex.h:93
static PFORMAT_STRING SkipConformance(const PMIDL_STUB_MESSAGE pStubMsg, const PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:468
unsigned char UCHAR
Definition: xmlstorage.h:181
#define ERR(fmt,...)
Definition: debug.h:110
static float(__cdecl *square_half_float)(float x
unsigned short USHORT
Definition: pedump.c:61
unsigned int UINT
Definition: ndis.h:50
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
unsigned int ULONG
Definition: retypes.h:1

Referenced by ComplexBufferSize(), ComplexFree(), ComplexMarshall(), ComplexStructSize(), and ComplexUnmarshall().

◆ EmbeddedPointerBufferSize()

static void EmbeddedPointerBufferSize ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat 
)
static

Definition at line 1337 of file ndr_marshall.c.

1340 {
1341  unsigned rep, count, stride;
1342  unsigned i;
1343  ULONG saved_buffer_length = 0;
1344 
1345  TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
1346 
1347  if (pStubMsg->IgnoreEmbeddedPointers) return;
1348 
1349  if (*pFormat != FC_PP) return;
1350  pFormat += 2;
1351 
1352  if (pStubMsg->PointerLength)
1353  {
1354  saved_buffer_length = pStubMsg->BufferLength;
1355  pStubMsg->BufferLength = pStubMsg->PointerLength;
1356  pStubMsg->PointerLength = 0;
1357  }
1358 
1359  while (pFormat[0] != FC_END) {
1360  switch (pFormat[0]) {
1361  default:
1362  FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1363  /* fallthrough */
1364  case FC_NO_REPEAT:
1365  rep = 1;
1366  stride = 0;
1367  count = 1;
1368  pFormat += 2;
1369  break;
1370  case FC_FIXED_REPEAT:
1371  rep = *(const WORD*)&pFormat[2];
1372  stride = *(const WORD*)&pFormat[4];
1373  count = *(const WORD*)&pFormat[8];
1374  pFormat += 10;
1375  break;
1376  case FC_VARIABLE_REPEAT:
1377  rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount;
1378  stride = *(const WORD*)&pFormat[2];
1379  count = *(const WORD*)&pFormat[6];
1380  pFormat += 8;
1381  break;
1382  }
1383  for (i = 0; i < rep; i++) {
1384  PFORMAT_STRING info = pFormat;
1385  unsigned char *membase = pMemory + (i * stride);
1386  unsigned u;
1387 
1388  for (u=0; u<count; u++,info+=8) {
1389  unsigned char *memptr = membase + *(const SHORT*)&info[0];
1390  unsigned char *saved_memory = pStubMsg->Memory;
1391 
1392  pStubMsg->Memory = membase;
1393  PointerBufferSize(pStubMsg, *(unsigned char**)memptr, info+4);
1394  pStubMsg->Memory = saved_memory;
1395  }
1396  }
1397  pFormat += 8 * count;
1398  }
1399 
1400  if (saved_buffer_length)
1401  {
1402  pStubMsg->PointerLength = pStubMsg->BufferLength;
1403  pStubMsg->BufferLength = saved_buffer_length;
1404  }
1405 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
static void PointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Pointer, PFORMAT_STRING pFormat)
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int IgnoreEmbeddedPointers
Definition: rpcndr.h:216
short SHORT
Definition: pedump.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
unsigned char * Memory
Definition: rpcndr.h:209
ULONG ActualCount
Definition: rpcndr.h:223
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
ULONG_PTR MaxCount
Definition: rpcndr.h:221
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned short WORD
Definition: ntddk_ex.h:93
ULONG BufferLength
Definition: rpcndr.h:207
unsigned int ULONG
Definition: retypes.h:1
ULONG PointerLength
Definition: rpcndr.h:233

Referenced by array_buffer_size(), NdrConformantStructBufferSize(), NdrConformantVaryingStructBufferSize(), NdrFixedArrayBufferSize(), NdrSimpleStructBufferSize(), and NdrVaryingArrayBufferSize().

◆ EmbeddedPointerFree()

static void EmbeddedPointerFree ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat 
)
static

Definition at line 1480 of file ndr_marshall.c.

1483 {
1484  unsigned rep, count, stride;
1485  unsigned i;
1486 
1487  TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
1488  if (*pFormat != FC_PP) return;
1489  pFormat += 2;
1490 
1491  while (pFormat[0] != FC_END) {
1492  switch (pFormat[0]) {
1493  default:
1494  FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1495  /* fallthrough */
1496  case FC_NO_REPEAT:
1497  rep = 1;
1498  stride = 0;
1499  count = 1;
1500  pFormat += 2;
1501  break;
1502  case FC_FIXED_REPEAT:
1503  rep = *(const WORD*)&pFormat[2];
1504  stride = *(const WORD*)&pFormat[4];
1505  count = *(const WORD*)&pFormat[8];
1506  pFormat += 10;
1507  break;
1508  case FC_VARIABLE_REPEAT:
1509  rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount;
1510  stride = *(const WORD*)&pFormat[2];
1511  count = *(const WORD*)&pFormat[6];
1512  pFormat += 8;
1513  break;
1514  }
1515  for (i = 0; i < rep; i++) {
1516  PFORMAT_STRING info = pFormat;
1517  unsigned char *membase = pMemory + (i * stride);
1518  unsigned u;
1519 
1520  for (u=0; u<count; u++,info+=8) {
1521  unsigned char *memptr = membase + *(const SHORT*)&info[0];
1522  unsigned char *saved_memory = pStubMsg->Memory;
1523 
1524  pStubMsg->Memory = membase;
1525  PointerFree(pStubMsg, *(unsigned char**)memptr, info+4);
1526  pStubMsg->Memory = saved_memory;
1527  }
1528  }
1529  pFormat += 8 * count;
1530  }
1531 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
short SHORT
Definition: pedump.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
unsigned char * Memory
Definition: rpcndr.h:209
ULONG ActualCount
Definition: rpcndr.h:223
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
ULONG_PTR MaxCount
Definition: rpcndr.h:221
static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Pointer, PFORMAT_STRING pFormat)
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned short WORD
Definition: ntddk_ex.h:93

Referenced by array_free(), NdrConformantStructFree(), NdrConformantVaryingStructFree(), NdrFixedArrayFree(), NdrSimpleStructFree(), and NdrVaryingArrayFree().

◆ EmbeddedPointerMarshall()

static unsigned char* EmbeddedPointerMarshall ( PMIDL_STUB_MESSAGE  pStubMsg,
unsigned char pMemory,
PFORMAT_STRING  pFormat 
)
static

Definition at line 1177 of file ndr_marshall.c.

1180 {
1181  unsigned char *Mark = pStubMsg->BufferMark;
1182  unsigned rep, count, stride;
1183  unsigned i;
1184  unsigned char *saved_buffer = NULL;
1185 
1186  TRACE("(%p,%p,%p)\n", pStubMsg, pMemory, pFormat);
1187 
1188  if (*pFormat != FC_PP) return NULL;
1189  pFormat += 2;
1190 
1191  if (pStubMsg->PointerBufferMark)
1192  {
1193  saved_buffer = pStubMsg->Buffer;
1194  pStubMsg->Buffer = pStubMsg->PointerBufferMark;
1195  pStubMsg->PointerBufferMark = NULL;
1196  }
1197 
1198  while (pFormat[0] != FC_END) {
1199  switch (pFormat[0]) {
1200  default:
1201  FIXME("unknown repeat type %d; assuming no repeat\n", pFormat[0]);
1202  /* fallthrough */
1203  case FC_NO_REPEAT:
1204  rep = 1;
1205  stride = 0;
1206  count = 1;
1207  pFormat += 2;
1208  break;
1209  case FC_FIXED_REPEAT:
1210  rep = *(const WORD*)&pFormat[2];
1211  stride = *(const WORD*)&pFormat[4];
1212  count = *(const WORD*)&pFormat[8];
1213  pFormat += 10;
1214  break;
1215  case FC_VARIABLE_REPEAT:
1216  rep = (pFormat[1] == FC_VARIABLE_OFFSET) ? pStubMsg->ActualCount : pStubMsg->MaxCount;
1217  stride = *(const WORD*)&pFormat[2];
1218  count = *(const WORD*)&pFormat[6];
1219  pFormat += 8;
1220  break;
1221  }
1222  for (i = 0; i < rep; i++) {
1223  PFORMAT_STRING info = pFormat;
1224  unsigned char *membase = pMemory + (i * stride);
1225  unsigned char *bufbase = Mark + (i * stride);
1226  unsigned u;
1227 
1228  for (u=0; u<count; u++,info+=8) {
1229  unsigned char *memptr = membase + *(const SHORT*)&info[0];
1230  unsigned char *bufptr = bufbase + *(const SHORT*)&info[2];
1231  unsigned char *saved_memory = pStubMsg->Memory;
1232 
1233  pStubMsg->Memory = membase;
1234  PointerMarshall(pStubMsg, bufptr, *(unsigned char**)memptr, info+4);
1235  pStubMsg->Memory = saved_memory;
1236  }
1237  }
1238  pFormat += 8 * count;
1239  }
1240 
1241  if (saved_buffer)
1242  {
1243  pStubMsg->PointerBufferMark = pStubMsg->Buffer;
1244  pStubMsg->Buffer = saved_buffer;
1245  }
1246 
1247  STD_OVERFLOW_CHECK(pStubMsg);
1248 
1249  return NULL;
1250 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
unsigned char * BufferMark
Definition: rpcndr.h:206
static unsigned int bufptr
Definition: tncon.cpp:77
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned char * Buffer
Definition: rpcndr.h:203
unsigned char * PointerBufferMark
Definition: rpcndr.h:217
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
short SHORT
Definition: pedump.c:59
#define FIXME(fmt,...)
Definition: debug.h:111
unsigned char * Memory
Definition: rpcndr.h:209
smooth NULL
Definition: ftsmooth.c:416
ULONG ActualCount
Definition: rpcndr.h:223
static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Buffer, unsigned char *Pointer, PFORMAT_STRING pFormat)
Definition: ndr_marshall.c:813
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
ULONG_PTR MaxCount
Definition: rpcndr.h:221
static VOID Mark(PGUI_CONSOLE_DATA GuiData)
Definition: conwnd.c:289
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
unsigned short WORD
Definition: ntddk_ex.h:93
#define STD_OVERFLOW_CHECK(_Msg)
Definition: ndr_marshall.c:123

Referenced by array_write_variance_and_marshall(), NdrConformantStructMarshall(), NdrConformantVaryingStructMarshall(), NdrFixedArrayMarshall(), NdrSimpleStructMarshall(), and NdrVaryingArrayMarshall().

◆ EmbeddedPointerMemorySize()