Commit 7af506b2 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Fix NdrFullPointerQueryRefId to make more tests pass.

parent 767631d8
...@@ -145,8 +145,17 @@ int WINAPI NdrFullPointerQueryRefId(PFULL_PTR_XLAT_TABLES pXlatTables, ...@@ -145,8 +145,17 @@ int WINAPI NdrFullPointerQueryRefId(PFULL_PTR_XLAT_TABLES pXlatTables,
expand_pointer_table_if_necessary(pXlatTables, RefId); expand_pointer_table_if_necessary(pXlatTables, RefId);
pXlatTables->NextRefId = max(RefId + 1, pXlatTables->NextRefId);
if (pXlatTables->RefIdToPointer.NumberOfEntries > RefId) if (pXlatTables->RefIdToPointer.NumberOfEntries > RefId)
{
*ppPointer = pXlatTables->RefIdToPointer.XlatTable[RefId]; *ppPointer = pXlatTables->RefIdToPointer.XlatTable[RefId];
if (QueryType)
return pXlatTables->RefIdToPointer.StateTable[RefId];
else
return 0;
}
*ppPointer = NULL;
return 0; return 0;
} }
......
...@@ -762,21 +762,17 @@ static void test_fullpointer_xlat(void) ...@@ -762,21 +762,17 @@ static void test_fullpointer_xlat(void)
ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 1, &RefId); ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 1, &RefId);
ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret); ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret);
todo_wine { ok(RefId == 0x3, "RefId should be 0x3 instead of 0x%lx\n", RefId);
ok(RefId == 0x3, "RefId should be 0x1 instead of 0x%lx\n", RefId);
}
ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 1, &RefId); ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 1, &RefId);
ok(ret == 1, "ret should be 1 instead of 0x%x\n", ret); ok(ret == 1, "ret should be 1 instead of 0x%x\n", ret);
todo_wine { ok(RefId == 0x3, "RefId should be 0x3 instead of 0x%lx\n", RefId);
ok(RefId == 0x3, "RefId should be 0x1 instead of 0x%lx\n", RefId);
}
ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 0, &RefId); ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebeef, 0, &RefId);
todo_wine { todo_wine {
ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret); ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret);
ok(RefId == 0x3, "RefId should be 0x1 instead of 0x%lx\n", RefId);
} }
ok(RefId == 0x3, "RefId should be 0x3 instead of 0x%lx\n", RefId);
ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebabe, 0, &RefId); ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xcafebabe, 0, &RefId);
ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret); ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret);
...@@ -784,9 +780,7 @@ static void test_fullpointer_xlat(void) ...@@ -784,9 +780,7 @@ static void test_fullpointer_xlat(void)
ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xdeadbeef, 0, &RefId); ret = NdrFullPointerQueryPointer(pXlatTables, (void *)0xdeadbeef, 0, &RefId);
ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret); ok(ret == 0, "ret should be 0 instead of 0x%x\n", ret);
todo_wine {
ok(RefId == 0x4, "RefId should be 0x4 instead of 0x%lx\n", RefId); ok(RefId == 0x4, "RefId should be 0x4 instead of 0x%lx\n", RefId);
}
/* "freeing" phase */ /* "freeing" phase */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment