rpcrt4: Add support for ServerAllocSize parameters.

This commit is contained in:
Rob Shearman 2007-06-25 14:21:55 +01:00 committed by Alexandre Julliard
parent 73c31ed309
commit a1dca20dd7
1 changed files with 9 additions and 5 deletions

View File

@ -1339,10 +1339,6 @@ LONG WINAPI NdrStubCall2(
TRACE("\tstack_offset: 0x%x\n", current_stack_offset); TRACE("\tstack_offset: 0x%x\n", current_stack_offset);
TRACE("\tmemory addr (before): %p -> %p\n", pArg, *(unsigned char **)pArg); TRACE("\tmemory addr (before): %p -> %p\n", pArg, *(unsigned char **)pArg);
if (pParam->param_attributes.ServerAllocSize)
FIXME("ServerAllocSize of %d ignored for parameter %d\n",
pParam->param_attributes.ServerAllocSize * 8, i);
if (pParam->param_attributes.IsBasetype) if (pParam->param_attributes.IsBasetype)
{ {
const unsigned char *pTypeFormat = const unsigned char *pTypeFormat =
@ -1360,9 +1356,12 @@ LONG WINAPI NdrStubCall2(
else else
call_marshaller(&stubMsg, pArg, pTypeFormat); call_marshaller(&stubMsg, pArg, pTypeFormat);
} }
/* FIXME: call call_freer here */
break; break;
case STUBLESS_UNMARSHAL: case STUBLESS_UNMARSHAL:
if (pParam->param_attributes.ServerAllocSize)
*(void **)pArg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
pParam->param_attributes.ServerAllocSize * 8);
if (pParam->param_attributes.IsIn) if (pParam->param_attributes.IsIn)
{ {
if (pParam->param_attributes.IsSimpleRef) if (pParam->param_attributes.IsSimpleRef)
@ -1417,6 +1416,10 @@ LONG WINAPI NdrStubCall2(
/* FIXME: call call_freer here for IN types */ /* FIXME: call call_freer here for IN types */
break; break;
case STUBLESS_UNMARSHAL: case STUBLESS_UNMARSHAL:
if (pParam->param_attributes.ServerAllocSize)
*(void **)pArg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
pParam->param_attributes.ServerAllocSize * 8);
if (pParam->param_attributes.IsIn) if (pParam->param_attributes.IsIn)
{ {
if (pParam->param_attributes.IsByValue) if (pParam->param_attributes.IsByValue)
@ -1425,6 +1428,7 @@ LONG WINAPI NdrStubCall2(
call_unmarshaller(&stubMsg, (unsigned char **)pArg, pTypeFormat, 0); call_unmarshaller(&stubMsg, (unsigned char **)pArg, pTypeFormat, 0);
} }
else if (pParam->param_attributes.IsOut && else if (pParam->param_attributes.IsOut &&
!pParam->param_attributes.ServerAllocSize &&
!pParam->param_attributes.IsByValue) !pParam->param_attributes.IsByValue)
{ {
DWORD size = calc_arg_size(&stubMsg, pTypeFormat); DWORD size = calc_arg_size(&stubMsg, pTypeFormat);