- Timestamp:
- Sep 2, 2000, 11:14:50 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initterm.cpp
r3993 r4167 1 /* $Id: initterm.cpp,v 1.4 4 2000-08-11 10:56:16 sandervlExp $ */1 /* $Id: initterm.cpp,v 1.45 2000-09-02 21:14:50 bird Exp $ */ 2 2 3 3 /* … … 51 51 #include "oslibdos.h" 52 52 #include <cpuhlp.h> 53 54 #define DBG_LOCALLOG DBG_initterm 53 #include <Win32k.h> 54 55 #define DBG_LOCALLOG DBG_initterm 55 56 #include "dbglocal.h" 57 56 58 57 59 /*-------------------------------------------------------------------*/ … … 107 109 { 108 110 case 0 : 109 { 110 ParseLogStatus(); 111 { 112 libWin32kInit(); 113 114 ParseLogStatus(); 111 115 112 116 loadNr = globLoadNr++; 113 117 114 115 116 118 strcpy(kernel32Path, OSLibGetDllName(hModule)); 119 char *endofpath = strrchr(kernel32Path, '\\'); 120 *(endofpath+1) = 0; 117 121 dprintf(("kernel32 init\n")); 118 122 _ctordtorInit(); … … 120 124 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 121 125 122 123 124 if (InitializeSharedHeap() == FALSE)125 return 0UL; 126 127 if (InitializeCodeHeap() == FALSE)126 OpenPrivateLogFiles(); 127 128 if (InitializeSharedHeap() == FALSE) 129 return 0UL; 130 131 if (InitializeCodeHeap() == FALSE) 128 132 return 0UL; 129 133 130 134 PROFILE_LoadOdinIni(); 131 135 dllHandle = RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab); 132 if (dllHandle == 0)133 return 0UL; 134 135 136 if (dllHandle == 0) 137 return 0UL; 138 139 //SvL: Kernel32 is a special case; pe.exe loads it, so increase 136 140 // the reference count here 137 Win32DllBase *module = Win32DllBase::findModule(dllHandle); 138 if(module) { 139 module->AddRef(); 140 module->DisableUnload(); 141 } 141 Win32DllBase *module = Win32DllBase::findModule(dllHandle); 142 if (module) 143 { 144 module->AddRef(); 145 module->DisableUnload(); 146 } 142 147 143 148 /*******************************************************************/ … … 156 161 flAllocMem = PAG_ANY; // high memory support. Let's use it! 157 162 ulMaxAddr = ulSysinfo * (1024*1024); 158 163 OSLibInitWSeBFileIO(); 159 164 } 160 165 else 161 166 flAllocMem = 0; // no high memory support 162 167 163 168 OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES); 164 169 165 170 //SvL: Do it here instead of during the exe object creation 166 171 //(std handles can be used in win32 dll initialization routines 167 172 HMInitialize(); /* store standard handles within HandleManager */ 168 InitializeTIB(TRUE); 173 InitializeTIB(TRUE); //MUST be done after HMInitialize! 169 174 InitDirectories(); 170 175 RegisterDevices(); 171 176 Win32DllBase::setDefaultRenaming(); 172 177 rc = DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &ulSysinfo, sizeof(ulSysinfo)); 173 if (rc != 0) 174 178 if (rc != 0) 179 ulSysinfo = 1; 175 180 176 181 InitSystemInfo(ulSysinfo); 177 182 //Set up environment as found in NT 178 183 InitEnvironment(ulSysinfo); 179 184 break; 180 } 185 } 186 181 187 case 1 : 182 if(dllHandle) { 183 UnregisterLxDll(dllHandle); 184 } 185 break; 188 if (dllHandle) 189 { 190 UnregisterLxDll(dllHandle); 191 } 192 break; 193 186 194 default : 187 195 return 0UL; -
trunk/src/kernel32/makefile
r3864 r4167 1 # $Id: makefile,v 1.9 7 2000-07-19 19:05:09 sandervlExp $1 # $Id: makefile,v 1.98 2000-09-02 21:14:50 bird Exp $ 2 2 3 3 # … … 151 151 $(OBJDIR)\console.res 152 152 $(LD2) $(LD2FLAGS) @$(OBJDIR)\$(TARGET).lrf 153 $(OS2RC) $(O BJDIR)\console.res $@153 $(OS2RC) $(OS2RCLFLAGS) $(OBJDIR)\console.res $@ 154 154 155 155 … … 164 164 $(PDWIN32_LIB)\LIBULS.LIB 165 165 $(PDWIN32_LIB)\LIBCONV.LIB 166 $(PDWIN32_LIB)\WIN32K.LIB 166 167 OS2386.LIB 167 168 $(RTLLIB_O) -
trunk/src/kernel32/winimagepe2lx.cpp
r4097 r4167 1 /* $Id: winimagepe2lx.cpp,v 1.1 3 2000-08-27 03:20:37bird Exp $ */1 /* $Id: winimagepe2lx.cpp,v 1.14 2000-09-02 21:14:50 bird Exp $ */ 2 2 3 3 /* … … 33 33 #include <win32type.h> 34 34 #include <misc.h> 35 #include <winimagebase.h> 36 #include <winimagepe2lx.h> 35 #include "winimagebase.h" 36 #include "winimagepe2lx.h" 37 #include "Win32k.h" 37 38 38 39 #define DBG_LOCALLOG DBG_winimagepe2lx … … 386 387 { 387 388 APIRET rc = NO_ERROR; 389 390 /* 391 * If Win32k.sys is installed we'll use it. 392 */ 393 if (libWin32kInstalled()) 394 { 395 ULONG cbQte = sizeof(QOTEBUFFER) + sizeof(QOTE)*20; 396 PQOTEBUFFER pQOte = (PQOTEBUFFER)malloc(sizeof(QOTEBUFFER) + sizeof(QOTE)*20); 397 if (pQOte != NULL) 398 { 399 /* 400 * Get the query OTEs for this module. 401 * If there is a buffer overflow we'll allocate more storage and retry. 402 */ 403 rc = W32kQueryOTEs(hinstance, pQOte, cbQte); 404 while (rc == ERROR_BUFFER_OVERFLOW && cbQte < 32000); 405 { 406 PVOID pvOld = pQOte; 407 cbQte += sizeof(QOTE) * 20; 408 pQOte = (PQOTEBUFFER)realloc(pQOte, cbQte); 409 if (pQOte == NULL) 410 { 411 free(pvOld); 412 return ERROR_NOT_ENOUGH_MEMORY; 413 } 414 415 rc = W32kQueryOTEs(hinstance, pQOte, cbQte); 416 } 417 418 /* 419 * If successfully got the OTEs then allocate and set paSections structs. 420 */ 421 if (rc == NO_ERROR) 422 { 423 /* Allocate memory for paSections */ 424 paSections = (PSECTION)malloc(pQOte->cOTEs * sizeof(SECTION)); 425 if (paSections != NULL) 426 { 427 /* objects -> section array */ 428 for (int i = 0; i < pQOte->cOTEs; i++) 429 { 430 paSections[i].ulRVA = ~0UL; 431 paSections[i].cbVirtual = pQOte->aOTE[i].ote_size; 432 paSections[i].ulAddress = pQOte->aOTE[i].ote_base; 433 } 434 cSections = pQOte->cOTEs; 435 } 436 else 437 rc = ERROR_NOT_ENOUGH_MEMORY; 438 } 439 else 440 { 441 dprintf(("Win32Pe2LxImage::getSections: libW32kQueryOTEs failed with rc=%d." 442 " Falls back on the DosQuerySysState method.\n", rc)); 443 } 444 } 445 else 446 { /* server error, no use in trying the fallback method. */ 447 dprintf(("Win32Pe2LxImage::getSections: malloc failed\n")); 448 return ERROR_NOT_ENOUGH_MEMORY; 449 } 450 451 if (rc == NO_ERROR) 452 return rc; 453 } 454 455 456 /* 457 * Fallback method, using DosQuerySysState. 458 */ 388 459 qsPtrRec_t * pPtrRec; 389 460 ULONG cbBuf = 65536;
Note:
See TracChangeset
for help on using the changeset viewer.