Changeset 126 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Jun 20, 1999, 12:55:37 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r125 r126 1 /* $Id: wprocess.cpp,v 1.1 0 1999-06-19 17:58:33sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.11 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 3 /* … … 28 28 #include "cio.h" 29 29 #include "versionos2.h" /*PLF Wed 98-03-18 02:36:51*/ 30 31 #include <winprocess.h> 32 #include <thread.h> 30 #include <wprocess.h> 33 31 34 32 BOOL fExeStarted = FALSE; … … 43 41 // Set up the TIB selector and memory for the current thread 44 42 //****************************************************************************** 45 voidInitializeTIB(BOOL fMainThread)43 TEB *InitializeTIB(BOOL fMainThread) 46 44 { 47 45 #ifdef WIN32_TIBSEL … … 56 54 dprintf(("InitializeTIB: local thread memory alloc failed!!")); 57 55 DebugInt3(); 58 return ;56 return NULL; 59 57 } 60 58 if(OS2AllocSel(PAGE_SIZE, &tibsel) == FALSE) … … 62 60 dprintf(("InitializeTIB: selector alloc failed!!")); 63 61 DebugInt3(); 64 return ;62 return NULL; 65 63 } 66 64 winteb = (TEB *)OS2SelToFlat(tibsel); … … 69 67 dprintf(("InitializeTIB: DosSelToFlat failed!!")); 70 68 DebugInt3(); 71 return ;69 return NULL; 72 70 } 73 71 memset(winteb, 0, PAGE_SIZE); 74 72 thdb = (THDB *)(winteb+1); 75 TIBFlatPtr = (DWORD )winteb;73 TIBFlatPtr = (DWORD *)winteb; 76 74 77 75 winteb->except = (PVOID)-1; /* 00 Head of exception handling chain */ … … 105 103 ProcessTIBSel = tibsel; 106 104 } 107 SetFS(tibsel); 108 dprintf(("InitializeTIB set up TEB with selector %x", tibsel)); 109 return; 105 dprintf(("InitializeTIB setup TEB with selector %x", tibsel)); 106 return winteb; 107 #else 108 return 0; 110 109 #endif 111 110 } … … 133 132 OS2FreeSel(thdb->teb_sel); 134 133 } 135 else DebugInt3(); 136 134 else dprintf(("Already destroyed TIB")); 135 136 TIBFlatPtr = NULL; 137 137 return; 138 #endif 139 } 140 /******************************************************************************/ 141 /******************************************************************************/ 142 void WIN32API RestoreOS2TIB() 143 { 144 #ifdef WIN32_TIBSEL 145 SHORT orgtibsel; 146 TEB *winteb; 147 THDB *thdb; 148 149 winteb = (TEB *)TIBFlatPtr; 150 if(winteb) { 151 thdb = (THDB *)(winteb+1); 152 orgtibsel = thdb->OrgTIBSel; 153 154 //Restore our original FS selector 155 SetFS(orgtibsel); 156 } 157 #endif 158 } 159 /******************************************************************************/ 160 /******************************************************************************/ 161 void WIN32API SetWin32TIB() 162 { 163 #ifdef WIN32_TIBSEL 164 SHORT win32tibsel; 165 TEB *winteb; 166 THDB *thdb; 167 168 winteb = (TEB *)TIBFlatPtr; 169 if(winteb) { 170 thdb = (THDB *)(winteb+1); 171 win32tibsel = thdb->teb_sel; 172 173 //Restore our win32 FS selector 174 SetFS(win32tibsel); 175 } 176 else DebugInt3(); 138 177 #endif 139 178 } … … 175 214 HINSTANCE hinstance) 176 215 { 177 #ifdef WIN32_TIBSEL 178 SetFS(ProcessTIBSel); 179 #endif 216 SetWin32TIB(); 180 217 181 218 if(getenv("WIN32_IOPL2")) { … … 217 254 //****************************************************************************** 218 255 VOID WIN32API RegisterDll(LONG Win32TableId, LONG NameTableId, 219 LONG VersionResId, LONG Pe2lxVersion,220 HINSTANCE hinstance)256 LONG VersionResId, LONG Pe2lxVersion, 257 HINSTANCE hinstance) 221 258 { 222 259 WIN32DLLENTRY pfnDllEntry; … … 237 274 /* @@@PH 1998/03/17 console devices initialization */ 238 275 iConsoleDevicesRegister(); 276 277 SetWin32TIB(); 278 dprintf(("RegisterDll: FS = %x", GetFS())); 239 279 } 240 280 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.