- Timestamp:
- Jun 20, 1999, 12:55:37 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r115 r126 1 ; $Id: KERNEL32.DEF,v 1.1 1 1999-06-17 22:06:10 phallerExp $1 ; $Id: KERNEL32.DEF,v 1.12 1999-06-20 10:55:35 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 964 964 GetFS = GetFS @1226 965 965 SetFS = SetFS @1227 966 967 RestoreOS2TIB = _RestoreOS2TIB@0 @1228 968 SetWin32TIB = _SetWin32TIB@0 @1229 -
trunk/src/kernel32/conwin.h
r111 r126 1 /* $Id: conwin.h,v 1. 1 1999-06-17 18:22:43 phallerExp $ */1 /* $Id: conwin.h,v 1.2 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 3 #ifndef _CONWIN_H_ 4 4 #define _CONWIN_H_ 5 6 #ifndef _FILETIME_7 #define _FILETIME_8 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */9 typedef struct10 {11 DWORD dwLowDateTime;12 DWORD dwHighDateTime;13 } FILETIME, *LPFILETIME;14 #endif /* _FILETIME_ */15 16 typedef struct17 {18 int dwFileAttributes;19 FILETIME ftCreationTime;20 FILETIME ftLastAccessTime;21 FILETIME ftLastWriteTime;22 int dwVolumeSerialNumber;23 int nFileSizeHigh;24 int nFileSizeLow;25 int nNumberOfLinks;26 int nFileIndexHigh;27 int nFileIndexLow;28 } BY_HANDLE_FILE_INFORMATION ;29 30 31 #define OFS_MAXPATHNAME 12832 typedef struct33 {34 BYTE cBytes;35 BYTE fFixedDisk;36 WORD nErrCode;37 BYTE reserved[4];38 BYTE szPathName[OFS_MAXPATHNAME];39 } OFSTRUCT, *LPOFSTRUCT;40 41 42 /* The security attributes structure */43 typedef struct44 {45 DWORD nLength;46 LPVOID lpSecurityDescriptor;47 BOOL bInheritHandle;48 } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;49 5 50 6 #ifndef INVALID_HANDLE_VALUE -
trunk/src/kernel32/except.h
r123 r126 1 /* $Id: except.h,v 1. 4 1999-06-19 13:57:51sandervl Exp $ */1 /* $Id: except.h,v 1.5 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 15 15 //SvL: Replace original startup code exception handler 16 #ifndef WIN32_TIBSEL 16 17 void ReplaceExceptionHandler(void); 18 void ChangeTIBStack(); 19 #endif 20 void __cdecl SetExceptionChain(DWORD); 21 17 22 void DisableFPUExceptions(); 18 void __cdecl SetExceptionChain(DWORD);19 void ChangeTIBStack();20 23 ULONG GetDllEntryPoint(); 21 24 -
trunk/src/kernel32/initterm.cpp
r123 r126 1 /* $Id: initterm.cpp,v 1. 4 1999-06-19 13:57:51sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.5 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 3 /* … … 34 34 #include <misc.h> 35 35 #include <wprocess.h> 36 #include <handlemanager.h> 36 37 37 38 extern "C" { … … 130 131 131 132 InitializeTIB(TRUE); 133 //SvL: Do it here instead of during the exe object creation 134 //(std handles can be used in win32 dll initialization routines 135 HMInitialize(); /* store standard handles within HandleManager */ 132 136 break; 133 137 case 1 : -
trunk/src/kernel32/kernel32exp.def
r100 r126 1 ; $Id: kernel32exp.def,v 1. 4 1999-06-10 20:47:59 phallerExp $1 ; $Id: kernel32exp.def,v 1.5 1999-06-20 10:55:36 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 830 830 GetFS @1226 831 831 SetFS @1227 832 _RestoreOS2TIB@0 @1228 833 _SetWin32TIB@0 @1229 -
trunk/src/kernel32/makefile
r125 r126 1 # $Id: makefile,v 1. 7 1999-06-19 17:58:32sandervl Exp $1 # $Id: makefile,v 1.8 1999-06-20 10:55:36 sandervl Exp $ 2 2 3 3 # … … 95 95 $(PDWIN32_INCLUDE)\unicode.h \ 96 96 heap.h \ 97 wprocess.h \97 $(PDWIN32_INCLUDE)\wprocess.h \ 98 98 os2util.h \ 99 99 $(PDWIN32_INCLUDE)\nameid.h … … 232 232 lfile.OBJ: \ 233 233 .\lfile.cpp \ 234 wprocess.h \234 $(PDWIN32_INCLUDE)\wprocess.h \ 235 235 os2util.h 236 236 -
trunk/src/kernel32/thread.H
r125 r126 1 /* $Id: thread.H,v 1. 4 1999-06-19 17:58:33sandervl Exp $ */1 /* $Id: thread.H,v 1.5 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 /*4 *5 * Project Odin Software License can be found in LICENSE.TXT6 *7 */8 3 /* 9 4 * Win32 Thread API functions 10 5 * 11 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) 7 * 8 * 9 * Project Odin Software License can be found in LICENSE.TXT 12 10 * 13 11 */ -
trunk/src/kernel32/thread.cpp
r125 r126 1 /* $Id: thread.cpp,v 1. 5 1999-06-19 17:58:33sandervl Exp $ */1 /* $Id: thread.cpp,v 1.6 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 /*4 *5 * Project Odin Software License can be found in LICENSE.TXT6 *7 */8 3 /* 9 4 * Win32 Thread API functions 10 5 * 11 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) 7 * 8 * 9 * Project Odin Software License can be found in LICENSE.TXT 12 10 * 13 11 */ … … 161 159 162 160 #ifdef WIN32_TIBSEL 161 TEB *winteb = (TEB *)InitializeTIB(); 162 if(winteb == NULL) { 163 dprintf(("Win32ThreadProc: InitializeTIB failed!!")); 164 DebugInt3(); 165 return 0; 166 } 167 winteb->flags = me->dwFlags; 168 169 THDB *thdb = (THDB *)(winteb+1); 170 thdb->entry_point = (void *)winthread; 171 thdb->entry_arg = (void *)userdata; 172 SetWin32TIB(); 163 173 #else 164 174 ReplaceExceptionHandler(); -
trunk/src/kernel32/winexe.cpp
r120 r126 1 /* $Id: winexe.cpp,v 1. 6 1999-06-19 10:54:43sandervl Exp $ */1 /* $Id: winexe.cpp,v 1.7 1999-06-20 10:55:36 sandervl Exp $ */ 2 2 3 3 /* … … 21 21 #include <iostream.h> 22 22 #include <fstream.h> 23 #include "misc.h"24 #include "nameid.h"25 #include "win32type.h"23 #include <misc.h> 24 #include <nameid.h> 25 #include <win32type.h> 26 26 #include <winexe.h> 27 #include "wprocess.h"28 #include "pefile.h"27 #include <wprocess.h> 28 #include <pefile.h> 29 29 #include "cio.h" 30 30 31 31 #include "conwin.h" // Windows Header for console only 32 32 #include "console.h" 33 #include "handlemanager.h"34 35 33 36 34 Win32Exe *WinExe = NULL; … … 46 44 dprintf(("Win32Exe ctor: %s", szFileName)); 47 45 48 HMInitialize(); /* store standard handles within HandleManager */49 dprintf(("KERNEL32/WINEXE: HandleManager Initialized.\n"));50 46 if(fConsoleApp) { 51 47 dprintf(("Console application!\n")); … … 62 58 fConsoleApp(FALSE), cmdline(NULL), OS2InstanceHandle(-1) 63 59 { 64 HMInitialize(); /* store standard handles within HandleManager */65 dprintf(("KERNEL32/WINEXE: HandleManager Initialized.\n"));66 67 60 if(GET_CONSOLE(Win32TableId) == 1) {//console app 68 61 dprintf(("Console application!\n")); … … 86 79 ULONG Win32Exe::start() 87 80 { 81 ULONG rc; 82 88 83 if(getenv("WIN32_IOPL2")) { 89 84 io_init1(); … … 92 87 93 88 fExeStarted = TRUE; 94 return ((WIN32EXEENTRY)entryPoint)(); 89 SetWin32TIB(); 90 rc = ((WIN32EXEENTRY)entryPoint)(); 91 RestoreOS2TIB(); 92 return rc; 95 93 } 96 94 //****************************************************************************** -
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.