- Timestamp:
- Dec 8, 2001, 5:06:49 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmdisk.cpp
r7575 r7585 1 /* $Id: hmdisk.cpp,v 1.3 6 2001-12-08 14:28:53sandervl Exp $ */1 /* $Id: hmdisk.cpp,v 1.37 2001-12-08 16:06:49 sandervl Exp $ */ 2 2 3 3 /* … … 108 108 HFILE hFile; 109 109 HFILE hTemplate; 110 DWORD dwDriveType; 110 111 111 112 dprintf2(("KERNEL32: HMDeviceDiskClass::CreateFile %s(%s,%08x,%08x,%08x)\n", … … 121 122 return ERROR_INVALID_PARAMETER; 122 123 } 123 124 125 dwDriveType = GetDriveTypeA(lpFileName); 126 124 127 //Disable error popus. NT allows an app to open a cdrom/dvd drive without a disk inside 125 128 //OS/2 fails in that case with error ERROR_NOT_READY … … 132 135 pHMHandleData->dwFlags, 133 136 hTemplate); 137 138 //It is not allowed to open a readonly device with GENERIC_WRITE in OS/2; 139 //try with readonly again if that happened 140 //NOTE: Some applications open it with GENERIC_WRITE as Windows 2000 requires 141 // this for some aspi functions 142 if(hFile == INVALID_HANDLE_ERROR && dwDriveType == DRIVE_CDROM && 143 (pHMHandleData->dwAccess & GENERIC_WRITE)) 144 { 145 pHMHandleData->dwAccess &= ~GENERIC_WRITE; 146 hFile = OSLibDosCreateFile((LPSTR)lpFileName, 147 pHMHandleData->dwAccess, 148 pHMHandleData->dwShare, 149 (LPSECURITY_ATTRIBUTES)lpSecurityAttributes, 150 pHMHandleData->dwCreation, 151 pHMHandleData->dwFlags, 152 hTemplate); 153 } 134 154 SetErrorMode(oldmode); 135 155 … … 164 184 } 165 185 166 drvInfo->driveType = GetDriveTypeA(lpFileName);186 drvInfo->driveType = dwDriveType; 167 187 if(drvInfo->driveType == DRIVE_CDROM) 168 188 {
Note:
See TracChangeset
for help on using the changeset viewer.