Changeset 4481 for trunk/src/kernel32/wintls.cpp
- Timestamp:
- Oct 11, 2000, 9:22:29 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wintls.cpp
r4459 r4481 1 /* $Id: wintls.cpp,v 1.1 4 2000-10-08 20:05:05sandervl Exp $ */1 /* $Id: wintls.cpp,v 1.15 2000-10-11 07:22:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 TLS API functions … … 87 87 *tlsIndexAddr = tlsIndex; 88 88 89 if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) { 89 if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) 90 { 90 91 pCallback = tlsCallBackAddr; 91 92 while(*pCallback) { … … 95 96 96 97 dprintf(("tlsAttachThread: finished calling TLS Callback %x", *pCallback)); 97 *pCallback++;98 pCallback++; 98 99 } 99 100 } … … 113 114 dprintf(("Win32ImageBase::tlsDetachThread for module %x, thread id %x", hinstance, GetCurrentThreadId())); 114 115 115 if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) { 116 if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) 117 { 116 118 pCallback = tlsCallBackAddr; 117 119 while(*pCallback) { … … 121 123 122 124 dprintf(("tlsDetachThread: finished calling TLS Callback %x", *pCallback)); 123 *pCallback++;125 pCallback++; 124 126 } 125 127 } … … 135 137 //****************************************************************************** 136 138 //****************************************************************************** 137 138 //******************************************************************************139 //******************************************************************************140 139 DWORD WIN32API TlsAlloc() 141 140 { 142 141 DWORD index = -1; 143 144 #if 1145 142 THDB *thdb; 146 143 PDB *pdb; … … 171 168 LeaveCriticalSection(&pdb->crit_section); 172 169 thdb->tls_array[index] = 0; 173 #else 174 index = O32_TlsAlloc(); 175 #endif 170 176 171 dprintf(("KERNEL32: TlsAlloc returned %d", index)); 177 172 return index; … … 181 176 BOOL WIN32API TlsFree(DWORD index) 182 177 { 183 dprintf(("KERNEL32: TlsFree %d", index));184 #if 1185 178 THDB *thdb; 186 179 PDB *pdb; … … 188 181 DWORD mask; 189 182 183 dprintf(("KERNEL32: TlsFree %d", index)); 190 184 if(index >= TLS_MINIMUM_AVAILABLE) 191 185 { … … 200 194 tlsidx = 0; 201 195 if(index > 32) { 202 tlsidx++;196 tlsidx++; 203 197 } 204 198 mask = (1 << index); … … 213 207 SetLastError(ERROR_INVALID_PARAMETER); //TODO: correct error? (does NT even change the last error?) 214 208 return FALSE; 215 #else216 return(O32_TlsFree(index));217 #endif218 209 } 219 210 //****************************************************************************** … … 222 213 { 223 214 LPVOID rc; 215 THDB *thdb; 224 216 225 217 if(index >= TLS_MINIMUM_AVAILABLE) … … 230 222 SetLastError(ERROR_SUCCESS); 231 223 232 #if 1233 THDB *thdb;234 235 224 thdb = GetThreadTHDB(); 236 225 rc = thdb->tls_array[index]; 237 #else 238 rc = O32_TlsGetValue(index); 239 #endif 226 240 227 dprintf2(("KERNEL32: TlsGetValue %d returned %X\n", index, rc)); 241 228 return(rc); … … 245 232 BOOL WIN32API TlsSetValue(DWORD index, LPVOID val) 246 233 { 234 THDB *thdb; 235 247 236 dprintf2(("KERNEL32: TlsSetValue %d %x", index, val)); 248 237 if(index >= TLS_MINIMUM_AVAILABLE) … … 252 241 } 253 242 SetLastError(ERROR_SUCCESS); 254 #if 1255 THDB *thdb;256 243 257 244 thdb = GetThreadTHDB(); 258 245 thdb->tls_array[index] = val; 259 246 return TRUE; 260 #else 261 return(O32_TlsSetValue(index, val)); 262 #endif 263 } 264 //****************************************************************************** 265 //****************************************************************************** 247 } 248 //****************************************************************************** 249 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.