- Timestamp:
- Mar 28, 2000, 7:11:50 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r3105 r3259 1 /* $Id: Fileio.cpp,v 1.2 5 2000-03-13 20:39:09sandervl Exp $ */1 /* $Id: Fileio.cpp,v 1.26 2000-03-28 17:11:48 sandervl Exp $ */ 2 2 3 3 /* … … 617 617 618 618 ODINFUNCTION3(HFILE, OpenFile, 619 LPCSTR, arg1,620 OFSTRUCT *, arg2,621 UINT, arg3)619 LPCSTR, lpszFile, 620 OFSTRUCT *, lpOpenBuff, 621 UINT, fuMode) 622 622 { 623 623 HFILE hFile; 624 624 625 625 dprintf(("KERNEL32: OpenFile(%s, %08xh, %08xh)\n", 626 arg1,627 arg2,628 arg3));629 630 hFile = HMOpenFile( arg1, /* call open32 */631 arg2,632 arg3);626 lpszFile, 627 lpOpenBuff, 628 fuMode)); 629 630 hFile = HMOpenFile(lpszFile, /* call open32 */ 631 lpOpenBuff, 632 fuMode); 633 633 634 634 return (hFile); -
trunk/src/kernel32/hmopen32.cpp
r3228 r3259 1 /* $Id: hmopen32.cpp,v 1. 19 2000-03-24 19:25:32sandervl Exp $ */1 /* $Id: hmopen32.cpp,v 1.20 2000-03-28 17:11:49 sandervl Exp $ */ 2 2 3 3 /* … … 700 700 PHMHANDLEDATA pHMHandleData, 701 701 OFSTRUCT *pOFStruct, 702 UINT arg3)702 UINT fuMode) 703 703 { 704 704 HFILE hFile; 705 705 FILETIME filetime; 706 706 WORD filedatetime[2]; 707 char filepath[260]; 707 708 708 709 dprintfl(("KERNEL32: HandleManager::Open32::OpenFile %s(%s,%08x,%08x,%08x) - stub?\n", … … 711 712 pHMHandleData, 712 713 pOFStruct, 713 arg3));714 715 if 714 fuMode)); 715 716 if(strcmp(lpFileName, // "support" for local unc names 716 717 "\\\\.\\") == 0) 718 { 717 719 lpFileName+=4; 718 720 } 721 else 722 if(!strchr(lpFileName, ':') && !strchr(lpFileName, '\\')) 723 { 724 //filename only; search for file in following order 725 //1: dir from which the app loaded 726 //2: current dir 727 //3: windows system dir 728 //4: windows dir 729 //5: dirs in path path environment variable 730 //SearchPath does exactly that 731 LPSTR filenameinpath; 732 733 if(SearchPathA(NULL, lpFileName, NULL, sizeof(filepath), filepath, &filenameinpath) == 0 734 && !(fuMode & OF_CREATE) ) { 735 SetLastError(ERROR_FILE_NOT_FOUND); 736 return HFILE_ERROR; 737 } 738 lpFileName = filepath; 739 } 719 740 // filling OFSTRUCT 720 741 memset(pOFStruct, 0, sizeof(OFSTRUCT)); … … 725 746 hFile = O32_OpenFile(lpFileName, 726 747 pOFStruct, 727 arg3);748 fuMode); 728 749 if (hFile != INVALID_HANDLE_ERROR) 729 750 { -
trunk/src/kernel32/kobjects.cpp
r3128 r3259 1 /* $Id: kobjects.cpp,v 1.1 0 2000-03-16 19:20:39 sandervl Exp $ */1 /* $Id: kobjects.cpp,v 1.11 2000-03-28 17:11:49 sandervl Exp $ */ 2 2 3 3 /* … … 322 322 UINT, cHandles) 323 323 { 324 return(HMSetHandleCount(cHandles)); 324 //SvL: Has no effect in NT; also ignore it 325 return cHandles; 325 326 } 326 327 -
trunk/src/kernel32/mmap.cpp
r3206 r3259 1 /* $Id: mmap.cpp,v 1.3 7 2000-03-23 19:23:47sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.38 2000-03-28 17:11:49 sandervl Exp $ */ 2 2 3 3 /* … … 195 195 if(hMemFile != -1) { 196 196 // for(i=0;i<nrpages;i++) { 197 if(VirtualQuery((LPSTR)pageAddr, &memInfo, nrpages*PAGE_SIZE) == 0) {197 if(VirtualQuery((LPSTR)pageAddr, &memInfo, sizeof(MEMORY_BASIC_INFORMATION)) == 0) { 198 198 dprintf(("Win32MemMap::commitPage: VirtualQuery (%x,%x) failed for %x", pageAddr, nrpages*PAGE_SIZE)); 199 199 goto fail; 200 200 } 201 memInfo.RegionSize = min(memInfo.RegionSize, nrpages*PAGE_SIZE); 201 202 //Only changes the state of the pages with the same attribute flags 202 203 //(returned in memInfo.RegionSize) … … 250 251 ULONG sizeleft = nrpages*PAGE_SIZE; 251 252 while(sizeleft) { 252 if(VirtualQuery((LPSTR)pageAddr, &memInfo, sizeleft) == 0) { 253 254 if(VirtualQuery((LPSTR)pageAddr, &memInfo, sizeof(MEMORY_BASIC_INFORMATION)) == 0) { 253 255 dprintf(("Win32MemMap::commitPage: VirtualQuery (%x,%x) failed", pageAddr, sizeleft)); 254 256 goto fail; 255 257 } 258 memInfo.RegionSize = min(memInfo.RegionSize, sizeleft); 259 256 260 if(!(memInfo.State & MEM_COMMIT)) 257 261 {//if it's already committed, then the app tried to write to it -
trunk/src/kernel32/virtual.cpp
r2802 r3259 1 /* $Id: virtual.cpp,v 1.2 8 2000-02-16 14:22:46sandervl Exp $ */1 /* $Id: virtual.cpp,v 1.29 2000-03-28 17:11:50 sandervl Exp $ */ 2 2 3 3 /* … … 553 553 LPVOID lpBase; 554 554 555 if(pmbiBuffer == NULL || cbLength == 0) // check parameters 556 { 557 return 0; // nothing to return 558 } 555 if(pmbiBuffer == NULL || cbLength != sizeof(MEMORY_BASIC_INFORMATION)) // check parameters 556 { 557 SetLastError(ERROR_INVALID_PARAMETER); 558 return 0; // nothing to return 559 } 560 SetLastError(ERROR_SUCCESS); 559 561 560 562 // determine exact page range 561 563 lpBase = (LPVOID)((ULONG)lpvAddress & 0xFFFFF000); 562 cbRangeSize = cbLength & ~0x00000FFF; // assuming intel page sizes :) 563 if(cbLength & 0x00000FFF) 564 cbRangeSize += PAGE_SIZE; 564 cbRangeSize = -1; 565 565 566 566 rc = OSLibDosQueryMem(lpBase, … … 569 569 if(rc) 570 570 { 571 dprintf(("VirtualQuery - OSLibDosQueryMem %x %x returned %d\n", 572 lpBase, 573 cbLength, 574 rc)); 575 return 0; 571 dprintf(("VirtualQuery - OSLibDosQueryMem %x %x returned %d\n", 572 lpBase, cbLength, rc)); 573 SetLastError(ERROR_INVALID_PARAMETER); 574 return 0; 576 575 } 577 576 … … 607 606 608 607 if(!(dAttr & PAG_SHARED)) 609 pmbiBuffer->Type = MEM_PRIVATE;608 pmbiBuffer->Type = MEM_PRIVATE; 610 609 611 610 //TODO: This is not correct: AllocationProtect should contain the protection 612 611 // flags used in the initial call to VirtualAlloc 613 612 pmbiBuffer->AllocationProtect = pmbiBuffer->Protect; 614 if(dAttr & PAG_BASE) 615 pmbiBuffer->AllocationBase = lpBase; 613 if(dAttr & PAG_BASE) { 614 pmbiBuffer->AllocationBase = lpBase; 615 } 616 616 else 617 617 { 618 while(lpBase > 0) 619 { 620 rc = OSLibDosQueryMem(lpBase, &cbRangeSize, &dAttr); 621 if(rc) 622 { 623 dprintf(("VirtualQuery - OSLibDosQueryMem %x %x returned %d\n", 624 lpBase, 625 cbLength, 626 rc)); 627 break; 628 } 629 if(dAttr & PAG_BASE) 630 { 631 pmbiBuffer->AllocationBase = lpBase; 632 break; 633 } 634 lpBase = (LPVOID)((ULONG)lpBase - PAGE_SIZE); 635 } 618 while(lpBase > 0) 619 { 620 rc = OSLibDosQueryMem(lpBase, &cbRangeSize, &dAttr); 621 if(rc) { 622 dprintf(("VirtualQuery - OSLibDosQueryMem %x %x returned %d\n", 623 lpBase, cbLength, rc)); 624 break; 625 } 626 if(dAttr & PAG_BASE) { 627 pmbiBuffer->AllocationBase = lpBase; 628 break; 629 } 630 lpBase = (LPVOID)((ULONG)lpBase - PAGE_SIZE); 631 } 636 632 } 637 633 return sizeof(MEMORY_BASIC_INFORMATION); -
trunk/src/kernel32/winimagepeldr.cpp
r3228 r3259 1 /* $Id: winimagepeldr.cpp,v 1.3 7 2000-03-24 19:25:32sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.38 2000-03-28 17:11:50 sandervl Exp $ */ 2 2 3 3 /* … … 1178 1178 ULONG nsize; 1179 1179 1180 if(!strcmp(apiname, "At"))1181 DebugInt3();1182 1180 if(nameexports == NULL) { 1183 1181 nameExportSize= 4096; … … 1528 1526 { 1529 1527 if(apilen == curexport->nlength && 1530 *(ULONG *)curexport->name == *(ULONG *) name)1528 *(ULONG *)curexport->name == *(ULONG *)apiname) 1531 1529 { 1532 if(strcmp(curexport->name, name) == 0)1530 if(strcmp(curexport->name, apiname) == 0) 1533 1531 return(curexport->virtaddr); 1534 1532 }
Note:
See TracChangeset
for help on using the changeset viewer.