- Timestamp:
- May 24, 2004, 10:56:07 AM (21 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r10437 r10606 1 ; $Id: KERNEL32.DEF,v 1.16 3 2004-01-31 02:05:06 birdExp $1 ; $Id: KERNEL32.DEF,v 1.164 2004-05-24 08:56:05 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1211 1211 OSLibDosDevIOCtl @2026 NONAME 1212 1212 1213 OSLibImSetMsgQueueProperty @2029 NONAME 1214 1213 1215 fIsDBCSEnv @2103 NONAME 1214 1216 -
trunk/src/kernel32/initkernel32.cpp
r10528 r10606 1 /* $Id: initkernel32.cpp,v 1.2 7 2004-03-16 13:34:23sandervl Exp $1 /* $Id: initkernel32.cpp,v 1.28 2004-05-24 08:56:06 sandervl Exp $ 2 2 * 3 3 * KERNEL32 DLL entry point … … 60 60 #include <stats.h> 61 61 #include <heapshared.h> 62 #include <heapstring.h> 62 63 63 64 #define DBG_LOCALLOG DBG_initterm … … 70 71 extern DWORD kernel32_PEResTab; 71 72 } 73 74 extern PFN pfnImSetMsgQueueProperty; 72 75 73 76 ULONG flAllocMem = 0; /* flag to optimize DosAllocMem to use all the memory on SMP machines */ … … 78 81 BOOL fInit = FALSE; 79 82 BOOL fWin32k = FALSE; 83 HMODULE imHandle = 0; 84 char szModName[ 256 ] = ""; 80 85 81 86 /****************************************************************************/ … … 150 155 //(std handles can be used in win32 dll initialization routines 151 156 HMInitialize(); /* store standard handles within HandleManager */ 152 157 153 158 // VP: Shared heap should be initialized before call to PROFILE_* 154 159 // because they use a critical section which in turn uses smalloc … … 215 220 /* Setup codepage info */ 216 221 CODEPAGE_Init(); 222 223 if( IsDBCSEnv() && DosLoadModule( szModName, sizeof( szModName ), "OS2IM.DLL", &imHandle ) == 0 ) 224 DosQueryProcAddr( imHandle, 140, NULL, &pfnImSetMsgQueueProperty ); 217 225 218 226 InitSystemInfo(ulSysinfo); … … 256 264 dprintf(("kernel32 exit %d\n", ulReason)); 257 265 266 if( IsDBCSEnv() && imHandle ) 267 DosFreeModule( imHandle ); 268 258 269 //Flush and delete all open memory mapped files 259 270 Win32MemMap::deleteAll(); -
trunk/src/kernel32/kernel32dbg.def
r10437 r10606 1 ; $Id: kernel32dbg.def,v 1.3 8 2004-01-31 02:05:05 birdExp $1 ; $Id: kernel32dbg.def,v 1.39 2004-05-24 08:56:06 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1211 1211 OSLibDosDevIOCtl @2026 NONAME 1212 1212 1213 OSLibImSetMsgQueueProperty @2029 NONAME 1214 1213 1215 fIsDBCSEnv @2103 NONAME 1214 1216 -
trunk/src/kernel32/oslibmisc.cpp
r9890 r10606 1 /* $Id: oslibmisc.cpp,v 1.1 8 2003-03-03 16:38:20sandervl Exp $ */1 /* $Id: oslibmisc.cpp,v 1.19 2004-05-24 08:56:07 sandervl Exp $ */ 2 2 /* 3 3 * Misc OS/2 util. procedures … … 17 17 #define INCL_DOSSEL 18 18 #define INCL_DOSNLS /* National Language Support values */ 19 #include <os2wrap.h> 19 #include <os2wrap.h> //Odin32 OS/2 api wrappers 20 20 #include <string.h> 21 21 #include <stdlib.h> … … 24 24 #include "oslibmisc.h" 25 25 #include <misc.h> 26 27 #define DBG_LOCALLOG DBG_oslibmisc 26 #include <heapstring.h> 27 28 #define DBG_LOCALLOG DBG_oslibmisc 28 29 #include "dbglocal.h" 29 30 31 typedef APIRET ( APIENTRY *PFN_IMSETMSGQUEUEPROPERTY )( HMQ, ULONG ); 32 33 PFN_IMSETMSGQUEUEPROPERTY pfnImSetMsgQueueProperty = NULL; 34 30 35 //****************************************************************************** 31 36 //TODO: not reentrant! … … 36 41 37 42 if(DosQueryModuleName(hModule, CCHMAXPATH, modname) != 0) { 38 43 return NULL; 39 44 } 40 45 return(modname); … … 187 192 rc = DosGetInfoBlocks(&ptib, &ppib); 188 193 if(rc) { 189 194 return 0; 190 195 } 191 196 switch(tiboff) 192 197 { 193 194 195 196 197 198 198 case TIB_STACKTOP: 199 return (ULONG)ptib->tib_pstacklimit; 200 case TIB_STACKLOW: 201 return (ULONG)ptib->tib_pstack; 202 default: 203 return 0; 199 204 } 200 205 } … … 217 222 if (rc) 218 223 { 219 224 dprintf(("KERNEL32: OSLibGetPIB(%d): DosGetInfoBlocks failed with rc=%d\n", iPIB, rc)); 220 225 return 0; 221 226 } … … 248 253 rc = DosAllocThreadLocalMemory(nrdwords, &thrdaddr); 249 254 if(rc) { 250 251 255 dprintf(("DosAllocThreadLocalMemory failed %d", rc)); 256 return 0; 252 257 } 253 258 return (ULONG)thrdaddr; … … 335 340 BOOL OSLibDisablePopups() 336 341 { 337 return DosError(FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR) == NO_ERROR; 338 } 339 //****************************************************************************** 340 //****************************************************************************** 342 return DosError(FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR) == NO_ERROR; 343 } 344 //****************************************************************************** 345 //****************************************************************************** 346 ULONG OSLibImSetMsgQueueProperty( ULONG hmq, ULONG ulFlag ) 347 { 348 USHORT sel; 349 APIRET rc; 350 351 if( !pfnImSetMsgQueueProperty ) 352 return 1; 353 354 sel = RestoreOS2FS(); 355 rc = pfnImSetMsgQueueProperty( hmq, ulFlag ); 356 SetFS( sel ); 357 358 return rc; 359 } 360 //****************************************************************************** 361 //****************************************************************************** 362 -
trunk/src/kernel32/oslibmisc.h
r10339 r10606 1 /* $Id: oslibmisc.h,v 1.1 3 2003-11-21 11:29:33sandervl Exp $ */1 /* $Id: oslibmisc.h,v 1.14 2004-05-24 08:56:07 sandervl Exp $ */ 2 2 /* 3 3 * Misc util. procedures … … 34 34 BOOL OSLibDisablePopups(); 35 35 36 #define TIB_STACKTOP 37 #define TIB_STACKLOW 36 #define TIB_STACKTOP 0 37 #define TIB_STACKLOW 1 38 38 39 39 ULONG OSLibGetTIB(int tiboff); 40 40 41 41 #define PIB_HMTE 0 42 #define PIB_TASKHNDL 42 #define PIB_TASKHNDL PIB_HMTE 43 43 #define PIB_TASKTYPE 1 44 44 #define PIB_PCHCMD 2 45 45 46 #define TASKTYPE_PM 46 #define TASKTYPE_PM 0 47 47 #define TASKTYPE_VIO 1 48 48 … … 100 100 ULONG OSLibQueryCountry(); 101 101 102 ULONG OSLibImSetMsgQueueProperty( ULONG hmq, ULONG ulFlag ); 103 102 104 #ifdef __cplusplus 103 105 } -
trunk/src/kernel32/thread.cpp
r9975 r10606 1 /* $Id: thread.cpp,v 1.5 4 2003-04-02 12:58:31sandervl Exp $ */1 /* $Id: thread.cpp,v 1.55 2004-05-24 08:56:07 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 * Includes * 16 16 *****************************************************************************/ 17 18 17 #include <odin.h> 19 18 #include <odinwrap.h> … … 35 34 #include <handlemanager.h> 36 35 #include <codepage.h> 36 #include <heapstring.h> 37 37 38 38 #include <FastInfoBlocks.h> 39 39 40 #define DBG_LOCALLOG 40 #define DBG_LOCALLOG DBG_thread 41 41 #include "dbglocal.h" 42 42 … … 69 69 if(teb == 0) { 70 70 DebugInt3(); 71 72 71 SetLastError(ERROR_INVALID_HANDLE); //todo 72 return 0; 73 73 } 74 74 return teb->o.odin.hThread; … … 205 205 teb = GetThreadTEB(); 206 206 if(teb != 0) { 207 207 exceptFrame = (EXCEPTION_FRAME *)teb->o.odin.exceptFrame; 208 208 } 209 209 else DebugInt3(); … … 278 278 /***************************************************************************** 279 279 * Name : BOOL SetThreadPriorityBoost 280 * Purpose : The SetThreadPriorityBoost function disables or enables 281 * the ability of the system to temporarily boost the priority 280 * Purpose : The SetThreadPriorityBoost function disables or enables 281 * the ability of the system to temporarily boost the priority 282 282 * of a thread. 283 283 * Parameters: Unknown (wrong) … … 312 312 } 313 313 } 314 315 #define MQP_INSTANCE_PERMQ 0x00000001 // from os2im.h 314 316 //****************************************************************************** 315 317 //****************************************************************************** … … 326 328 327 329 if(InitializeThread(winteb) == FALSE) { 328 329 330 330 dprintf(("Win32ThreadProc: InitializeTIB failed!!")); 331 DebugInt3(); 332 return 0; 331 333 } 332 334 dprintf(("Win32ThreadProc: Thread handle 0x%x, thread id %d", GetCurrentThread(), GetCurrentThreadId())); … … 341 343 winteb->o.odin.hmq = OSLibWinQueryMsgQueue(winteb->o.odin.hab); 342 344 rc = OSLibWinSetCp(winteb->o.odin.hmq, GetDisplayCodepage()); 343 dprintf(("WinSetCP was %sOK ", rc ? "" : "not "));345 dprintf(("WinSetCP was %sOK(%d, %d)", rc ? "" : "not ")); 344 346 345 347 dprintf(("Win32ThreadProc: hab %x hmq %x", winteb->o.odin.hab, winteb->o.odin.hmq)); 346 348 dprintf(("Stack top 0x%x, stack end 0x%x", winteb->stack_top, winteb->stack_low)); 349 350 if( IsDBCSEnv()) 351 /* IM instace is created per message queue, that is, thread */ 352 OSLibImSetMsgQueueProperty( winteb->o.odin.hmq, MQP_INSTANCE_PERMQ ); 347 353 348 354 //Note: The Win32 exception structure referenced by FS:[0] is the same … … 369 375 } 370 376 371 if(WinExe) WinExe->tlsAttachThread(); 377 if(WinExe) WinExe->tlsAttachThread(); //setup TLS structure of main exe 372 378 Win32DllBase::tlsAttachThreadToAllDlls(); //setup TLS structures of all dlls 373 379 Win32DllBase::attachThreadToAllDlls(); //send DLL_THREAD_ATTACH message to all dlls … … 387 393 Win32DllBase::detachThreadFromAllDlls(); //send DLL_THREAD_DETACH message to all dlls 388 394 Win32DllBase::tlsDetachThreadFromAllDlls(); //destroy TLS structures of all dlls 389 if(WinExe) WinExe->tlsDetachThread(); 395 if(WinExe) WinExe->tlsDetachThread(); //destroy TLS structure of main exe 390 396 DestroyTEB(winteb); //destroys TIB and restores FS 391 397 OS2UnsetExceptionHandler((void *)&exceptFrame);
Note:
See TracChangeset
for help on using the changeset viewer.