Author: greatlrd Date: Tue Nov 13 22:32:36 2007 New Revision: 30427
URL: http://svn.reactos.org/svn/reactos?rev=30427&view=rev Log: Bugfix : Do not assume unini value ( OPENGL32_tls ) are set to -1 (0xFFFFFFFF), do not assume DWORD always will be 32bits convert all 0xFFFFFFFF value for OPENGL32_tls to -1
Modified: trunk/reactos/dll/win32/opengl32/opengl32.c
Modified: trunk/reactos/dll/win32/opengl32/opengl32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32... ============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.c (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.c Tue Nov 13 22:32:36 2007 @@ -29,7 +29,8 @@
/* global vars */ -DWORD OPENGL32_tls; +/* Do not assume it have the free value -1 set, any value can be in here */ +DWORD OPENGL32_tls = -1; GLPROCESSDATA OPENGL32_processdata;
@@ -110,7 +111,7 @@ TRUE /* bInheritHandle */ };
OPENGL32_tls = TlsAlloc(); - if (0xFFFFFFFF == OPENGL32_tls) + if (-1 == OPENGL32_tls) return FALSE;
memset( &OPENGL32_processdata, 0, sizeof (OPENGL32_processdata) ); @@ -186,7 +187,7 @@ CloseHandle( OPENGL32_processdata.dcdata_mutex );
/* free TLS */ - if (OPENGL32_tls != 0xffffffff) + if (OPENGL32_tls != -1) TlsFree(OPENGL32_tls); }