msvcrt: Fixed RTTI base pointer calculation if signature==0.

oldstable
Piotr Caban 2012-09-13 13:29:29 +02:00 committed by Alexandre Julliard
parent a982933869
commit f4e323baa4
1 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ static void dump_obj_locator( const rtti_object_locator *ptr )
static void dump_obj_locator( const rtti_object_locator *ptr )
{
int i;
char *base = ptr->signature == 0 ? (char*)GetModuleHandleW(NULL) : (char*)ptr - ptr->object_locator;
char *base = ptr->signature == 0 ? (char*)RtlPcToFileHeader((void*)ptr, (void**)&base) : (char*)ptr - ptr->object_locator;
const rtti_object_hierarchy *h = (const rtti_object_hierarchy*)(base + ptr->type_hierarchy);
const type_info *type_descriptor = (const type_info*)(base + ptr->type_descriptor);
@ -887,7 +887,7 @@ const type_info* CDECL MSVCRT___RTtypeid(void *cppobj)
char *base;
if(obj_locator->signature == 0)
base = (char*)GetModuleHandleW(NULL);
base = (char*)RtlPcToFileHeader((void*)obj_locator, (void**)&base);
else
base = (char*)obj_locator - obj_locator->object_locator;
@ -1015,7 +1015,7 @@ void* CDECL MSVCRT___RTDynamicCast(void *cppobj, int unknown,
if (TRACE_ON(msvcrt)) dump_obj_locator(obj_locator);
if(obj_locator->signature == 0)
base = (char*)GetModuleHandleW(NULL);
base = (char*)RtlPcToFileHeader((void*)obj_locator, (void**)&base);
else
base = (char*)obj_locator - obj_locator->object_locator;