From 7ebbdf5274120bbe960c962381a70e9e94fff6c0 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Tue, 13 Nov 2007 19:32:36 +0000 Subject: [PATCH] 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 svn path=/trunk/; revision=30427 --- reactos/dll/win32/opengl32/opengl32.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/opengl32/opengl32.c b/reactos/dll/win32/opengl32/opengl32.c index e9a6e3e398e..32edcdc745e 100644 --- a/reactos/dll/win32/opengl32/opengl32.c +++ b/reactos/dll/win32/opengl32/opengl32.c @@ -29,7 +29,8 @@ static DWORD OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd ); /* 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 @@ OPENGL32_ProcessAttach() 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 @@ OPENGL32_ProcessDetach() CloseHandle( OPENGL32_processdata.dcdata_mutex ); /* free TLS */ - if (OPENGL32_tls != 0xffffffff) + if (OPENGL32_tls != -1) TlsFree(OPENGL32_tls); }