summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1f0f4f6)
- use well defined macro instead of weird pointer calculation
- reset thread specific data on a thread detach call
Fixes crash in heroes 3 and probably others
svn path=/trunk/; revision=51019
PROC dispatch_table[812]; /*!< Table containing \a num_funcs pointers to OpenGL functions */
} ICDTable, *PICDTable;
PROC dispatch_table[812]; /*!< Table containing \a num_funcs pointers to OpenGL functions */
} ICDTable, *PICDTable;
+#define DISPATCH_TABLE_SIZE 812*sizeof(PROC)
+
#endif /* OPENGL32_PRIVATE_ICDTABLE_H */
/* EOF */
#endif /* OPENGL32_PRIVATE_ICDTABLE_H */
/* EOF */
dispatchTable = (PROC*)HeapAlloc( GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
dispatchTable = (PROC*)HeapAlloc( GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
- sizeof (((ICDTable *)(0))->dispatch_table) );
if (dispatchTable == NULL)
{
DBGPRINT( "Error: Couldn't allocate GL dispatch table" );
if (dispatchTable == NULL)
{
DBGPRINT( "Error: Couldn't allocate GL dispatch table" );
GetLastError() );
lpData = NULL;
}
GetLastError() );
lpData = NULL;
}
+ TlsSetValue( OPENGL32_tls, NULL );
if (teb->glTable != NULL)
{
if (teb->glTable != NULL)
{
/* save table */
size = sizeof (PROC) * table->num_funcs;
memcpy( tebTable, table->dispatch_table, size );
/* save table */
size = sizeof (PROC) * table->num_funcs;
memcpy( tebTable, table->dispatch_table, size );
- memset( tebTable + table->num_funcs, 0,
- sizeof (table->dispatch_table) - size );
+ memset( tebTable + table->num_funcs, 0, DISPATCH_TABLE_SIZE - size );
}
else
{
DBGPRINT( "Unsetting current context" );
}
else
{
DBGPRINT( "Unsetting current context" );
- memset( tebTable, 0, sizeof (table->dispatch_table) );
+ memset( tebTable, 0, DISPATCH_TABLE_SIZE );
}
/* put in empty functions as long as we dont have a fallback */
}
/* put in empty functions as long as we dont have a fallback */