Changeset 125 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Jun 19, 1999, 7:58:50 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r123 r125 1 /* $Id: wprocess.cpp,v 1. 9 1999-06-19 13:57:51sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.10 1999-06-19 17:58:33 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 PDB ProcessPDB = {0}; 39 39 USHORT ProcessTIBSel = 0; 40 USHORT OS2Selector = 0; 41 42 //#define WIN32_TIBSEL 40 DWORD *TIBFlatPtr = 0; 41 43 42 //****************************************************************************** 44 43 // Set up the TIB selector and memory for the current thread … … 52 51 USHORT tibsel; 53 52 53 //Allocate one dword to store the flat address of our TEB 54 TIBFlatPtr = (DWORD *)OS2AllocThreadLocalMemory(1); 55 if(TIBFlatPtr == 0) { 56 dprintf(("InitializeTIB: local thread memory alloc failed!!")); 57 DebugInt3(); 58 return; 59 } 54 60 if(OS2AllocSel(PAGE_SIZE, &tibsel) == FALSE) 55 61 { … … 66 72 } 67 73 memset(winteb, 0, PAGE_SIZE); 68 thdb = (THDB *)(winteb+1); 74 thdb = (THDB *)(winteb+1); 75 TIBFlatPtr = (DWORD)winteb; 69 76 70 77 winteb->except = (PVOID)-1; /* 00 Head of exception handling chain */ … … 83 90 thdb->exit_code = 0x103; /* STILL_ACTIVE */ 84 91 thdb->teb_sel = tibsel; 92 thdb->OrgTIBSel = GetFS(); 85 93 86 94 if(OS2GetPIB(PIB_TASKTYPE) == TASKTYPE_PM) … … 96 104 //TLS in executable always TLS index 0? 97 105 ProcessTIBSel = tibsel; 98 OS2Selector = GetFS(); //0x150b99 106 } 100 107 SetFS(tibsel); … … 108 115 void DestroyTIB() 109 116 { 117 #ifdef WIN32_TIBSEL 118 SHORT orgtibsel; 119 TEB *winteb; 120 THDB *thdb; 121 110 122 dprintf(("DestroyTIB: FS = %x", GetFS())); 111 #ifdef WIN32_TIBSEL 112 OS2FreeSel(ProcessTIBSel); 123 124 winteb = (TEB *)TIBFlatPtr; 125 if(winteb) { 126 thdb = (THDB *)(winteb+1); 127 orgtibsel = thdb->OrgTIBSel; 128 129 //Restore our original FS selector 130 SetFS(orgtibsel); 131 132 //And free our own 133 OS2FreeSel(thdb->teb_sel); 134 } 135 else DebugInt3(); 136 113 137 return; 114 138 #endif … … 254 278 #ifdef WIN32_TIBSEL 255 279 //Restore original OS/2 TIB selector 256 SetFS(OS2Selector);280 DestroyTIB(); 257 281 #endif 258 282
Note:
See TracChangeset
for help on using the changeset viewer.