1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

rpcrt4: Unmarshal into a stack pointer on the server side if possible.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-10-16 18:49:54 -05:00 committed by Alexandre Julliard
parent 3efe54f66d
commit 5fae77e4db
2 changed files with 7 additions and 6 deletions

View file

@ -944,7 +944,10 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
* setting the pointer to the buffer, if possible, or set fMustAlloc to
* TRUE. */
if (attr & FC_POINTER_DEREF) {
fMustAlloc = TRUE;
if (pSrcPointer && (attr & FC_ALLOCED_ON_STACK))
*pPointer = pSrcPointer;
else
fMustAlloc = TRUE;
} else {
*current_ptr = NULL;
}

View file

@ -437,7 +437,6 @@ todo_wine
ptr = NdrPointerUnmarshall( &StubMsg, &mem, formattypes, 0 );
ok(ptr == NULL, "%s: ret %p\n", msgpfx, ptr);
if ((formattypes[1] & FC_ALLOCED_ON_STACK) && (formattypes[1] & FC_POINTER_DEREF))
todo_wine
ok(mem == mem_orig, "%s: mem has changed %p %p\n", msgpfx, mem, mem_orig);
else
ok(mem != mem_orig, "%s: mem has not changed\n", msgpfx);
@ -849,10 +848,9 @@ static void test_nontrivial_pointer_types(void)
*(void **)mem = NULL;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerUnmarshall( &StubMsg, &mem, &fmtstr_ref_unique_out[4], 0);
todo_wine {
ok(mem == mem_orig, "mem alloced\n");
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
}
ok(mem == mem_orig, "mem alloced\n");
todo_wine
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
my_alloc_called = 0;
mem = mem_orig;