Commit Graph

98 Commits

Author SHA1 Message Date
Pete Batard 8a5a5a318a
[misc] improve readability of error code handling
* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
2024-04-01 02:16:41 +01:00
Pete Batard a59389e1e1
[misc] move hash definitions to rufus.h
* Also always add an extra NUL to read_file(), some additional macros in missing.h
  and fix some warnings in process.c.
2024-03-27 19:02:24 +00:00
Pete Batard 5eae8a6441
[cmp] Enable extraction of zip archives outside of ISO copy mode
* This enables the use of Ctrl-SELECT to also extract files from a .zip
  when using non-bootable, DOS, UEFI-NTFS, etc.
* Also clean up some uprintf line terminations and some additional code.
* Also fix some Coverity and MinGW warnings.
2024-03-12 17:41:27 +00:00
Pete Batard 51569d9e13
[misc] silence Coverity warnings
* Also update copyright year and improve uprintf error handling
* Also bump GitHub Actions dependencies. Note that we do NOT want to update to
  upload-artifact v4 because it BREAKS the creation of artifacts from matrix.
  See: https://github.com/actions/upload-artifact#v4---whats-new
* Closes #2382
* Closes #2383
2024-01-08 14:34:57 +00:00
Pete Batard 8edb487ac9
[misc] update ChangeLog for 4.3 BETA
* Also minor code cleanups and improvements.
2023-10-12 19:46:10 +01:00
Pete Batard 45a5f22d43
[process] move the search for conflicting process to a background thread
* Removes the annoyance of having to wait for the process search to complete before media creation can start.
* Also update the "Process Hacker" references to its new "System Informer" name.
2023-10-10 22:22:45 +01:00
Pete Batard 98725a0d5f
[misc] fix improper processing of net related errors
* With thanks to @Wack0
* Also silence a Coverity warning
2023-09-08 16:58:41 +01:00
Pete Batard 94ecf74c5f
[misc] use FORMAT_MESSAGE_FROM_HMODULE where possible and drop our custom message tables 2023-09-04 11:41:35 +01:00
Pete Batard 5bbcba8534
[vhd] add write support for .vhdx and .ffu images
* Also move VHD mounting function calls from iso.c to vhd.c and remove unused VHD footer elements.
2023-07-06 19:47:26 +01:00
Pete Batard f411d526d6
[misc] attempt to fix DLL address resolver for ARM64
* SymLoadModuleEx() on the DLL fails (with ERROR_SUCCESS, sic) on ARM64, so we have to resort
  to loading the DLL in memory and look for the "RSDS" section to access the GUID and Age.
