Commit Graph

211 Commits

Author SHA1 Message Date
Pete Batard 4617f91e3b
[misc] introduce hImageOption and ComboBox_GetCurItemData() to simplify code
* Also add retry to ms-sys' write_sectors()
2020-07-17 21:51:15 +01:00
Pete Batard 500172a7a3
[core] fix format error when trying to use old BIOS fixes with VHDs
* And other improvements
* Closes #1409
2020-07-03 15:24:37 +01:00
Pete Batard c8078b0119
[misc] fix Coverity warnings
* Also re-instate the _coverity.cmd script and try to fix AppVeyor Coverity uploads
2020-06-19 10:53:40 +01:00
Pete Batard c601aed054
[core] add option to write a small enough ISO to an ESP
* This is mostly aimed at Debian 11 netinst on the Raspberry Pi 4
* Only available for regular UEFI ISOs if GPT and FAT are selected (no MBR ESPs).
* Also fix a MinGW warning in GetUnusedDriveLetter()
2020-06-06 22:19:20 +01:00
Pete Batard 23057f6124
[core] add a cheat mode (Alt-P) to toggle GPT ESP to Basic Data
* Windows 10 or later *ONLY*
* Also don't report a GPT partition name if it's empty
2020-06-06 16:37:25 +01:00
Pete Batard 3b327bff83
[loc] flag "Deleting partitions" message as a potential lengthy operation
* Also use this update to factorize all "This may take a while" messages.
2020-06-03 16:03:20 +01:00
Pete Batard 56e87429d7
[misc] fix MinGW/gcc 10.x multiple definition errors 2020-05-18 21:25:44 +01:00
Derek Foreman 8a59238022
[core] don't leak logical handle from GetDriveLabel()
* Closes #1525
2020-04-28 17:47:26 +01:00
Pete Batard 70fb34549b
[misc] fix a VS2019 analysis warning
* Also fix minor whitespace issues.
2020-04-11 15:02:08 +01:00
Pete Batard 2442aaf76f
[dev] improve FIXED vs REMOVABLE detection for drives with unmounted partitions
* And add an exception for a reported flash drive
* Also fix a couple warnings in msapi_utf8.h and net.c
2020-04-10 13:16:57 +01:00
Pete Batard e0bc2e5ffd
[core] fix reporting of unpartitioned drives
* Also add an extra note to the protective GPT MBR
2020-02-20 11:58:03 +00:00
Pete Batard 88be86d3d4
[core] improve reporting of partition types
* Add GPT partition types and improve MBR partition type handling
2020-02-06 18:23:19 +00:00
Pete Batard bf8d888b21
[ext2fs] fix creation of persistent partitions for pre-1703 platforms
* Windows platforms prior to Windows 10 1703 cannot access any logical partition besides the
  first one (we don't even get a volume for those).
* This fix enables the use of physical + offset for ext# formatting to work around this,
  which is file since we don't actually need to mount the partition.
* Also fix ext2fs_open2() not handling normalized versions of Windows drive paths ("\\?\...")
* Also fix an issue where we would make the drive letter unavailable after formatting a
  standalone partition to ext#.
* Also ensure that we return an error if the drive we attempt to locate a partition on
  through an offset does not match the currently selected one.
* Also remove some unused calls in drive.c.
* Closes #1374
2019-09-14 23:33:46 +01:00
Pete Batard 4c816a519e
[misc] update license URLs and align ms-sys's write_data buffer to 4K
* Also remove some obsolete TODOs
2019-09-06 11:32:37 +01:00
Pete Batard 94e2015edf
[core] use offset rather than index to identify a partition
* Also fix potential bcdboot invocation failure by introducing a new AltGetLogicalName() call.
* Also use the AltMount calls for ext# formatting
2019-08-18 14:13:09 +01:00
Pete Batard 936bd9beb0
[core] revert to having the ESP as the last partition
* This is to avoid Microsoft's appalling refresh of the partition layout,
  which can result in partitions not being assigned a volume GUID.
* Mostly reverts a change that was applied in 1c39a80d72.
* Also add some more enum output and bail if we can't get a logical drive.
* Closes #1351
2019-08-13 09:14:13 +01:00
Pete Batard f95aa94c57
[core] prevent the enumeration of Windows 10 19H1 sandbox VHDs
* The new 19H1 Windows Sandbox feature relies on VHDs labelled 'PortableBaseLayer' → Don't list those
2019-07-15 12:35:22 +01:00
Pete Batard 8b18d8ce1d
[core] add CycleDevice and VDS layout refresh
* Also fix some minor issues
2019-05-23 13:09:25 +01:00
Pete Batard 2ff6da49f0
[extfs] add standalone ext2/ext3 formatting
* Only enabled when Advanced format options are shown
* Also enable reading of extfs volume label
* Also improve GRUB lookup fallback
* Also fix possible truncation when sanitizing labels
* Also write a zeroed MBR when non-bootable is selected
2019-05-03 23:51:05 +01:00
Pete Batard 5ae6e4f494
[ext2fs] improve error reporting
* Also clean up VDS error messages
2019-05-02 15:41:42 +01:00
Pete Batard 5f9e65707f
[core] partitioning improvements
* Improve report and make sure we zero leftovers from the start of a partition
* Also add VDS error codes
* Also fix Coverity warnings
2019-04-27 16:04:47 +01:00
Pete Batard 1c39a80d72
[core] partial overhaul of the partitioning and formatting facilities
* Add VDS formatting support (through an Alt-V cheat mode)
* Add partition index support
* Improve(?) Windows To Go support by following Microsoft recommended partition order
* Code refactoring & cleanup
2019-04-25 18:58:55 +01:00
Pete Batard 4b38483a68
[ext2fs] improve persistence partition creation's progress report
* Closes #691
2019-04-19 13:24:20 +01:00
Pete Batard 0ad3f8c1d3
[ext2fs] integrate ext3 formatting into UI operations
* Add display of persistence controls on relevant images
* Add progress on ext3 formatting and improve error reporting
* Also improve MountVolume() and fix some Coverity warnings
2019-04-16 20:44:13 +01:00
Pete Batard ccf0f1bf3c
[ext2fs] add journal support for ext3 formatting
* Also clean up code, handle errors and fix issues
2019-04-15 17:04:39 +01:00
Pete Batard 9610e3a63b
[misc] refactor some global variables' names so we can reinstate -Wshadow
* Also remove no longer used _coverity.cmd and update .gitignore
2019-04-13 15:29:27 +01:00
Pete Batard cda716c1ff
[ext2fs] initial ext2fs support 2019-04-12 21:32:40 +01:00
Pete Batard 06b33f94e4
[core] alter the drive letter we use when Windows has already remounted it
* Our code should be flexible enough to do just that and this will also
  alleviate requiring end users to retry an operation.
2019-04-08 16:29:17 +01:00
Pete Batard f98c243eb8
[iso] fix crash when opening Windows ISOs
* Closes #1268
* Issue was introduced in 521034da99 and has
  to do with VS2017's handling of static strings in RELEASE mode.
  Fix is to use a static char array instead.
* Also fix MinGw build warnings and increase process search timeout
2019-01-31 13:50:03 +00:00
Pete Batard befe2606cf
[misc] use %S to print wchar_t strings where possible
* Also fix some Coverity warnings
2019-01-03 12:29:28 +00:00
Pete Batard c0526b3e8b
[core] invoke VDS to delete all partitions before format/write 2018-11-28 10:50:00 +00:00
Pete Batard 04a5793ee7
[misc] use compilation flag to undefine NDEBUG for assert 2018-11-21 17:45:18 +00:00
Pete Batard 15806de646
[ui] display a notice about Secure Boot when UEFI:NTFS is applied 2018-11-20 12:33:12 +00:00
Pete Batard 790b188b3d [ui] fix disabling of Quick Format checkbox
* Closes #1211
* Also fix MBR analysis report displayed each time the user changes boot selection
2018-10-03 19:14:40 +02:00
Pete Batard 71578459d7 [loc] fix spaces before full stops
* Also: "Asserts, it's not just for debug any more!"
2018-07-31 20:47:24 +01:00
Pete Batard 7c142fadbc [net] improve handling of invalid signatures
* Also make bPromptOnError an actual parameter to the download function calls
* Also prefer the use of assert() to custom assertion messages
2018-06-30 22:45:15 +01:00
Pete Batard faebe1040f v3.1 (build 1320)
* Also update GitHub issue template for 3.0 UI
* Also increase size of the ESP to 300MB, for Windows To Go drives using GPT (See #979)
2018-06-19 12:00:28 +01:00
Pete Batard 4a8c5be9c5 [misc] fix coverity warnings in drive.c
* Also apply minor fixes to rufus.loc and _set_git_hooks.sh
2018-05-15 10:23:45 +01:00
Pete Batard 39cb35e20c [core] improve UEFI:NTFS detection
* Check the label for MBR partitions to avoid false positives (such as with Debian live)
2018-05-08 15:25:53 +01:00
Pete Batard 9545123711 [core] eliminate querying of floppy drives during enumeration 2018-04-02 14:57:39 +01:00
Pete Batard 1dbbe69a4b [ui] improve partition scheme default selection
* Also rename our variable to PartitionStyle/ps for clarity
2018-03-26 19:06:55 +01:00
Pete Batard a44518355f [ui] UI redesign
* Better guide the user through the flow of operations
* Also follow a concept design by Fahad Al-Riyami
* Closes #117
2018-03-22 23:14:21 +00:00
Pete Batard 903ac993f2 [misc] remove no longer needed XP workarounds 2017-11-13 14:30:25 +00:00
Pete Batard c22b378f9a [misc] display image and disk size in the log
* Also fix 2 Coverity warnings
* Also remove unneeded LFs in drive.c
2017-09-08 15:38:30 +01:00
Pete Batard 4a213c3ba0 [core] allow the use of A: and B: as drive letters and fix in-use detection for Z:
* Closes #1016
* Also expand support for Arch Linux derivatives Syslinux config files
2017-09-06 14:00:31 +01:00
Pete Batard c82842ce2a [core] add Super Floppy Disk support 2017-08-12 15:12:00 +01:00
Pete Batard 90dc847e24 [misc] add static_strcat & static_strcpy and use static_ calls wherever possible
* Also set Rufus next to 2.17 and fix a warning
2017-08-10 19:43:52 +01:00
Pete Batard 4617ba786d [process] add a timeout for the process search
* The process search appears to be blocking on some platform, and we
  also don't want users to have to wait too long on format startup
* Also update the update check for Windows XP SSL errors
2017-07-20 17:43:38 +01:00
Pete Batard bed889718e [core] attempt to continue if the only conflicting handles we found are for read-only
* Also clean-up the process code and update for rufus-next
2017-07-13 21:53:44 +01:00
Pete Batard 7ec8db5602 [process] check for volumes open with executable access rights
* This allows us to properly identify an open command prompt as a blocking process
* Also, since FSCTL_LOCK_VOLUME is slow, switch to using an actual timeout
2017-05-08 16:58:26 +01:00
Pete Batard 867177c5cd [misc] expand lock cheat mode to also apply to write sharing
* Also improve log messages
2017-05-03 14:48:24 +01:00
Pete Batard 23390bf911 [core] relax the FILE_SHARE_WRITE rules during enumeration
* Should allow enumeration of drives, that other process have open
  with RW access, back again (looking at you, Paragon!!!)
2017-05-02 00:56:07 +01:00
Pete Batard d5f6ddb653 [core] list potentially blocking processes on disk access error
* Using functionality from Process Hacker:
  https://github.com/processhacker2/processhacker2/
* Part of the #773 enhancement
* Also fix minor MinGW and WDK warnings
2017-04-27 23:06:42 +01:00
Pete Batard caa9b06426 [core] work around Windows 10 CU potentially selecting the UEFI:NTFS partition for formatting
* Should only happen with Windows 10 Creator Update (1703)
* Closes #931
* Also silence the flow of bcdboot benign errors on WinToGo creation (unless USB Debug is enabled)
* Also ensure WaitForLogical() will not actually spends 15 seconds max before giving up
2017-04-11 22:15:05 +01:00
Pete Batard 854620d0ba [core] relax the rule for exclusive write access
* If we can't get a write handle for more than 5 seconds, retry with FILE_SHARE_WRITE
* This is a partial revert of 2f81e4f177, in order to address #924.
2017-04-09 21:08:34 +01:00
Pete Batard 477ff95f93 [core] display device paths in GetHandle()
* Also reorder bLockDrive and bWriteAccess parameters
2017-04-08 21:58:10 +01:00
Pete Batard 2f81e4f177 [core] avoid the use of FILE_SHARE_WRITE
* Not having FILE_SHARE_WRITE on a disk or volume handle helps
  prevent spurious accesses from the OS or other apps while we
  are repartitioning/refomatting.
2017-02-16 14:13:30 +00:00
Pete Batard c72aa7be0a [core] don't clean up partition data before writing a disk image
* This workaround seems to be needed for the upcoming Windows 10 rs2_release (see #883)
* Also some minor fixes
* Closes #883
2017-02-14 12:44:25 +00:00
Pete Batard e62ab37e38 [bled] improve error reporting
* Also make the use of a FIXED drive more noticeable in the log
2017-01-11 01:12:00 +00:00
Pete Batard 08b6ce38c2 [core] fix a potential Could not get Disk Extents message
* Reported in #880
2017-01-05 15:42:24 +00:00
Pete Batard 8ca644de5a [core] fix sanitizing of exFAT labels
* Closes #818
2016-08-31 13:01:39 +01:00
Pete Batard d9a928f5bc [core] fix handling of BFD drives
* A BFD (Big Floppy Disk) is a disk that isn't actually partitioned,
  but where the first data sector starts at sector 0
* Closes #814
2016-08-21 14:06:15 +02:00
Pete Batard 91eec034b1 [core] try not to clear MBR/GPT sectors higher than the lowest partition
* This ensures that a drive can be reformatted without error after writing
  an image such as super_grub2_disk_x86_64_efi_2.02s4.iso
2016-07-07 18:13:01 +01:00
Pete Batard ed1b3fd72e [iso] reload label after formatting
* The Windows APIs may further modify the label compared to our proposed
  version (e.g. remove trailing spaces), and we need an exact label for
  the Syslinux/GRUB config file update.
* This issue was reported against Springdale Linux, where the isolinux.cfg
  label was patched using 'SPRINGDALE\x20' instead of 'SPRINGDALE'
* Closes #784
* Also ensure that we don't replace NULL buffers in msapi_utf8.h and add
  GetVolumeInformationU()
2016-06-26 22:24:16 +02:00
Pete Batard d85a4e4307 [efi] ensure that the UEFI:NTFS partition is properly sized 2016-06-16 18:29:15 +02:00
Pete Batard 2495f2d444 [misc] fix a new set of MinGW warnings 2016-05-30 17:49:32 +01:00
Pete Batard 81673ade26 [core] clean up the RUFUS_DRIVE_INFO struct
* Remove the duplication of DISK_GEOMETRY to keep only the variables we actually use
* Also set rufus-next to 2.10
2016-05-23 12:19:43 +01:00
Pete Batard 258a4f7ca0 [core] work around a Windows bug that may render a disk inaccessible on cleanup
* The root of the issue is that Windows IOCTL_DISK_CREATE_DISK does not properly
  zero all of the MBR/GPT/PBR structure with PARTITION_STYLE_RAW (which is what
  diskpart uses to clean a disk), and leaves plenty of partition artefacts behind.
* This means that, when an image with complex partitioning has been applied, such
  as Chromium/ChromeOS, you may end up with a drive that can not be repartitioned
  or reformatted in Windows (and this is completely independent of whether Rufus
  was used to perform these operations - For instance you will get the same issue
  if you use Win32DiskImager and diskpart + clean).
* The only option left for users then is to reset/repartition their drives in Linux
  or some other OS, as Windows' VDS becomes incapacitated to handle the drive, as
  the problem persists independently of reset/re-plug/Windows platform being used.
* To work around this, we ensure that we zero the MBR/GPT/PBR sectors BEFORE calling
  IOCTL_DISK_CREATE_DISK.
* Also move zeroing of the drive before partition reset.
* Closes #759
2016-05-21 16:34:34 +01:00
Pete Batard d4c518a4ae [misc] update UEFI:NTFS partition detection 2016-04-28 11:06:32 +02:00
Pete Batard 250d46e401 [core] use GetTickCount64() always where possible
* Damn you XP!!!
* Also some more code cleanup
2016-02-24 16:10:54 +00:00
Pete Batard c3f47ada06 [misc] add missing.h header
* Also clean up code
2016-02-20 22:52:32 +00:00
Pete Batard f88faf1a4f [usb] enable listing of non USB card readers
* Also fix the VID:PID population of USB card readers
* Also improve enumeration debugging
* Also add an unofficial cheat mode to list non USB *REMOVABLE* drives
* Closes #693
2016-02-16 20:43:30 +00:00
Pete Batard f2a539a48c [core] add and use WriteFileWithRetry() where possible 2016-01-14 17:43:02 +00:00
Pete Batard b77561bb9b [ms-sys] update ms-sys to current
* NB: This includes an updated Syslinux MBR
2016-01-07 15:49:58 +00:00
Pete Batard 549bf731a6 [ui] fix UEFI/BIOS mode never being disabled once enabled
* Closes #635
* Also fix minor logic issue and trailing whitespaces
2015-11-05 22:54:38 +00:00
Pete Batard 703e169a8c [core] fix elimination of card readers that contain no media
* Closes #400
2015-09-19 17:00:51 +01:00
Pete Batard 3839bf42ce v2.3 (build 709)
* Closes #476
* Also removes the stacksize warning during VS code analysis
2015-08-28 23:12:55 +01:00
Pete Batard 5004374277 [misc] update to VS2015 and fix VS code analysis issues
* Also update Bled to latest, as well as build scripts
* Note: Considering that Visual Studio 2015 is both freely and legally
  available for anyone who wants to use it to compile Rufus, starting
  with this commit, I will NOT be supporting any other version of Visual
  Studio but 2015.
2015-08-10 23:30:23 +01:00
Pete Batard cc6234296d [togo] don't apply the 'set internal disks offline' policy
* This creates issue due to dism incompatibilities between Windows versions
  and some users are puzzled why they don't see their internal disks.
* Also make the bcdboot call more robust by using the system one if the USB one fails
* Also fix small issues in RunCommand() and MountVolume()
2015-06-24 20:00:20 +01:00
Pete Batard 66edd53b2c [core] add x86_32 boot for UEFI:NTFS
* NB: This increases the compressed executable size by 25K :(
* Also set rufus-next to 2.1
2015-03-16 20:34:04 +00:00
Pete Batard 0905e932c1 [core] set UEFI:TOGO GPT partition type to Basic Data
* It was set to EFI System, however the Windows installer fails if it
  detects 2 EFI system partitions on the same system (and it creates
  one during standard installation).
* This caused UEFI/GPT/NTFS installation to fail with Rufus 2.0
* Closes #461
* Also add the missing copyright notices for Grub4DOS and GRUB2
2015-03-11 21:43:08 +00:00
Pete Batard a783eeef22 [misc] fix some Coverity issues
* Also add a Coverity build script and update Bled to latest
2015-02-13 19:51:30 +00:00
Pete Batard b830c040d2 [misc] fix XP compatibility
* MinGW's gcc 4.9.2 seems to implement a broken "%lld" format 64 bit integer is
  followed by more variables and the app executes on XP => use PRI macros
* Also fix partition ID being ignored when using Rufus MBR
* Also fix some global vars shadowing and add other improvements
2015-01-28 23:22:11 +00:00
Pete Batard 5d8483c359 [togo] fix zeroing of MSR
* Also fix broken debug messages
2015-01-26 23:20:39 +00:00
Pete Batard f965c5cd23 [misc] fix multiple warnings
* Fix Visual Studio code analysis warnings
* Also rename VS targets to x86_32 and x86_64
2015-01-23 02:26:41 +00:00
Pete Batard fdcb17aa7a [misc] pocketful of enhancement and fixes - part 3
* Add Windows To Go tooltips
* Set UEFI:TOGO partition type to EFI System Partition
* Improve apply-image progress report
* Fix MBR analysis for 4k disks
* Do not select Rufus MBR for Windows To Go
2015-01-22 22:31:34 +00:00
Pete Batard 4b76cb2555 [togo] Add Windows To Go support - part 4
* Ignore partitions we don't care about
* Fix issues with AltMountVolume()
* Try to support 4k drives when setting up MS EFI partition
* Zero the start of the MSR partition to prevent leftover detection
* Fix unwanted use of MBR hidden sectors and redundant CloseHandle()
* Fix addon of BIOS compatibility extra partition
* Print apply image progress to info box
2015-01-20 21:54:29 +00:00
Pete Batard ed9fae7c81 [togo] Add Windows To Go support - part 2
* Enable the creation of MSR and MS EFI partition in GPT mode
* Closes #432
2015-01-20 02:56:17 +00:00
Pete Batard ec761dfb41 [core] refactor CreatePartition()
* Also add groundwork for optional creation of MSR (see #432)
* Also fix a few minor issues
2015-01-19 01:23:32 +00:00
Pete Batard 032d4413c8 [togo] Add Windows To Go support - part 2
* Closes #126
* Only supported on Windows 8 or later for now
* Also fix MinGW and WDK compilation issues
2015-01-16 01:53:24 +00:00
Pete Batard a327bb114c [ui] Remove the separate progress dialog
* Closes #125
* Also provide more intuitive info for bad blocks check
* Also update Bled to latest to enable cancelling
2015-01-01 23:39:28 +00:00
Pete Batard 3f0e71f3ba [efi] fix incorrect offset for UEFI:TOGO partition
* Also remove the use of hardcoded value for the size of the UEFI:TOGO
  partition and fix a WDK warning.
2014-12-21 01:56:36 +00:00
Pete Batard d81f83c110 [core] enable UEFI NTFS support
* This allows no-sweat UEFI support of Windows installation ISOs
  that contain a >4GB file for instance
* This is done through UEFI:TOGO (https://github.com/pbatard/uefi-togo)
  and the efifs NTFS driver (http://efi.akeo.ie)
* Closes #414
* This will also be part of our implementation of #126
2014-12-20 00:22:00 +00:00
Pete Batard c56d1a0545 [core] fix a crash when an image is selected with no target device
* Closes #405
2014-11-21 20:01:03 +00:00
Pete Batard 306191fb85 [grub] add Grub4DOS support
* Also adds some stubs for Grub 2.0
* Also add a note about VS2013 CE in the readme
* Addresses the first part of #340
2014-11-14 23:46:56 +00:00
Pete Batard d46342c16c [core] ensure AutoMount is enabled while the app is running
* Having AutoMount disabled when a Fixed drive is being used can
  result in a failure during formatting (issue #386).
* Also set explicit FILE_ATTRIBUTE_NORMAL flag an normalize CreateFile usage
* Closes #386
2014-11-11 19:17:39 +00:00
Pete Batard 91565477ed [core] fix formatting for drives with nonstandard sector size
* Issue #385
* Also bump version to 1.4.11
2014-10-28 19:19:17 +00:00
Pete Batard 104ef277b7 [core] fix listing of devices when all 26 drive letters are in use
* Issue reported by Alex
2014-09-08 18:23:50 +01:00
Pete Batard 79a871be63 [core] improve handling of DD images and formatting task order
* Add logic to mount/remount a DD image if it contains a partition we can handle
* Clear GPT structures before copying DD image in case it doesn't overwrites them
* Add a call to refresh the drive layout after copying a DD image
* Move the unlocking of logical drive further down. This may help with the
  infamous "device in use by another process" error.
2014-08-07 01:45:46 +01:00
Pete Batard f6ab32c95d [misc] fix a crash when scanning a DD image with no UFD plugged in
* Also set the block size to 512 when scanning MBR and PBR
* Closes #352
2014-08-06 23:17:20 +01:00