Changeset 21720 for branches/gcc-kmk/src/kernel32
- Timestamp:
- Oct 19, 2011, 11:26:02 AM (14 years ago)
- Location:
- branches/gcc-kmk/src/kernel32
- Files:
-
- 22 edited
-
HandleManager.cpp (modified) (1 diff)
-
char.cpp (modified) (1 diff)
-
directory.cpp (modified) (20 diffs)
-
heapstring.cpp (modified) (1 diff)
-
hmdevio.cpp (modified) (9 diffs)
-
hmdisk.cpp (modified) (17 diffs)
-
hmthread.cpp (modified) (5 diffs)
-
lang.cpp (modified) (1 diff)
-
mmap.cpp (modified) (1 diff)
-
mmapdup.cpp (modified) (6 diffs)
-
mmapnotify.cpp (modified) (4 diffs)
-
mmapview.cpp (modified) (16 diffs)
-
osliblvm.cpp (modified) (11 diffs)
-
osliblvm.h (modified) (4 diffs)
-
oslibmem.cpp (modified) (1 diff)
-
process.cpp (modified) (8 diffs)
-
virtual.cpp (modified) (1 diff)
-
winimagebase.cpp (modified) (1 diff)
-
winimagebase.h (modified) (1 diff)
-
winimagelx.cpp (modified) (1 diff)
-
winimagepeldr.cpp (modified) (1 diff)
-
wprocess.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/src/kernel32/HandleManager.cpp
r21717 r21720 70 70 71 71 #include <vmutex.h> 72 #include <win \thread.h>72 #include <win/thread.h> 73 73 74 74 #include <odinapi.h> -
branches/gcc-kmk/src/kernel32/char.cpp
r7886 r21720 26 26 27 27 #include <misc.h> 28 #include <wine \unicode.h>28 #include <wine/unicode.h> 29 29 30 30 -
branches/gcc-kmk/src/kernel32/directory.cpp
r21302 r21720 6 6 * Copyright 1998 Sander van Leeuwen 7 7 * 8 * NOTE: Directory creation has to be done in install program (odin\win) 8 * NOTE: Directory creation has to be done in install program (odin\win) 9 9 * 10 10 * Parts based on Wine code (991031) (files\directory.c) … … 14 14 * Copyright 1995 Alexandre Julliard 15 15 * 16 * TODO: 16 * TODO: 17 17 * - System/window directories should be created by install program! 18 18 * … … 34 34 #include <options.h> 35 35 #include "initterm.h" 36 #include <win \file.h>36 #include <win/file.h> 37 37 #include <string.h> 38 38 #include "oslibdos.h" … … 80 80 len = strlen(DIR_System); 81 81 if(DIR_System[len-1] == '\\') { 82 DIR_System[len-1] = 0; 82 DIR_System[len-1] = 0; 83 83 } 84 84 len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",DIR_Windows,sizeof(DIR_Windows)); 85 85 if (len > 2) { 86 86 if(DIR_Windows[len-1] == '\\') { 87 DIR_Windows[len-1] = 0; 87 DIR_Windows[len-1] = 0; 88 88 } 89 89 } … … 116 116 len = strlen(DIR_System); 117 117 if(DIR_System[len-1] == '\\') { 118 DIR_System[len-1] = 0; 118 DIR_System[len-1] = 0; 119 119 } 120 120 strcpy(DIR_Windows, szWindowsDir); 121 121 len = strlen(DIR_Windows); 122 122 if(DIR_Windows[len-1] == '\\') { 123 DIR_Windows[len-1] = 0; 123 DIR_Windows[len-1] = 0; 124 124 } 125 125 … … 146 146 rc = OSLibDosQueryDir(nBufferLength, lpBuffer); 147 147 if(rc && rc < nBufferLength) { 148 dprintf(("CurrentDirectory = %s (%d)", lpBuffer, rc)); 149 } 150 else dprintf(("CurrentDirectory returned %d", rc)); 148 dprintf(("CurrentDirectory = %s (%d)", lpBuffer, rc)); 149 } 150 else dprintf(("CurrentDirectory returned %d", rc)); 151 151 return rc; 152 152 } … … 196 196 return FALSE; 197 197 } 198 198 199 199 // cut off trailing backslashes 200 200 // not if a process wants to change to the root directory … … 264 264 265 265 int len = strlen(lpstrDirectory); 266 266 267 267 // cut off trailing backslashes 268 268 if ( (lpstrDirectory[len - 1] == '\\') || … … 275 275 lpstrDirectory = lpTemp; 276 276 } 277 277 278 278 dprintf(("CreateDirectoryA %s", lpstrDirectory)); 279 279 280 280 // Creation of an existing directory will fail (verified in NT4 & XP) 281 281 DWORD dwAttr = GetFileAttributesA(lpstrDirectory); 282 if(dwAttr != -1) 282 if(dwAttr != -1) 283 283 { 284 284 if (dwAttr & FILE_ATTRIBUTE_DIRECTORY) … … 287 287 return FALSE; 288 288 } 289 } 289 } 290 290 return(OSLibDosCreateDirectory(lpstrDirectory)); 291 291 } … … 437 437 asciibuffer = (char *)alloca(uSize+1); 438 438 439 if(lpBuffer && asciibuffer == NULL) 439 if(lpBuffer && asciibuffer == NULL) 440 440 { 441 441 DebugInt3(); … … 445 445 if(rc && asciibuffer) 446 446 AsciiToUnicode(asciibuffer, lpBuffer); 447 447 448 448 return(rc); 449 449 } … … 495 495 asciibuffer = (char *)alloca(uSize+1); 496 496 497 if(lpBuffer && asciibuffer == NULL) 497 if(lpBuffer && asciibuffer == NULL) 498 498 { 499 499 DebugInt3(); … … 503 503 if(rc && asciibuffer) 504 504 AsciiToUnicode(asciibuffer, lpBuffer); 505 505 506 506 return(rc); 507 507 } … … 524 524 { 525 525 int len = strlen(lpstrDirectory); 526 526 527 527 if(lpstrDirectory == NULL) { 528 528 SetLastError(ERROR_INVALID_PARAMETER); … … 539 539 lpstrDirectory = lpTemp; 540 540 } 541 541 542 542 dprintf(("RemoveDirectory %s", lpstrDirectory)); 543 543 … … 619 619 those (according to SDK docs) */ 620 620 if ((path != NULL) && strchr(path, ';')) { 621 ret = OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)path, (LPSTR)name, 621 ret = OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)path, (LPSTR)name, 622 622 full_name, MAX_PATHNAME_LEN); 623 623 goto done; … … 647 647 name = tmp; 648 648 } 649 649 650 650 /* If we have an explicit path, everything's easy */ 651 651 … … 704 704 * filename is returned. 705 705 * Failure: Zero 706 * 706 * 707 707 * NOTES 708 708 * Should call SetLastError(but currently doesn't). … … 732 732 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name ); 733 733 LPSTR extA = HEAP_strdupWtoA( GetProcessHeap(), 0, ext ); 734 734 735 735 dprintf(("SearchPathA %s %s %s", pathA, nameA, extA)); 736 736 DWORD ret = DIR_SearchPath( pathA, nameA, extA, (LPSTR)full_name ); 737 737 738 738 if (NULL != extA) 739 739 HeapFree( GetProcessHeap(), 0, extA ); 740 740 741 741 if (NULL != nameA) 742 742 HeapFree( GetProcessHeap(), 0, nameA ); 743 743 744 744 if (NULL != pathA) 745 745 HeapFree( GetProcessHeap(), 0, pathA ); 746 746 747 747 if (!ret) return 0; 748 748 -
branches/gcc-kmk/src/kernel32/heapstring.cpp
r21361 r21720 27 27 #include <wcstr.h> 28 28 #include "heap.h" 29 #include <wine \unicode.h>29 #include <wine/unicode.h> 30 30 #include "misc.h" 31 31 #include "codepage.h" -
branches/gcc-kmk/src/kernel32/hmdevio.cpp
r21302 r21720 25 25 #include <win32api.h> 26 26 #include <misc.h> 27 #include <win \winioctl.h>27 #include <win/winioctl.h> 28 28 #include "hmdevio.h" 29 29 #include "exceptutil.h" … … 47 47 DWORD rc; 48 48 49 for(int i=0;i<nrKnownDrivers;i++) 49 for(int i=0;i<nrKnownDrivers;i++) 50 50 { 51 51 driver = new HMDeviceDriver(knownDriver[i].szWin32Name, … … 101 101 if (rc != NO_ERROR) /* check for errors */ 102 102 dprintf(("KERNEL32:RegisterDevices: registering %s failed with %u.\n", szDrvName, rc)); 103 103 104 104 // @@@PH 105 105 // there should be an symbolic link: … … 109 109 rc = 0; 110 110 } 111 } 111 } 112 112 RegCloseKey(hkDrivers); 113 113 } … … 117 117 //****************************************************************************** 118 118 //****************************************************************************** 119 BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 119 BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 120 120 PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead, 121 121 PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo, … … 141 141 //****************************************************************************** 142 142 //****************************************************************************** 143 HMDeviceDriver::HMDeviceDriver(LPCSTR lpDeviceName, LPSTR lpOS2DevName, BOOL fCreate, 143 HMDeviceDriver::HMDeviceDriver(LPCSTR lpDeviceName, LPSTR lpOS2DevName, BOOL fCreate, 144 144 WINIOCTL pDevIOCtl) 145 145 : HMDeviceHandler(lpDeviceName) … … 215 215 dprintf(("DosOpen %s returned %d\n", szOS2Name, rc)); 216 216 217 if(rc == NO_ERROR) 217 if(rc == NO_ERROR) 218 218 { 219 219 pHMHandleData->hHMHandle = hfFileHandle; 220 220 return (NO_ERROR); 221 221 } 222 else 222 else 223 223 return(error2WinError(rc)); 224 224 } … … 259 259 //****************************************************************************** 260 260 //****************************************************************************** 261 HMCustomDriver::HMCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 261 HMCustomDriver::HMCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 262 262 PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead, 263 263 PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo, … … 461 461 return FALSE; 462 462 } 463 return pfnDriverGetOverlappedResult(lpDriverData, pHMHandleData->hHMHandle, pHMHandleData->dwFlags, 463 return pfnDriverGetOverlappedResult(lpDriverData, pHMHandleData->hHMHandle, pHMHandleData->dwFlags, 464 464 lpOverlapped, lpcbTransfer, fWait, (LPVOID)pHMHandleData->dwUserData); 465 465 } -
branches/gcc-kmk/src/kernel32/hmdisk.cpp
r9911 r21720 18 18 #include "hmdisk.h" 19 19 #include "mmap.h" 20 #include <win \winioctl.h>21 #include <win \ntddscsi.h>22 #include <win \wnaspi32.h>20 #include <win/winioctl.h> 21 #include <win/ntddscsi.h> 22 #include <win/wnaspi32.h> 23 23 #include "oslibdos.h" 24 24 #include "osliblvm.h" … … 43 43 typedef struct 44 44 { 45 BOOL fCDIoSupported; 45 BOOL fCDIoSupported; 46 46 ULONG driveLetter; 47 47 ULONG driveType; … … 163 163 szDrive[2] = '\0'; 164 164 165 //if volume name, query 166 if(!strncmp(lpFileName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1)) 165 //if volume name, query 166 if(!strncmp(lpFileName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1)) 167 167 { 168 168 int length; … … 171 171 return ERROR_FILE_NOT_FOUND; //not allowed 172 172 } 173 if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName))) 173 if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName))) 174 174 { 175 175 BOOL fLVMVolume; … … 184 184 return ERROR_FILE_NOT_FOUND; //not found 185 185 } 186 if(szDrive[0] == 0) 186 if(szDrive[0] == 0) 187 187 { 188 188 //volume isn't mounted 189 189 190 190 //Note: this only works on Warp 4.5 and up 191 sprintf(szDiskName, "\\\\.\\Physical_Disk%d", volext.Extents[0].DiskNumber+1); 191 sprintf(szDiskName, "\\\\.\\Physical_Disk%d", volext.Extents[0].DiskNumber+1); 192 192 fPhysicalDisk = TRUE; 193 193 dwPhysicalDiskNr = volext.Extents[0].DiskNumber + 1; … … 211 211 else return ERROR_FILE_NOT_FOUND; 212 212 } 213 else 214 if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0) 213 else 214 if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0) 215 215 { 216 216 if(!fPhysicalDiskAccess) { … … 304 304 drvInfo->fLocked = FALSE; 305 305 306 //save volume start & length if volume must be accessed through the physical disk 306 //save volume start & length if volume must be accessed through the physical disk 307 307 //(no other choice for unmounted volumes) 308 308 drvInfo->fPhysicalDisk = fPhysicalDisk; … … 348 348 if(pHMHandleData->hHMHandle && drvInfo->dwShare == 0) { 349 349 dprintf(("Locking drive")); 350 if(OSLibDosDevIOCtl(pHMHandleData->hHMHandle,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 350 if(OSLibDosDevIOCtl(pHMHandleData->hHMHandle,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 351 351 { 352 352 dprintf(("Sharing violation while attempting to lock the drive")); … … 411 411 if(hFile && drvInfo->dwShare == 0) { 412 412 dprintf(("Locking drive")); 413 if(OSLibDosDevIOCtl(hFile,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 413 if(OSLibDosDevIOCtl(hFile,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 414 414 { 415 415 dprintf(("Sharing violation while attempting to lock the drive")); … … 890 890 //label has changed 891 891 //TODO: Find better way to determine if floppy was removed or switched 892 if(drvInfo->driveType != DRIVE_FIXED) 892 if(drvInfo->driveType != DRIVE_FIXED) 893 893 { 894 894 rc = OSLibDosQueryVolumeSerialAndName(1 + drvInfo->driveLetter - 'A', &volumelabel, NULL, 0); … … 1439 1439 return (ret == ERROR_SUCCESS); 1440 1440 } 1441 1441 1442 1442 case IOCTL_CDROM_RAW_READ: 1443 1443 { 1444 1444 #pragma pack(1) 1445 struct 1445 struct 1446 1446 { 1447 1447 ULONG ID_code; … … 1497 1497 1498 1498 if(lpBytesReturned) { 1499 *lpBytesReturned = dwDataSize; 1499 *lpBytesReturned = dwDataSize; 1500 1500 } 1501 1501 … … 1633 1633 case IOCTL_SCSI_GET_CAPABILITIES: 1634 1634 { 1635 PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer; 1635 PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer; 1636 1636 1637 1637 if(nOutBufferSize < sizeof(IO_SCSI_CAPABILITIES) || … … 1677 1677 return FALSE; 1678 1678 } 1679 1679 1680 1680 if(!drvInfo || drvInfo->fCDIoSupported == FALSE) { 1681 1681 dprintf(("os2cdrom.dmd CD interface not supported!!")); … … 1842 1842 if((nNumberOfBytesToRead+offset) & 0xfff) 1843 1843 nrpages++; 1844 1844 1845 1845 map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages); 1846 1846 map->Release(); … … 2106 2106 if((nNumberOfBytesToWrite+offset) & 0xfff) 2107 2107 nrpages++; 2108 2108 2109 2109 map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages); 2110 2110 map->Release(); … … 2202 2202 2203 2203 dprintf2(("KERNEL32: HMDeviceDiskClass::GetFileSize %s(%08xh,%08xh)\n", 2204 lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh)); 2204 lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh)); 2205 2205 2206 2206 //If we didn't get an OS/2 handle for the disk before, get one now -
branches/gcc-kmk/src/kernel32/hmthread.cpp
r21457 r21720 34 34 #include "oslibmem.h" 35 35 36 #include <win \thread.h>36 #include <win/thread.h> 37 37 #include "thread.h" 38 38 #include "asmutil.h" … … 65 65 HANDLE hThread = pHMHandleData->hHMHandle; 66 66 67 if(lpIDThread == NULL) { 67 if(lpIDThread == NULL) { 68 68 lpIDThread = &threadid; 69 69 } … … 124 124 125 125 *lpIDThread = MAKE_THREADID(O32_GetCurrentProcessId(), *lpIDThread); 126 126 127 127 TEB *teb = GetTEBFromThreadHandle(hThread); 128 128 if(teb) { … … 134 134 135 135 dprintf(("CreateThread created %08x, id %x", pHMHandleData->hHMHandle, *lpIDThread)); 136 136 137 137 return pHMHandleData->hHMHandle; 138 138 } … … 603 603 pHMHandleData->hHMHandle, 604 604 dwTimeout)); 605 605 606 606 //This doesn't work very well in Open32 (object's state never signaled) 607 607 if(threadobj && threadobj->dwState == THREAD_TERMINATED) { -
branches/gcc-kmk/src/kernel32/lang.cpp
r21302 r21720 19 19 #include <odinwrap.h> 20 20 #include <heapstring.h> 21 #include <win \winreg.h>21 #include <win/winreg.h> 22 22 #include <winos2def.h> 23 23 #include "unicode.h" -
branches/gcc-kmk/src/kernel32/mmap.cpp
r21716 r21720 28 28 #include <stdlib.h> 29 29 #include <string.h> 30 #include <win \virtual.h>30 #include <win/virtual.h> 31 31 #include <odincrt.h> 32 32 #include <handlemanager.h> -
branches/gcc-kmk/src/kernel32/mmapdup.cpp
r21716 r21720 28 28 #include <stdlib.h> 29 29 #include <string.h> 30 #include <win \virtual.h>30 #include <win/virtual.h> 31 31 #include <odincrt.h> 32 32 #include <handlemanager.h> … … 35 35 #include "oslibmem.h" 36 36 #include "winimagepeldr.h" 37 #include <custombuild.h> 37 #include <custombuild.h> 38 38 39 39 #define DBG_LOCALLOG DBG_mmapdup … … 48 48 // 49 49 //****************************************************************************** 50 Win32MemMapDup::Win32MemMapDup(Win32MemMap *parent, HANDLE hFile, ULONG size, 50 Win32MemMapDup::Win32MemMapDup(Win32MemMap *parent, HANDLE hFile, ULONG size, 51 51 ULONG fdwProtect, LPSTR lpszName) : 52 52 Win32MemMap(hFile, size, fdwProtect, lpszName) … … 123 123 if((fdwAccess & FILE_MAP_READ) && !(mProtFlags & (PAGE_READWRITE|PAGE_READONLY))) 124 124 goto parmfail; 125 125 126 126 if (fdwAccess != FILE_MAP_ALL_ACCESS) 127 127 if((fdwAccess & FILE_MAP_COPY) && !(mProtFlags & PAGE_WRITECOPY)) … … 222 222 BOOL Win32MemMapDup::commitPage(ULONG ulFaultAddr, ULONG offset, BOOL fWriteAccess, int nrpages) 223 223 { 224 if(mProtFlags & PAGE_WRITECOPY) 224 if(mProtFlags & PAGE_WRITECOPY) 225 225 {//this is a COW map, call commitGuardPage 226 226 return commitGuardPage(ulFaultAddr, offset, fWriteAccess); … … 245 245 // 246 246 //****************************************************************************** 247 BOOL Win32MemMapDup::commitGuardPage(ULONG ulFaultAddr, ULONG ulOffset, 247 BOOL Win32MemMapDup::commitGuardPage(ULONG ulFaultAddr, ULONG ulOffset, 248 248 BOOL fWriteAccess) 249 249 { -
branches/gcc-kmk/src/kernel32/mmapnotify.cpp
r21716 r21720 6 6 * Calls notification handler when an exception occurs in the memory range of 7 7 * the map. 8 * 8 * 9 9 * Copyright 2003 Sander van Leeuwen (sandervl@innotek.de) 10 10 * … … 16 16 #include <stdlib.h> 17 17 #include <string.h> 18 #include <win \virtual.h>18 #include <win/virtual.h> 19 19 #include <odincrt.h> 20 20 #include <handlemanager.h> … … 23 23 #include "oslibmem.h" 24 24 #include "winimagepeldr.h" 25 #include <custombuild.h> 25 #include <custombuild.h> 26 26 #include <memmap.h> 27 27 … … 128 128 // Win32MemMapNotify::findMapByView 129 129 // 130 // Find the map of the view that contains the specified starting address 130 // Find the map of the view that contains the specified starting address 131 131 // and has the specified access type 132 132 // -
branches/gcc-kmk/src/kernel32/mmapview.cpp
r21716 r21720 28 28 #include <stdlib.h> 29 29 #include <string.h> 30 #include <win \virtual.h>30 #include <win/virtual.h> 31 31 #include <odincrt.h> 32 32 #include <handlemanager.h> … … 35 35 #include "oslibmem.h" 36 36 #include "winimagepeldr.h" 37 #include <custombuild.h> 37 #include <custombuild.h> 38 38 39 39 #define DBG_LOCALLOG DBG_mmapview … … 51 51 // 52 52 //****************************************************************************** 53 Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size, 53 Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size, 54 54 ULONG fdwAccess, Win32MemMap *owner) 55 55 { … … 87 87 { 88 88 //shared memory map, so map it into our address space 89 if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR) 89 if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR) 90 90 { 91 91 dprintf(("new OSLibDosGetNamedSharedMem FAILED")); … … 104 104 } 105 105 else { 106 if(mfAccess & MEMMAP_ACCESS_COPYONWRITE) 106 if(mfAccess & MEMMAP_ACCESS_COPYONWRITE) 107 107 { 108 108 //A copy on write view is a private copy of the memory map … … 118 118 } 119 119 } 120 else 120 else 121 121 if(OSLibDosAliasMem(viewaddr, size, &pMapView, accessAttr) != OSLIB_NOERROR) { 122 122 dprintf(("new OSLibDosAliasMem FAILED")); … … 126 126 } 127 127 } 128 //Allocate bitmap for all pages of a COW view to track which pages are 128 //Allocate bitmap for all pages of a COW view to track which pages are 129 129 //shared and which are private (copy on write -> private page) 130 if(fdwAccess == FILE_MAP_COPY) 130 if(fdwAccess == FILE_MAP_COPY) 131 131 { 132 132 DWORD nrPages = mSize >> PAGE_SHIFT; … … 242 242 viewpagestart = mOffset >> PAGE_SHIFT; 243 243 nrviewpages = mSize >> PAGE_SHIFT; 244 if(mSize & 0xFFF) 244 if(mSize & 0xFFF) 245 245 nrviewpages++; 246 246 … … 248 248 return; //outside this view 249 249 } 250 if(startpage + nrpages > viewpagestart + nrviewpages) { 250 if(startpage + nrpages > viewpagestart + nrviewpages) { 251 251 nrpages -= ((startpage + nrpages) - (viewpagestart + nrviewpages)); 252 252 } … … 286 286 } 287 287 288 if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD) ) || 289 ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) ) 288 if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD) ) || 289 ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) ) 290 290 { 291 291 //PAGEVIEW_GUARD only applies to COW views 292 292 //PAGEVIEW_VIEW/READONLY does not apply to COW views 293 return TRUE; 293 return TRUE; 294 294 } 295 295 if(mOffset + mSize <= offset || mOffset >= offset + size) { … … 320 320 } 321 321 322 if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE)) 322 if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE)) 323 323 { 324 324 DWORD startpage = (offset - mOffset) >> PAGE_SHIFT; … … 330 330 //of the COW pages, then only the shared pages must be changed. 331 331 //So check each page if it is still shared. 332 for(int i=startpage;i<startpage+nrPages;i++) 332 for(int i=startpage;i<startpage+nrPages;i++) 333 333 { 334 if(!isCOWPage(i)) 334 if(!isCOWPage(i)) 335 335 {//page is still shared, so set the guard flag 336 336 rc = OSLibDosSetMem((char *)pMapView+(offset - mOffset), PAGE_SIZE, accessAttr); … … 354 354 //****************************************************************************** 355 355 //****************************************************************************** 356 int Win32MemMapView::findViews(Win32MemMap *map, int nrViews, 356 int Win32MemMapView::findViews(Win32MemMap *map, int nrViews, 357 357 Win32MemMapView *viewarray[]) 358 358 { … … 362 362 Win32MemMapView *view = mapviews, *nextview; 363 363 364 if(view != NULL) 364 if(view != NULL) 365 365 { 366 while(view && i < nrViews) 366 while(view && i < nrViews) 367 367 { 368 368 if(view->getParentMap() == map) … … 384 384 Win32MemMapView *view = mapviews, *nextview; 385 385 386 if(view != NULL) 386 if(view != NULL) 387 387 { 388 while(view) 388 while(view) 389 389 { 390 390 nextview = view->next; … … 404 404 // Win32MemMap::findMapByView 405 405 // 406 // Find the map of the view that contains the specified starting address 406 // Find the map of the view that contains the specified starting address 407 407 // and has the specified access type 408 408 // -
branches/gcc-kmk/src/kernel32/osliblvm.cpp
r21583 r21720 21 21 #include <win32type.h> 22 22 #include <winconst.h> 23 #include <win \winioctl.h>23 #include <win/winioctl.h> 24 24 #include "osliblvm.h" 25 25 … … 89 89 rc = DosQueryProcAddr(hModLVM, 0, "Write_Sectors", (PFN *)&pfnWrite_Sectors); 90 90 if(rc) goto fail; 91 91 92 92 return TRUE; 93 93 … … 267 267 Volume_Control_Array *volctrl; 268 268 CARDINAL32 lasterror; 269 269 270 270 if(!hModLVM) { 271 271 dprintf(("LVM dll not loaded -> fail")); … … 310 310 //****************************************************************************** 311 311 //****************************************************************************** 312 BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 312 BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 313 313 LPSTR lpszVolumeName, DWORD cchBufferLength) 314 314 { … … 346 346 static Volume_Information_Record OSLibLVMFindVolumeByDriveLetter(ULONG driveLetter, 347 347 Volume_Control_Record *pVolRec, 348 CARDINAL32 *lasterror) 348 CARDINAL32 *lasterror) 349 349 { 350 350 Volume_Control_Array *volctrl; … … 384 384 static Volume_Information_Record OSLibLVMFindVolumeByName(LPSTR pszVolName, 385 385 Volume_Control_Record *pVolRec, 386 CARDINAL32 *lasterror) 386 CARDINAL32 *lasterror) 387 387 { 388 388 Volume_Control_Array *volctrl; … … 564 564 // - -1 if volume wasn't found 565 565 // - 0 if volume is present, but not mounted 566 // 566 // 567 567 //****************************************************************************** 568 568 CHAR OSLibLVMQueryDriveFromVolumeName(LPCSTR lpszVolume) … … 596 596 //****************************************************************************** 597 597 //****************************************************************************** 598 DWORD OSLibLVMQueryVolumeSerialAndName(LPSTR lpszVolume, LPDWORD lpVolumeSerialNumber, 598 DWORD OSLibLVMQueryVolumeSerialAndName(LPSTR lpszVolume, LPDWORD lpVolumeSerialNumber, 599 599 LPSTR lpVolumeNameBuffer, DWORD nVolumeNameSize) 600 600 { … … 621 621 //****************************************************************************** 622 622 //****************************************************************************** 623 BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, 624 LPSTR lpszVolumeName, 623 BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, 624 LPSTR lpszVolumeName, 625 625 DWORD cchBufferLength) 626 626 { … … 665 665 strncpy(lpszOS2VolumeName, &lpszWin32VolumeName[sizeof(VOLUME_NAME_PREFIX)-1+1], cchBufferLength-1); //-zero term + starting '{' 666 666 length -= sizeof(VOLUME_NAME_PREFIX)-1+1; 667 if(lpszOS2VolumeName[length-2] == '}') 667 if(lpszOS2VolumeName[length-2] == '}') 668 668 { 669 669 lpszOS2VolumeName[length-2] = 0; … … 671 671 } 672 672 else 673 if(lpszOS2VolumeName[length-1] == '}') 673 if(lpszOS2VolumeName[length-1] == '}') 674 674 { 675 675 lpszOS2VolumeName[length-1] = 0; -
branches/gcc-kmk/src/kernel32/osliblvm.h
r9693 r21720 15 15 #endif 16 16 17 #include <win \winioctl.h>17 #include <win/winioctl.h> 18 18 19 19 #ifdef OS2_INCLUDED … … 30 30 typedef unsigned long LBA; 31 31 32 /* Define a Partition Sector Number. A Partition Sector Number is 33 relative to the start of a partition. The first sector in a partition 32 /* Define a Partition Sector Number. A Partition Sector Number is 33 relative to the start of a partition. The first sector in a partition 34 34 is PSN 0. */ 35 35 typedef unsigned long PSN; … … 330 330 HANDLE OSLibLVMQueryVolumeControlData(); 331 331 void OSLibLVMFreeVolumeControlData(HANDLE hVolumeControlData); 332 BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 332 BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 333 333 LPSTR lpszVolumeName, DWORD cchBufferLength); 334 334 … … 338 338 ULONG OSLibLVMGetDriveType(LPCSTR lpszVolume); 339 339 CHAR OSLibLVMQueryDriveFromVolumeName(LPCSTR lpszVolume); 340 BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName, 340 BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName, 341 341 DWORD cchBufferLength); 342 342 -
branches/gcc-kmk/src/kernel32/oslibmem.cpp
r21711 r21720 31 31 #include <win32api.h> 32 32 #include <winconst.h> 33 #include <win \winioctl.h>33 #include <win/winioctl.h> 34 34 #include <dbglog.h> 35 35 #include <vmutex.h> -
branches/gcc-kmk/src/kernel32/process.cpp
r21716 r21720 27 27 #include <misc.h> 28 28 #include <wprocess.h> 29 #include <win \task.h>29 #include <win/task.h> 30 30 #include "winimagebase.h" 31 31 #include "oslibdos.h" … … 151 151 * GetProcessHeaps [KERNEL32.376] 152 152 */ 153 DWORD WINAPI GetProcessHeaps(DWORD nrofheaps,HANDLE *heaps) 153 DWORD WINAPI GetProcessHeaps(DWORD nrofheaps,HANDLE *heaps) 154 154 { 155 155 dprintf(("GetProcessHeaps: (%ld,%p), incomplete implementation.\n",nrofheaps,heaps)); … … 310 310 if ( !process ) return 0; 311 311 312 switch ( offset ) 312 switch ( offset ) 313 313 { 314 314 case GPD_APP_COMPAT_FLAGS: … … 379 379 380 380 /*********************************************************************** 381 * ODIN_SetProcessDword 381 * ODIN_SetProcessDword 382 382 * 383 383 * SvL: Special version that allows the caller to change some values … … 391 391 if ( !process ) return; 392 392 393 switch ( offset ) 393 switch ( offset ) 394 394 { 395 395 case GPD_STARTF_SHOWWINDOW: … … 424 424 if ( !process ) return; 425 425 426 switch ( offset ) 426 switch ( offset ) 427 427 { 428 428 case GPD_APP_COMPAT_FLAGS: … … 444 444 445 445 case GPD_USERDATA: 446 process->process_dword = value; 446 process->process_dword = value; 447 447 break; 448 448 … … 488 488 if(!NtdllRtlExtendedIntegerMultiply) { 489 489 HINSTANCE hInstance = LoadLibraryA("NTDLL.DLL"); 490 if(hInstance) 490 if(hInstance) 491 491 *(VOID **)&NtdllRtlExtendedIntegerMultiply=(void*)GetProcAddress(hInstance, (LPCSTR)"RtlExtendedIntegerMultiply"); 492 492 } -
branches/gcc-kmk/src/kernel32/virtual.cpp
r21675 r21720 23 23 #include <stdlib.h> 24 24 #include <string.h> 25 #include <win \virtual.h>26 #include <win \thread.h>25 #include <win/virtual.h> 26 #include <win/thread.h> 27 27 #include <heapstring.h> 28 28 #include <handlemanager.h> -
branches/gcc-kmk/src/kernel32/winimagebase.cpp
r21716 r21720 38 38 #include "initterm.h" 39 39 #include "directory.h" 40 #include <win \virtual.h>40 #include <win/virtual.h> 41 41 #include <winconst.h> 42 42 -
branches/gcc-kmk/src/kernel32/winimagebase.h
r10397 r21720 20 20 #include <winconst.h> 21 21 #else 22 #include <win \winnls.h>22 #include <win/winnls.h> 23 23 #endif 24 24 -
branches/gcc-kmk/src/kernel32/winimagelx.cpp
r21716 r21720 42 42 #include "oslibmisc.h" 43 43 #include "initterm.h" 44 #include <win \virtual.h>44 #include <win/virtual.h> 45 45 46 46 #define DBG_LOCALLOG DBG_winimagelx -
branches/gcc-kmk/src/kernel32/winimagepeldr.cpp
r21355 r21720 56 56 #include "oslibmisc.h" 57 57 #include "initterm.h" 58 #include <win \virtual.h>58 #include <win/virtual.h> 59 59 #include "oslibdos.h" 60 60 #include "oslibmem.h" -
branches/gcc-kmk/src/kernel32/wprocess.cpp
r21673 r21720 52 52 #include "shellapi.h" 53 53 54 #include <win \ntddk.h>55 #include <win \psapi.h>54 #include <win/ntddk.h> 55 #include <win/psapi.h> 56 56 57 57 #include <custombuild.h>
Note:
See TracChangeset
for help on using the changeset viewer.
