Handle up to 63 partitions per drive
Revamp device parsing code. Introducing support for more partitions into the shilka-generated parser has the unfortunate side-effect of raising the size of the DLL by almost 2 Megs. Therefore we split out the handling for /dev/sdXY devices into a tiny bit of hand-written code. While at it, remove some unused cruft from devices.* and generally clean up the device class to provide access methods instead of direct access to members. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
		@@ -159,8 +159,9 @@ fhandler_dev_floppy::lock_partition (DWORD to_write)
 | 
			
		||||
  /* The simple case.  We have only a single partition open anyway.
 | 
			
		||||
     Try to lock the partition so that a subsequent write succeeds.
 | 
			
		||||
     If there's some file handle open on one of the affected partitions,
 | 
			
		||||
     this fails, but that's how it works on Vista and later... */
 | 
			
		||||
  if (get_minor () % 16 != 0)
 | 
			
		||||
     this fails, but that's how it works on Vista and later...
 | 
			
		||||
     Only DEV_SD7_MAJOR and less can point to partition 0. */
 | 
			
		||||
  if (get_major () <= DEV_SD7_MAJOR && get_minor () % 16 != 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (!DeviceIoControl (get_handle (), FSCTL_LOCK_VOLUME,
 | 
			
		||||
			   NULL, 0, NULL, 0, &bytes_read, NULL))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user