Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/kernel32/hmdisk.cpp

    r9911 r21916  
    1818#include "hmdisk.h"
    1919#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>
    2323#include "oslibdos.h"
    2424#include "osliblvm.h"
     
    4343typedef struct
    4444{
    45     BOOL      fCDIoSupported;   
     45    BOOL      fCDIoSupported;
    4646    ULONG     driveLetter;
    4747    ULONG     driveType;
     
    163163    szDrive[2] = '\0';
    164164
    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))
    167167    {
    168168        int length;
     
    171171            return ERROR_FILE_NOT_FOUND;    //not allowed
    172172        }
    173         if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName))) 
     173        if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName)))
    174174        {
    175175            BOOL fLVMVolume;
     
    184184                return ERROR_FILE_NOT_FOUND;    //not found
    185185            }
    186             if(szDrive[0] == 0) 
     186            if(szDrive[0] == 0)
    187187            {
    188188                //volume isn't mounted
    189                
     189
    190190                //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);
    192192                fPhysicalDisk    = TRUE;
    193193                dwPhysicalDiskNr = volext.Extents[0].DiskNumber + 1;
     
    211211        else return ERROR_FILE_NOT_FOUND;
    212212    }
    213     else 
    214     if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0) 
     213    else
     214    if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0)
    215215    {
    216216        if(!fPhysicalDiskAccess) {
     
    304304        drvInfo->fLocked   = FALSE;
    305305
    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
    307307        //(no other choice for unmounted volumes)
    308308        drvInfo->fPhysicalDisk    = fPhysicalDisk;
     
    348348        if(pHMHandleData->hHMHandle && drvInfo->dwShare == 0) {
    349349            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))
    351351            {
    352352                dprintf(("Sharing violation while attempting to lock the drive"));
     
    411411        if(hFile && drvInfo->dwShare == 0) {
    412412            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))
    414414            {
    415415                dprintf(("Sharing violation while attempting to lock the drive"));
     
    522522{
    523523#ifdef DEBUG
    524     char *msg = NULL;
     524    const char *msg = NULL;
    525525
    526526    switch(dwIoControlCode)
     
    890890        //label has changed
    891891        //TODO: Find better way to determine if floppy was removed or switched
    892         if(drvInfo->driveType != DRIVE_FIXED) 
     892        if(drvInfo->driveType != DRIVE_FIXED)
    893893        {
    894894            rc = OSLibDosQueryVolumeSerialAndName(1 + drvInfo->driveLetter - 'A', &volumelabel, NULL, 0);
     
    14391439        return (ret == ERROR_SUCCESS);
    14401440    }
    1441    
     1441
    14421442    case IOCTL_CDROM_RAW_READ:
    14431443    {
    14441444#pragma pack(1)
    1445        struct 
     1445       struct
    14461446       {
    14471447        ULONG       ID_code;
     
    14971497
    14981498        if(lpBytesReturned) {
    1499             *lpBytesReturned = dwDataSize; 
     1499            *lpBytesReturned = dwDataSize;
    15001500        }
    15011501
     
    16331633    case IOCTL_SCSI_GET_CAPABILITIES:
    16341634    {
    1635         PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer; 
     1635        PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer;
    16361636
    16371637        if(nOutBufferSize < sizeof(IO_SCSI_CAPABILITIES) ||
     
    16771677            return FALSE;
    16781678        }
    1679        
     1679
    16801680        if(!drvInfo || drvInfo->fCDIoSupported == FALSE) {
    16811681            dprintf(("os2cdrom.dmd CD interface not supported!!"));
     
    18421842        if((nNumberOfBytesToRead+offset) & 0xfff)
    18431843            nrpages++;
    1844    
     1844
    18451845        map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages);
    18461846        map->Release();
     
    21062106        if((nNumberOfBytesToWrite+offset) & 0xfff)
    21072107            nrpages++;
    2108    
     2108
    21092109        map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages);
    21102110        map->Release();
     
    22022202
    22032203    dprintf2(("KERNEL32: HMDeviceDiskClass::GetFileSize %s(%08xh,%08xh)\n",
    2204               lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh)); 
     2204              lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh));
    22052205
    22062206    //If we didn't get an OS/2 handle for the disk before, get one now
Note: See TracChangeset for help on using the changeset viewer.