Commit 11eb8ee0 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: If the number of pointers is 0 for NdrFullPointerXlatInit then

set the number of pointers to a large default, so that NumberOfBuckets doesn't end up less than zero.
parent ff9fd9c4
......@@ -32,11 +32,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc);
PFULL_PTR_XLAT_TABLES WINAPI NdrFullPointerXlatInit(unsigned long NumberOfPointers,
XLAT_SIDE XlatSide)
{
unsigned long NumberOfBuckets = ((NumberOfPointers + 3) & 4) - 1;
unsigned long NumberOfBuckets;
PFULL_PTR_XLAT_TABLES pXlatTables = HeapAlloc(GetProcessHeap(), 0, sizeof(*pXlatTables));
TRACE("(%ld, %d)\n", NumberOfPointers, XlatSide);
if (!NumberOfPointers) NumberOfPointers = 512;
NumberOfBuckets = ((NumberOfPointers + 3) & ~3) - 1;
pXlatTables->RefIdToPointer.XlatTable =
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(void *) * NumberOfPointers);
......
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