* Except that, once you sort that, you end up with SymEnumSymbols() producing two separate
  addresses for each symbol, on account that the Windows 11 ARM64 DLLs are actually an
  unholy union of X64 and ARM64 *in the same binary*, under an abomination that Microsoft
  calls ARM64X (See https://learn.microsoft.com/en-us/windows/arm/arm64x-pe for details).
* And, of course, Microsoft did not provide any means during PDB enumeration to tell which
  address is for which arch. Especially, the bloody pSymInfo->TypeIndex, that they could
  easily have used for this, is utterly pointless as it remains set to 0...
* This means that, even after all this effort, we're still nowhere close to have a solution
  that can make DLL address resolution work on Windows 11 ARM64.
2023-07-05 22:25:25 +01:00
Pete Batard 0363bfe503
[misc] add an address resolver for internal DLL function calls
* Not sure if we'll use this to hook into FfuCaptureImage()/FfuApplyImage()/FfuMountImage()
  directly. But at least, if we ever need it, it's there...
2023-07-05 18:36:58 +01:00
Pete Batard 23d89d9764
[misc] apply a timeout when querying drives for letters/type
* Some Windows Store reports suggest that the existing call might freeze
  on CreateFile() leading some users to kill the app. So switch to using
  a CreateFile() call that times out instead of waiting forever...
2023-05-03 16:26:54 +01:00
Pete Batard fffd4d1160
[misc] harden usage of uprintf()
* Passing a non-formatting buffer as first parameter of uprintf() can lead
  to an exception if this buffer happens to contain a '%' character, so
  usage of uprintf() with string buffers that may contain '%' should be
  sanitized.
* Also drop the _uprintf/_uprintfs aliases as they are no longer required.
2023-04-20 17:43:24 +01:00
Pete Batard c28f9bc491
[misc] fix PVS-Studio warnings 2022-01-05 12:57:26 +01:00
Pete Batard 957ec183c9
[ui] improve progress report when disabling Windows 11 installation restrictions
* Also fix Image Options content being lost when switching language.
2021-10-09 16:18:45 +01:00
Pete Batard 9dc045a701
[core] speed up the clearing of MBR/GPT sectors
* write_sector() should really only be used when writing single sectors as it
  is way to slow for anything else => Switch to using WriteFileWithRetry().
* Also revert an unwarranted change from f0047986e7.
2021-09-19 14:29:30 +01:00
Pete Batard 9d7e96e293
[core] move downloads from <app_location>\rufus_files\ to %LOCALAPPDATA%\Rufus\
* While this is intended to solve the issue of saving GRUB/Syslinux files for the
  App Store version, we apply this change globally, as it allows the user to move
  the Rufus executable around while preserving access to existing downloads.
* Closes #1744
2021-05-31 16:54:11 +01:00
Pete Batard b2492908be
[net] switch to INetworkListManager::GetConnectivity to detect connectivity
* InternetGetConnectedState() is next to useless and doesn't provide
  coherent outcome on the ARM64 platform I'm testing with. This results
  in Rufus declaring that Internet is unavailable on platforms that do
  have actual Internet connectivity.
* Swicth to using INetworkListManager::GetConnectivity(), which actually
  reports a dependable result.
* Closes #1691
* Also remove the mutex for uprintf(), which may produce thread lockout
  and remove an unwanted double GetSignatureName() call on startup.
2021-02-06 18:58:42 +00:00
Pete Batard 53b014781d
[misc] improve uprintf() concurrency by using a mutex 2021-02-03 11:36:52 +00:00
Pete Batard 71ede6d9a0
[cmp] update Bled to latest
* Also ensure that we support Unicode paths for 7-zip
* Also ensure that error messages are displayed in English
2020-06-10 20:13:12 +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 1e6e38b180
[iso] update MD5SUMS/md5sums.txt text file for distros that have them
* The upcoming Ubuntu 20.04 comes with MD5 validation turned on by default.
* When creating persistent boot media, we may update some of the validated files
  to add persistence, update the search labels, etc.
* Make sure that the files we modify get their MD5 updated where needed.
* Also add 'loopback.cfg' to the list of config files we can add persistence to.
* Part of #1499
2020-04-06 17:09:48 +01:00
Pete Batard b19f47f9b8
[iso] update the handling of failure of autorun.inf creation
* Commit 4c5adf092e moved us away from using CreateFile()
  when extracting a file on the target media, and as such the error code returned when
  failing to create an 'autorun.inf' due to a security solution has shifted.
* Make sure we handle the new error and don't bail out on 'autorun.inf' creation.
* Also update the actual name of the RtlDosPathNameToNtPathNameXXX function we use.
* Closes #1496
2020-04-01 11:34:13 +01:00
Mattiwatti 4c5adf092e
[iso] use NtCreateFile() to create files with preallocated sizes
* Implement CreatePreallocatedFile() which uses NtCreateFile() to create files with preallocated sizes.
  This is used during ISO extraction to improve performance.
* Remove now-unused preallocate_filesize which was called after CreateFileU().
* Closes #1445
2020-02-14 23:39:57 +00:00
Pete Batard 87a7228d38
[ui] improve error reporting for download issues
* This is part of #1444
2020-02-03 12:35:49 +00:00
Pete Batard 21351b9fbe
[misc] refactor the "operation in progress" detection
* Remove unused iso_op_in_progress and use a single op_in_progress that gets
  set when we disable the controls.
* Also fix an issue where Ctrl-L was being processed as Alt-L due yet another
  completely backwards Windows behaviour where the message that is meant to
  indicating whether Alt is pressed is also sometimes used to indicate that
  another key is being pressed if the dialog doesn't have keyboard focus...
2019-08-22 14:04:41 +01:00
Pete Batard af95de8198
[ui] add experimental optional display of transfer speed and time remaining
* You can use <Alt> to switch modes during an operation that supports it (e.g. Checksum
  computation, DD image writing or zeroing, save to VHD, download, etc.
* IMPORTANT: This is *NOT* available for all operations. Especially, if you were hoping
  to get transfer speed or ETA during ISO or WIM extraction, you *WILL* be disappointed.
* Also harmonize the code in checksum.c
2019-08-20 18:06:07 +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 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 38d82612cd
[core] fix a memory leak when search for process is interrupted 2019-04-10 12:17:47 +01:00
Pete Batard d4a663991b
[core] report write errors more explicitly
* Also issue a port cycle on ERROR_NOT_READY
* Also run a check for conflicting processes during write retries
2019-04-09 21:37:08 +01:00
Pete Batard 595f74f70c
[loc] fix human readable size display for RTL languages
* Closes #1254
2019-02-14 19:34:05 +01:00
Pete Batard c832814af0 [ui] small fixes for RTL languages 2018-08-18 17:38:23 +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 5ab67c03d6 [core] improve write retry handling
* Add a proper delay before retrying a write operation and increase retry count to 4
* Add retries when clearing boot records or when zeroing a drive
* Also improve log output from USB device reset
2018-06-13 19:23:24 +01:00
Pete Batard 903ac993f2 [misc] remove no longer needed XP workarounds 2017-11-13 14:30:25 +00:00
Pete Batard a73e695ba4 [pki] timestamp validation improvements
* Add timestamp processing for nested signature and check for anomalous differences
* Also prevent attack scenarios that may attempt to leverage multiple nested signatures or countersigners
* Simplify code by using CryptDecodeObjectEx/WinVerifyTrustEx and improve timestamp reporting
2017-09-03 13:54:07 +01:00
Pete Batard 65f5ccd28b [ui] fix log no longer automatically scrolling to the last line
* Introduced in 369a392af0 because, of course when Microsoft has a
  call that goes (###, param1, param2) they define a macro for it that goes (param2, param1)...
2017-08-11 11:47:27 +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 369a392af0 [process] improve the search for conflicting processes check
* Add a WaitForSingleObjectWithMessages() call so that we can process Windows messages
  while waiting on events (prevents lockup while issuing log messages)
* Limit the total duration of CheckDriveAccess() to 2 seconds
* Allow for user cancellation
* Also update code to use the Edit_####() predefined macros for Edit controls instead of EM_### messages
2017-07-24 11:36:06 +01:00
Pete Batard d5babb5e72 [ui] disable controls prior to format checks
* Also send Unicode strings to the debug output facility, since Windows 10
  *FINALLY* added Unicode processing support there...
2017-07-22 15:17:24 +01:00
Pete Batard 55b7d5c2da [misc] code cleanup
* Also fix WDK compilation issues
2017-04-25 20:25:50 +01:00
Pete Batard afec69c428 [ui] improve logging data
* Display the selected locate as well as LGP info in the log
* Also fix some potential Coverity warnings
2017-04-25 14:32:19 +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 e33b4589b6 [misc] small improvements for 2.13 release 2017-04-01 17:32:15 +01:00
Pete Batard aa4baab194 [core] add a workaround for >1TB HDDs that mistakenly report short writes
* It appears that 1.5TB and 2TB HDDs, accessed trough some Seagate ow WD USB ↔ SATA
  controllers, can report that 0 bytes were written on WriteFile(), even though all
  the data was effectively written. 1TB HDDs, accessed through the same controller,
  do not report this issue. So add a workaround for that.
* Also see #787
2016-09-06 18:31:30 +01:00
Pete Batard 07497fc231 [misc] fix the use of invalid "%luX" formatter
* "%luX" is invalid as "X" already means unsigned hexadecimal so there's no need for "u"
2016-06-02 21:20:29 +01:00
Pete Batard 2495f2d444 [misc] fix a new set of MinGW warnings 2016-05-30 17:49:32 +01:00