Changeset 9310 for trunk/src/kernel32/hmdisk.cpp
- Timestamp:
- Sep 30, 2002, 2:53:27 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmdisk.cpp
r9304 r9310 1 /* $Id: hmdisk.cpp,v 1.5 6 2002-09-27 14:35:56sandervl Exp $ */1 /* $Id: hmdisk.cpp,v 1.57 2002-09-30 12:53:27 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 #define BCDToDec(a) ((a >> 4) * 10 + (a & 0xF)) 39 39 40 41 #define UNMOUNTED_VOLUME(a) (a->fPhysicalDisk && (a->StartingOffset.HighPart != 0 || a->StartingOffset.LowPart != 0)) 40 42 41 43 typedef struct … … 307 309 drvInfo->dwPhysicalDiskNr = dwPhysicalDiskNr; 308 310 drvInfo->StartingOffset = volext.Extents[0].StartingOffset; 311 drvInfo->CurrentFilePointer = drvInfo->StartingOffset; 309 312 drvInfo->PartitionSize = volext.Extents[0].ExtentLength; 310 313 … … 1730 1733 //if unmounted volume, check upper boundary as we're accessing the entire physical drive 1731 1734 //instead of just the volume 1732 if(drvInfo->fPhysicalDisk && (drvInfo->StartingOffset.HighPart != 0 || 1733 drvInfo->StartingOffset.LowPart != 0)) 1735 if(UNMOUNTED_VOLUME(drvInfo)) 1734 1736 { 1735 1737 LARGE_INTEGER distance, result, endpos; … … 1771 1773 //if unmounted volume, add starting offset to position as we're accessing the entire physical drive 1772 1774 //instead of just the volume 1773 if(drvInfo->fPhysicalDisk && (drvInfo->StartingOffset.HighPart != 0 || 1774 drvInfo->StartingOffset.LowPart != 0) && bRC == TRUE) 1775 if(UNMOUNTED_VOLUME(drvInfo) && bRC == TRUE) 1775 1776 { 1776 1777 LARGE_INTEGER distance, result; … … 1832 1833 //if unmounted volume, add starting offset to position as we're accessing the entire physical drive 1833 1834 //instead of just the volume 1834 if(drvInfo->fPhysicalDisk && (drvInfo->StartingOffset.HighPart != 0 || 1835 drvInfo->StartingOffset.LowPart != 0)) 1835 if(UNMOUNTED_VOLUME(drvInfo)) 1836 1836 { 1837 1837 LARGE_INTEGER distance, result, endpos; … … 1851 1851 //calculate end position in partition 1852 1852 Add64(&drvInfo->StartingOffset, &drvInfo->PartitionSize, &endpos); 1853 result.HighPart = 0;1854 result.LowPart = 1;1855 Sub64(&endpos, &result, &endpos);1856 1853 1857 1854 switch(dwMoveMethod) { … … 1886 1883 (DWORD *)&result.HighPart, 1887 1884 FILE_BEGIN); 1888 1889 Sub64(&result, &drvInfo->StartingOffset, &drvInfo->CurrentFilePointer); 1890 ret = drvInfo->CurrentFilePointer.LowPart; 1885 //save new file pointer 1886 drvInfo->CurrentFilePointer.HighPart = result.HighPart; 1887 drvInfo->CurrentFilePointer.LowPart = ret; 1888 1889 //subtract volume start to get relative offset 1890 Sub64(&drvInfo->CurrentFilePointer, &drvInfo->StartingOffset, &result); 1891 ret = result.LowPart; 1891 1892 if(lpDistanceToMoveHigh) { 1892 *lpDistanceToMoveHigh = drvInfo->CurrentFilePointer.HighPart;1893 *lpDistanceToMoveHigh = result.HighPart; 1893 1894 } 1894 1895 } … … 1997 1998 //if unmounted volume, check upper boundary as we're accessing the entire physical drive 1998 1999 //instead of just the volume 1999 if(drvInfo->fPhysicalDisk && (drvInfo->StartingOffset.HighPart != 0 || 2000 drvInfo->StartingOffset.LowPart != 0)) 2000 if(UNMOUNTED_VOLUME(drvInfo)) 2001 2001 { 2002 2002 LARGE_INTEGER distance, result, endpos; … … 2024 2024 } 2025 2025 // else { 2026 #if 0 2027 bRC = TRUE; 2028 *lpNumberOfBytesWritten = nNumberOfBytesToWrite; 2029 #else 2026 2030 bRC = OSLibDosWrite(pHMHandleData->hHMHandle, 2027 2031 (PVOID)lpRealBuf, 2028 2032 nNumberOfBytesToWrite, 2029 2033 lpNumberOfBytesWritten); 2034 #endif 2030 2035 // } 2031 2036 2032 2037 //if unmounted volume, add starting offset to position as we're accessing the entire physical drive 2033 2038 //instead of just the volume 2034 if(drvInfo->fPhysicalDisk && (drvInfo->StartingOffset.HighPart != 0 || 2035 drvInfo->StartingOffset.LowPart != 0) && bRC == TRUE) 2039 if(UNMOUNTED_VOLUME(drvInfo) && bRC == TRUE) 2036 2040 { 2037 2041 LARGE_INTEGER distance, result;
Note:
See TracChangeset
for help on using the changeset viewer.