[misc] fix small issues

* SetAutoMount()/GetAutoMount() should check for INVALID_HANDLE_VALUE and not NULL.
  Also we don't actually need to open MOUNTMGR_DOS_DEVICE_NAME rw to issue an IOCTL.
* ToggleEsp() failed to exit properly when an ESP offset was specified.
* Introduce PI_MAX to explicitly set the size of the partition_information table.
* write_sectors() has write retry, so there's no need to perform one on top of it.
* When we exit FormatThread(), GetLogicalName() should attempt to look for the the
  main partition and be silent.
This commit is contained in:
Pete Batard 2020-10-25 12:31:30 +00:00
parent a17ca005ce
commit 8085a2846d
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 27 additions and 40 deletions

View file

@ -41,6 +41,7 @@
#define PI_MAIN 0
#define PI_ESP 1
#define PI_CASPER 2
#define PI_MAX 3
// The following should match VDS_FSOF_FLAGS as much as possible
#define FP_FORCE 0x00000001
@ -362,7 +363,7 @@ typedef struct {
} ClusterSize[FS_MAX];
} RUFUS_DRIVE_INFO;
extern RUFUS_DRIVE_INFO SelectedDrive;
extern uint64_t partition_offset[3];
extern uint64_t partition_offset[PI_MAX];
BOOL SetAutoMount(BOOL enable);
BOOL GetAutoMount(BOOL* enabled);