rpcrt4: Don't call VirtualFree with MEM_RELEASE and non-zero size.

The calls fail with ERROR_INVALID_PARAMETER. Instead just call with a
zero size which performs the intended function.
This commit is contained in:
Rob Shearman 2008-09-23 13:31:54 +01:00 committed by Alexandre Julliard
parent 2f10cc5c28
commit 62a1beebbf
1 changed files with 2 additions and 6 deletions

View File

@ -221,9 +221,7 @@ void create_delegating_vtbl(DWORD num_methods)
if(current_vtbl.table && current_vtbl.table->ref == 0)
{
TRACE("freeing old table\n");
VirtualFree(current_vtbl.table->methods,
(current_vtbl.table->size - 3) * sizeof(vtbl_method_t),
MEM_RELEASE);
VirtualFree(current_vtbl.table->methods, 0, MEM_RELEASE);
HeapFree(GetProcessHeap(), 0, current_vtbl.table);
}
size = (num_methods - 3) * sizeof(vtbl_method_t);
@ -258,9 +256,7 @@ static void release_delegating_vtbl(IUnknownVtbl *vtbl)
if(table->ref == 0 && table != current_vtbl.table)
{
TRACE("... and we're not current so free'ing\n");
VirtualFree(current_vtbl.table->methods,
(current_vtbl.table->size - 3) * sizeof(vtbl_method_t),
MEM_RELEASE);
VirtualFree(current_vtbl.table->methods, 0, MEM_RELEASE);
HeapFree(GetProcessHeap(), 0, table);
}
LeaveCriticalSection(&delegating_vtbl_section);