Changeset 1708 for trunk/src/kernel32
- Timestamp:
- Nov 11, 1999, 8:10:09 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.CPP
r1670 r1708 1 /* $Id: KERNEL32.CPP,v 1. 29 1999-11-09 19:22:31sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.30 1999-11-11 19:10:08 sandervl Exp $ */ 2 2 3 3 /* … … 367 367 dprintf(("KERNEL32: OS2GetEnvironmentVariableW\n")); 368 368 asciibuffer = (char *)malloc(nSize+1); 369 *asciibuffer = 0; 369 370 astring = UnicodeToAsciiString((LPWSTR)lpName); 370 371 -
trunk/src/kernel32/directory.cpp
r1646 r1708 1 /* $Id: directory.cpp,v 1.1 0 1999-11-08 21:24:24sandervl Exp $ */1 /* $Id: directory.cpp,v 1.11 1999-11-11 19:10:08 sandervl Exp $ */ 2 2 3 3 /* … … 105 105 106 106 107 ODINFUNCTION 1(BOOL,SetCurrentDirectoryA,LPCSTR,lpPathName)107 ODINFUNCTIONNODBG1(BOOL,SetCurrentDirectoryA,LPCSTR,lpPathName) 108 108 { 109 109 int len = strlen(lpPathName); … … 113 113 if(tmp[len -1] == '\\') 114 114 tmp[len -1] = 0; 115 116 dprintf(("SetCurrentDirectoryA %s", tmp)); 115 117 return O32_SetCurrentDirectory((LPSTR)tmp); 116 118 } … … 325 327 326 328 rc = GetWindowsDirectoryA(asciibuffer, uSize); 327 AsciiToUnicode(asciibuffer, lpBuffer); 329 if(rc) 330 AsciiToUnicode(asciibuffer, lpBuffer); 328 331 free(asciibuffer); 329 332 return(rc); -
trunk/src/kernel32/disk.cpp
r1651 r1708 1 /* $Id: disk.cpp,v 1. 6 1999-11-09 01:22:32 phallerExp $ */1 /* $Id: disk.cpp,v 1.7 1999-11-11 19:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 82 82 char *astring; 83 83 84 dprintf(("KERNEL32: OS2GetDriveTypeW\n"));85 84 astring = UnicodeToAsciiString((LPWSTR)arg1); 85 dprintf(("KERNEL32: OS2GetDriveTypeW %s", astring)); 86 86 rc = O32_GetDriveType(astring); 87 87 FreeAsciiString(astring); … … 100 100 DWORD, nFileSystemNameSize) 101 101 { 102 dprintf(("GetVolumeInformationA %s", lpRootPathName)); 102 103 return O32_GetVolumeInformation(lpRootPathName, 103 104 lpVolumeNameBuffer, -
trunk/src/kernel32/lang.cpp
r1458 r1708 27 27 BOOL WIN32API IsValidCodePage(UINT CodePage) 28 28 { 29 dprintf(("KERNEL32: IsValidCodePage not implemented\n"));29 dprintf(("KERNEL32: IsValidCodePage %d not implemented", CodePage)); 30 30 return(TRUE); 31 31 } -
trunk/src/kernel32/makefile
r1670 r1708 1 # $Id: makefile,v 1.5 5 1999-11-09 19:22:32sandervl Exp $1 # $Id: makefile,v 1.56 1999-11-11 19:10:09 sandervl Exp $ 2 2 3 3 # … … 18 18 CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE) /Tm+ 19 19 CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE) /Tm+ 20 21 !ifdef NODEBUGINFO 22 CFLAGS = $(CFLAGS) -DDEFAULT_LOGGING_OFF 23 CXXFLAGS = $(CXXFLAGS) -DDEFAULT_LOGGING_OFF 24 !endif 20 25 21 26 !ifdef DEBUGALL -
trunk/src/kernel32/misc.cpp
r1448 r1708 1 /* $Id: misc.cpp,v 1.1 3 1999-10-25 21:38:50 phallerExp $ */1 /* $Id: misc.cpp,v 1.14 1999-11-11 19:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 252 252 init = TRUE; 253 253 254 #ifdef DEFAULT_LOGGING_OFF 255 if(getenv("WIN32LOG_ENABLED")) { 256 #else 254 257 if(!getenv("NOWIN32LOG")) { 258 #endif 255 259 char logname[CCHMAXPATH]; 256 260 -
trunk/src/kernel32/winimagepeldr.cpp
r1663 r1708 1 /* $Id: winimagepeldr.cpp,v 1.1 1 1999-11-09 14:19:47sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.12 1999-11-11 19:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 73 73 imageVirtBase(-1), realBaseAddress(0), imageVirtEnd(0), 74 74 nrNameExports(0), nrOrdExports(0), nameexports(NULL), ordexports(NULL), 75 pResSection(NULL),fImgMapping(0)75 fImgMapping(0) 76 76 { 77 77 HFILE dllfile; … … 140 140 ULONG filesize, ulRead; 141 141 PIMAGE_SECTION_HEADER psh; 142 IMAGE_SECTION_HEADER sh; 142 143 IMAGE_TLS_DIRECTORY *tlsDir = NULL; 143 144 int nSections, i; … … 315 316 } 316 317 } 317 fout << "*************************PE SECTIONS END **************************" << endl; 318 imageSize += imageVirtBase - oh.ImageBase; 319 fout << "Total size of Image " << imageSize << endl; 320 fout << "imageVirtBase " << imageVirtBase << endl; 321 fout << "imageVirtEnd " << imageVirtEnd << endl; 322 323 //In case there are any gaps between sections, adjust size 324 if(imageSize != imageVirtEnd - oh.ImageBase) { 318 } 319 else { 320 if(GetSectionHdrByName (win32file, &sh, ".rsrc")) 321 { 322 addSection(SECTION_RESOURCE, (char *)win32file+sh.PointerToRawData, 323 sh.SizeOfRawData, sh.VirtualAddress + oh.ImageBase, 324 sh.Misc.VirtualSize); 325 } 326 } 327 fout << "*************************PE SECTIONS END **************************" << endl; 328 imageSize += imageVirtBase - oh.ImageBase; 329 fout << "Total size of Image " << imageSize << endl; 330 fout << "imageVirtBase " << imageVirtBase << endl; 331 fout << "imageVirtEnd " << imageVirtEnd << endl; 332 333 //In case there are any gaps between sections, adjust size 334 if(imageSize != imageVirtEnd - oh.ImageBase) { 325 335 fout << "imageSize != imageVirtEnd - oh.ImageBase!" << endl; 326 336 imageSize = imageVirtEnd - oh.ImageBase; 327 328 337 } 338 if(allocSections(reservedMem) == FALSE) { 329 339 fout << "Failed to allocate image memory, rc " << errorState << endl; 330 340 goto failure; 331 332 333 341 } 342 fout << "OS/2 base address " << realBaseAddress << endl; 343 if(storeSections((char *)win32file) == FALSE) { 334 344 fout << "Failed to store sections, rc " << errorState << endl; 335 345 goto failure; 336 337 346 } 347 if(oh.AddressOfEntryPoint) { 338 348 entryPoint = realBaseAddress + oh.AddressOfEntryPoint; 339 340 349 } 350 else { 341 351 fout << "EntryPoint == NULL" << endl; 342 352 entryPoint = NULL; 343 } 344 353 } 354 355 if(loadType == REAL_LOAD) 356 { 345 357 if(tlsDir != NULL) { 346 358 Section *sect = findSection(SECTION_TLS); … … 381 393 } 382 394 } 383 384 //SvL: Use pointer to image header as module handle now. Some apps needs this 385 hinstance = (HINSTANCE)realBaseAddress;386 }395 } 396 397 //SvL: Use pointer to image header as module handle now. Some apps needs this 398 hinstance = (HINSTANCE)realBaseAddress; 387 399 388 400 //PH: get pResDir pointer correct first, since processImports may 389 401 // implicitly call functions depending on it. 390 IMAGE_SECTION_HEADER sh;391 402 if(GetSectionHdrByName (win32file, &sh, ".rsrc")) { 392 403 //get offset in resource object of directory entry 393 404 pResDir = (PIMAGE_RESOURCE_DIRECTORY)(sh.VirtualAddress + realBaseAddress); 394 pResourceSectionStart = (ULONG)pResSection->virtaddr - oh.ImageBase;405 pResourceSectionStart = sh.VirtualAddress; 395 406 } 396 407 … … 401 412 goto failure; 402 413 } 403 404 //set final memory protection flags (storeSections sets them to read/write) 405 if(setMemFlags() == FALSE) { 414 } 415 416 //set final memory protection flags (storeSections sets them to read/write) 417 if(setMemFlags() == FALSE) { 406 418 fout << "Failed to set memory protection" << endl; 407 419 goto failure; 408 409 410 411 } 420 } 421 CloseHandle(fImgMapping); 422 fImgMapping = 0; 423 412 424 return(TRUE); 413 425 failure: … … 428 440 section[nrsections].virtaddr = virtaddress; 429 441 430 if(type == SECTION_RESOURCE) {431 pResSection = §ion[nrsections];432 }433 442 virtsize = ((virtsize - 1) & ~0xFFF) + PAGE_SIZE; 434 443 imageSize += virtsize; -
trunk/src/kernel32/wprocess.cpp
r1691 r1708 1 /* $Id: wprocess.cpp,v 1.4 8 1999-11-10 16:38:36 phallerExp $ */1 /* $Id: wprocess.cpp,v 1.49 1999-11-11 19:10:09 sandervl Exp $ */ 2 2 3 3 /* … … 809 809 return(FALSE); 810 810 } 811 rsrcimg->init(0);812 811 int size = rsrcimg->getVersionSize(); 813 812 delete rsrcimg;
Note:
See TracChangeset
for help on using the changeset viewer.