- Free parameters allocated by application before anything else.
See CORE-8200 #comment committed in r63605, waiting for wine to accept it before closing.

svn path=/trunk/; revision=63605
This commit is contained in:
Jérôme Gardou 2014-06-16 16:31:06 +00:00
parent f5d1d7e5b1
commit c1b41411c2

View file

@ -1079,6 +1079,19 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
unsigned int i;
LONG_PTR *retval_ptr = NULL;
if (phase == STUBLESS_FREE)
{
/* Process the params allocated by the application first */
for (i = 0; i < number_of_params; i++)
{
unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
if (params[i].attr.MustFree)
{
call_freer(pStubMsg, pArg, &params[i]);
}
}
}
for (i = 0; i < number_of_params; i++)
{
unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset;
@ -1096,11 +1109,7 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
call_marshaller(pStubMsg, pArg, &params[i]);
break;
case STUBLESS_FREE:
if (params[i].attr.MustFree)
{
call_freer(pStubMsg, pArg, &params[i]);
}
else if (params[i].attr.ServerAllocSize)
if (params[i].attr.ServerAllocSize)
{
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
}