Changeset 21916 for trunk/src/kernel32/hmdisk.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/kernel32/hmdisk.cpp
r9911 r21916 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")); … … 522 522 { 523 523 #ifdef DEBUG 524 c har *msg = NULL;524 const char *msg = NULL; 525 525 526 526 switch(dwIoControlCode) … … 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
Note:
See TracChangeset
for help on using the changeset viewer.