Changeset 7828 for trunk/src/kernel32/thread.cpp
- Timestamp:
- Feb 7, 2002, 12:19:13 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/thread.cpp
r7769 r7828 1 /* $Id: thread.cpp,v 1.4 1 2002-01-13 21:42:43 sandervl Exp $ */1 /* $Id: thread.cpp,v 1.42 2002-02-07 11:19:13 sandervl Exp $ */ 2 2 3 3 /* … … 279 279 EXCEPTION_FRAME exceptFrame; 280 280 Win32Thread *me = (Win32Thread *)lpData; 281 ULONG winthread= (ULONG)me->pCallback;281 ULONG threadCallback = (ULONG)me->pCallback; 282 282 LPVOID userdata = me->lpUserData; 283 283 HANDLE hThread = me->hThread; … … 295 295 winteb->flags = me->dwFlags; 296 296 297 winteb->entry_point = (void *) winthread;297 winteb->entry_point = (void *)threadCallback; 298 298 winteb->entry_arg = (void *)userdata; 299 299 winteb->o.odin.hThread = hThread; … … 308 308 winteb->o.odin.exceptFrame = (ULONG)&exceptFrame; 309 309 310 SetWin32TIB(); 310 //Determine if thread callback is inside a PE dll; if true, then force 311 //switch to win32 TIB (FS selector) 312 //(necessary for Opera when loading win32 plugins that create threads) 313 Win32DllBase *dll; 314 dll = Win32DllBase::findModuleByAddr(threadCallback); 315 if(dll && dll->isPEImage()) { 316 dprintf(("Win32ThreadProc: Force win32 TIB switch")); 317 SetWin32TIB(TIB_SWITCH_FORCE_WIN32); 318 } 319 else SetWin32TIB(TIB_SWITCH_DEFAULT); //executable type determines whether or not FS is changed 311 320 312 321 DWORD dwProcessAffinityMask, dwSystemAffinityMask; … … 323 332 //Set FPU control word to 0x27F (same as in NT) 324 333 CONTROL87(0x27F, 0xFFF); 325 rc = AsmCallThreadHandler( winthread, userdata);334 rc = AsmCallThreadHandler(threadCallback, userdata); 326 335 327 336 if(fExitProcess) { … … 334 343 Win32DllBase::tlsDetachThreadFromAllDlls(); //destroy TLS structures of all dlls 335 344 if(WinExe) WinExe->tlsDetachThread(); //destroy TLS structure of main exe 336 DestroyTIB(); 345 DestroyTIB(); //destroys TIB and restores FS 337 346 OS2UnsetExceptionHandler((void *)&exceptFrame); 338 347 }
Note:
See TracChangeset
for help on using the changeset viewer.