Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index a645a24..9e434a5 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -216,6 +216,9 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) default: FIXME("Unhandled type %02x\n", *pFormat); /* fallthrough */ + case FC_UP: + case FC_OP: + case FC_FP: case FC_IP: size = sizeof(void *); break;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 9e434a5..18ce74d 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -156,8 +156,7 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) case FC_RP: if (pFormat[1] & FC_SIMPLE_POINTER) { - FIXME("Simple reference pointer (type %#x).\n", pFormat[2]); - size = sizeof(void *); + size = 0; break; } size = calc_arg_size(pStubMsg, &pFormat[2] + *(const SHORT*)&pFormat[2]);
Signed-off-by: Huw Davies huw@codeweavers.com
Avoids an unhandled exception. Passing NULL as a ref pointer (which a top-level [out] parameter necessarily is) is illegal, but this will be caught in the CALCSIZE pass. This matches midl/widl behaviour in the -Os case.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 18ce74d..6a65a14 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -422,6 +422,11 @@ static void client_free_handle( } }
+static inline BOOL param_needs_alloc( PARAM_ATTRIBUTES attr ) +{ + return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue; +} + void client_do_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, void **fpu_args, unsigned short number_of_params, unsigned char *pRetVal ) { @@ -453,11 +458,8 @@ void client_do_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum s switch (phase) { case STUBLESS_INITOUT: - if (!params[i].attr.IsBasetype && params[i].attr.IsOut && - !params[i].attr.IsIn && !params[i].attr.IsByValue) - { + if (param_needs_alloc(params[i].attr) && *(unsigned char **)pArg) memset( *(unsigned char **)pArg, 0, calc_arg_size( pStubMsg, pTypeFormat )); - } break; case STUBLESS_CALCSIZE: if (params[i].attr.IsSimpleRef && !*(unsigned char **)pArg) @@ -1138,11 +1140,6 @@ LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, uns } #endif
-static inline BOOL param_needs_alloc( PARAM_ATTRIBUTES attr ) -{ - return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue; -} - static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, unsigned short number_of_params)
Signed-off-by: Huw Davies huw@codeweavers.com