1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

Compare commits

...

11 commits

Author SHA1 Message Date
Pete Batard
8ec570570f
[core] reassign a letter for drives written in DD mode that don't have an ESP
* This should help with the CoreELEC usage case described in #1842
* Also add MBR handling for ESP ↔ FAT cheat mode (Alt-P)
* Also set rufus-next to 3.19
2022-03-24 17:24:39 +00:00
Pete Batard
0de209ee53
v3.18 (Build 1877)
* Formally disable Windows 11 bypass for Windows 7 and AppStore version since it can't be applied.
2022-03-11 16:51:59 +00:00
Pete Batard
1947266837
[pki] don't link with wintrust.lib
* WinTrust.lib is responsible for the MSASN1.dll sideloading issue described in #1877,
  so, since we only use it for WinVerifyTrustEx(), hook into that function manually.
* Closes #1877 for the MinGW side.
* Note that we will probably try to use the method suggested by @assarbad and documented at
  https://stackoverflow.com/questions/1851267/mingw-gcc-delay-loaded-dll-equivalent/70416894#70416894
  to try to put an end to the problem of DLL side loading.
2022-03-03 17:41:43 +00:00
Pete Batard
d07ec87b3a
[mingw] fix compilation breakage due to MinGW header screwup
* See https://github.com/pbatard/rufus/actions/runs/1900092904
* Guys, I know VDS is fundamentally broken... but that's no reason to break it further!
2022-02-28 22:00:41 +00:00
Pete Batard
cef651c52c
[msvc] actually apply DLL delay loading to the Release builds
* ef2ff7179d was supposed to apply delay loading to our DLLs, for all MSVC builds,
  thereby preventing sideloading attacks, but the patch actually only set the DelayLoadDLLs
  property for Debug builds and not Release builds, with the result that side loading could
  still be triggered for the Release executables, as demonstrated in #1877.
* This patch therefore properly sets the DelayLoadDLLs for all builds, which should take care
  of the side loading vulnerability at least for MSVC executables.
* A subsequent patch will still be needed for MinGW, since there is no equivalent to DelayLoadDLLs.
* This addresses part of #1877.
2022-02-25 18:05:49 +00:00
Pete Batard
42483d23ed
[dos] update FreeDOS to version 1.3
* FreeDOS 1.3 has just been released. Yay! :)
* Closes #1740
* Also addresses 2 warnings reported by Coverity.
2022-02-21 20:02:53 +00:00
Pete Batard
89db56acbc
[net] add fallback to InternetGetConnectedState() when INetworkListManager service dependencies are missing
* INetworkListManager appears to depend on specific services to be able to work,
  which one can actually disable while still getting full Internet connectivity.
* If that is the case, HRESULT_FROM_WIN32(ERROR_SERVICE_DEPENDENCY_FAIL) will be
  returned, therefore we add a fallback to using InternetGetConnectedState(), which
  does not have such dependencies (but has other limitations per b2492908be)
  when we detect a dependency error.
* Also take this opportunity to switch to using INetworkListManager::get_IsConnectedToInternet().
* Also fix Coverity breakage due to Synopsys having upgraded their toolchain.
* Closes #1801
2022-02-18 17:18:34 +00:00
Pete Batard
209fb18b1c
[iso] add bypass of Windows 11 restrictions for in-place upgrades 2022-02-16 17:25:43 +00:00
Matthias Kruk
23e79ad907
[iso] add Miracle Linux 8 to the list of Red Hat exceptions
* MIRACLE LINUX is a Red Hat derivative, so it needs the same special
  treatment as Red Hat, CentOS, etc to work around issues in anaconda.
* This commit adds MIRACLE LINUX to the list of Red Hat derivatives.
* Closes #1866
2022-02-11 18:47:41 +00:00
Tatsuhito KATO
108424ecf4
[loc] update Japanese translation
* Closes #1863
2022-02-11 18:44:46 +00:00
Pete Batard
4223fe9681
[misc] fix inverted memset() parameters
* Also fix artifact name for VS2022 builds.
2022-02-11 18:42:38 +00:00
25 changed files with 263 additions and 146 deletions

View file

@ -49,7 +49,9 @@ jobs:
msbuild-architecture: x64
- name: Build with Coverity
run: cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }}
run: |
cov-configure --msvc
cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }}
- name: Publish Coverity artifacts
uses: actions/upload-artifact@v2

View file

@ -80,5 +80,5 @@ jobs:
uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'push' }}
with:
name: VS2019
name: VS2022
path: ./*.exe

View file

@ -133,12 +133,12 @@
<AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -158,12 +158,12 @@
<AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -185,12 +185,12 @@
<AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -217,12 +217,12 @@
<AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -244,12 +244,13 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -271,12 +272,13 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories>
<AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -300,12 +302,13 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories>
<AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -332,12 +335,13 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>advapi32.lib;comctl32.lib;comdlg32.lib;crypt32.lib;gdi32.lib;ole32.lib;setupapi.lib;shell32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;crypt32.dll;gdi32.dll;ole32.dll;setupapi.dll;shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;RUFUS_LOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View file

@ -1,3 +1,12 @@
o Version 3.18 (2022.03.11)
Fix DLL sideloading vulnerabilities
Fix ISO → ESP creation when running on Windows 11
Fix an issue when detecting network connectivity when the DHCP service is disabled
Update FreeDOS to version 1.3
Add bypass of Windows 11 restrictions for in-place upgrades
Add Miracle Linux 8 to the list of Red Hat exceptions
Other internal fixes and improvements
o Version 3.17 (2021.10.23) [BUGFIX RELEASE]
Fix MBR not being properly cleared
Fix commandline hogger not being deleted on exit

20
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for rufus 3.18.
# Generated by GNU Autoconf 2.71 for rufus 3.19.
#
# Report bugs to <https://github.com/pbatard/rufus/issues>.
#
@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='3.18'
PACKAGE_STRING='rufus 3.18'
PACKAGE_VERSION='3.19'
PACKAGE_STRING='rufus 3.19'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='https://rufus.ie'
@ -1268,7 +1268,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rufus 3.18 to adapt to many kinds of systems.
\`configure' configures rufus 3.19 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1335,7 +1335,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rufus 3.18:";;
short | recursive ) echo "Configuration of rufus 3.19:";;
esac
cat <<\_ACEOF
@ -1427,7 +1427,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rufus configure 3.18
rufus configure 3.19
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@ -1503,7 +1503,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 3.18, which was
It was created by rufus $as_me 3.19, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@ -2767,7 +2767,7 @@ fi
# Define the identity of the package.
PACKAGE='rufus'
VERSION='3.18'
VERSION='3.19'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -5205,7 +5205,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rufus $as_me 3.18, which was
This file was extended by rufus $as_me 3.19, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -5261,7 +5261,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
rufus config.status 3.18
rufus config.status 3.19
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

View file

@ -1,4 +1,4 @@
AC_INIT([rufus], [3.18], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
AC_INIT([rufus], [3.19], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4])

View file

@ -25,7 +25,6 @@ del /q *.map >NUL 2>&1
set WDK_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64
set ZIP_PATH=C:\Program Files\7-Zip
set SIGNATURE_SHA1=3dbc3a2a0e9ce8803b422cfdbc60acd33164965d
set MSBUILD_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
set MANIFEST=AppxManifest.xml
set ARCHS=x86 x64 arm arm64
set DEFAULT_SCALE=200

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,21 +1,11 @@
o KERNEL.SYS was taken from KERNL386.SYS in FreeDOS Kernel 2042:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/kernel.zip
All of the executables found in this repository where extracted from:
https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.3/official/FD13-FullUSB.zip
o COMMAND.COM was extracted from packages\base\freecom.zip
o DISPLAY.EXE was extracted from packages\base\display.zip
o The EGA[#].CPX files were extracted from packages\base\cpidos.zip
o KERNEL.SYS was taken from packages\base\kernel.zip (KERNL386.SYS)
It was modified to have FORCELBA enabled (byte offset 0x0D set to 0x01)
o COMMAND.COM was extracted from FreeCom 0.84 pre 2:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/command.zip
o The EGA files were extracted from CPI (Code Page Information) Package 3.0:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/cpidos.zip
o DISPLAY.EXE was extracted from Display 0.13b:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/display.zip
o KEYB.EXE was extracted from Keyb 2.01:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/keyb.zip
o The keyboard layouts (KEYB___.SYS) were extracted from Keyb Layouts 3.1:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/keyb_lay.zip
o MODE.COM was extracted from Mode 2015-11-25:
http://ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/base/mode.zip
o KEYB.EXE was extracted from packages\base\keyb.zip
o The KEYB###.SYS keyboard layouts were extracted from packages\base\keyb_lay.zip
o MODE.COM was extracted from packages\base\mode.zip

View file

@ -1166,13 +1166,13 @@ msgstr "互換性のないドライブが検出されました。"
#.
#. Used in MSG_235
msgid "Write pass"
msgstr "書き込みをパスしました。"
msgstr "書き込み"
#. • MSG_192
#.
#. Used in MSG_235
msgid "Read pass"
msgstr "読み出しをパスしました。"
msgstr "読み出し"
#. • MSG_193
msgid "Downloaded %s"
@ -1385,7 +1385,7 @@ msgstr "Syslinux %s をインストール中..."
#. Bad blocks status. Example: "Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)"
#. See MSG_191 & MSG_192 for "Write pass"/"Read pass" translation.
msgid "Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)"
msgstr "不良ブロック: %s %d/%d - %0.2f%% (エラー: %d/%d/%d)"
msgstr "不良ブロック: %s %d/%d パス - %0.2f%% (エラー: %d/%d/%d)"
#. • MSG_236
msgid "Bad Blocks: Testing with random pattern"

View file

@ -6778,8 +6778,8 @@ t MSG_187 "選択したブート設定には無効なイメージです。"
t MSG_188 "現在選択中のイメージとブート設定が一致しません。別のイメージを使うか、他のブート設定を使用してください。"
t MSG_189 "この ISO は選択中のファイル システムと互換性がありません。"
t MSG_190 "互換性のないドライブが検出されました。"
t MSG_191 "書き込みをパスしました。"
t MSG_192 "読み出しをパスしました。"
t MSG_191 "書き込み"
t MSG_192 "読み出し"
t MSG_193 "%s をダウンロードしました。"
t MSG_194 "%s はダウンロードできませんでした。"
t MSG_195 "内蔵している %s ファイルを使用します。"
@ -6820,7 +6820,7 @@ t MSG_231 "ISO ファイルをコピー中: %s"
t MSG_232 "Win7 EFI ブート セットアップ中 (%s)..."
t MSG_233 "最終処理中です。もう間もなく終わります..."
t MSG_234 "Syslinux %s をインストール中..."
t MSG_235 "不良ブロック: %s %d/%d - %0.2f%% (エラー: %d/%d/%d)"
t MSG_235 "不良ブロック: %s %d/%d パス - %0.2f%% (エラー: %d/%d/%d)"
t MSG_236 "不良ブロック: ランダムパターンでテスト"
t MSG_237 "不良ブロック: パターン 0x%02X でテスト"
t MSG_238 "パーティション分割中 (%s)..."

View file

@ -17,4 +17,4 @@ rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/sy
rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows
# Note: Do not link with -lversion as this will results in DLL sideloading issue. See https://github.com/pbatard/rufus/pull/1838
rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lwintrust -lcomdlg32 -lcomctl32 -luuid -lpsapi
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomdlg32 -lcomctl32 -luuid -lpsapi

View file

@ -283,7 +283,7 @@ rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/sy
rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows
# Note: Do not link with -lversion as this will results in DLL sideloading issue. See https://github.com/pbatard/rufus/pull/1838
rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lwintrust -lcomdlg32 -lcomctl32 -luuid -lpsapi
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomdlg32 -lcomctl32 -luuid -lpsapi
all: all-recursive

View file

@ -65,7 +65,6 @@ typedef struct _TIME_FIELDS {
short Minute;
short Second;
short Milliseconds;
short Weekday;
} TIME_FIELDS, *PTIME_FIELDS;
#define ARGUMENT_PRESENT(ArgumentPointer) \

View file

@ -29,8 +29,8 @@
#include <assert.h>
#if !defined(__MINGW32__)
#include <initguid.h>
#endif
#include <vds.h>
#endif
#include "rufus.h"
#include "missing.h"
@ -1487,6 +1487,43 @@ BOOL AnalyzePBR(HANDLE hLogicalVolume)
return TRUE;
}
/*
* This call returns the offset of the first ESP partition found
* on the relevant drive, or 0ULL if no ESP was found.
*/
uint64_t GetEspOffset(DWORD DriveIndex)
{
uint64_t ret = 0ULL;
BOOL r;
HANDLE hPhysical;
DWORD size, i;
BYTE layout[4096] = { 0 };
PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;
hPhysical = GetPhysicalHandle(DriveIndex, FALSE, TRUE, TRUE);
if (hPhysical == INVALID_HANDLE_VALUE)
return FALSE;
r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX,
NULL, 0, layout, sizeof(layout), &size, NULL);
if (!r || size <= 0) {
uprintf("Could not get layout for drive 0x%02x: %s", DriveIndex, WindowsErrorString());
goto out;
}
for (i = 0; i < DriveLayout->PartitionCount; i++) {
if (((DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) && (DriveLayout->PartitionEntry[i].Mbr.PartitionType == 0xef)) ||
((DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) && CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP))) {
ret = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;
break;
}
}
out:
safe_closehandle(hPhysical);
return ret;
}
static BOOL StoreEspInfo(GUID* guid)
{
uint8_t j;
@ -1531,12 +1568,23 @@ static BOOL ClearEspInfo(uint8_t index)
BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset)
{
char *volume_name, mount_point[] = DEFAULT_ESP_MOUNT_POINT;
BOOL r, ret = FALSE, found = FALSE;
int i, j, esp_index = -1;
BOOL r, ret = FALSE, delete_data = FALSE;
HANDLE hPhysical;
DWORD size, i, j, esp_index = 0;
BYTE layout[4096] = { 0 };
GUID* guid;
DWORD dl_size, size, offset;
BYTE layout[4096] = { 0 }, buf[512];
GUID *guid = NULL, *stored_guid = NULL, mbr_guid;
PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;
typedef struct {
const uint8_t mbr_type;
const uint8_t magic[8];
} fat_mbr_type;
const fat_mbr_type fat_mbr_types[] = {
{ 0x0b, { 'F', 'A', 'T', ' ', ' ', ' ', ' ', ' ' } },
{ 0x01, { 'F', 'A', 'T', '1', '2', ' ', ' ', ' ' } },
{ 0x0e, { 'F', 'A', 'T', '1', '6', ' ', ' ', ' ' } },
{ 0x0c, { 'F', 'A', 'T', '3', '2', ' ', ' ', ' ' } },
};
if ((PartitionOffset == 0) && (nWindowsVersion < WINDOWS_10)) {
uprintf("ESP toggling is only available for Windows 10 or later");
@ -1547,86 +1595,113 @@ BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset)
if (hPhysical == INVALID_HANDLE_VALUE)
return FALSE;
r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX,
NULL, 0, layout, sizeof(layout), &size, NULL);
if (!r || size <= 0) {
r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &dl_size, NULL);
if (!r || dl_size <= 0) {
uprintf("Could not get layout for drive 0x%02x: %s", DriveIndex, WindowsErrorString());
goto out;
}
// TODO: Handle MBR
if (DriveLayout->PartitionStyle != PARTITION_STYLE_GPT) {
uprintf("ESP toggling is only available for GPT drives");
goto out;
}
if (PartitionOffset == 0) {
// See if the current drive contains an ESP
for (i = 0, j = 0; i < DriveLayout->PartitionCount; i++) {
if (CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP)) {
for (i = 0; i < (int)DriveLayout->PartitionCount; i++) {
if (((DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) && (DriveLayout->PartitionEntry[i].Mbr.PartitionType == 0xef)) ||
((DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) && CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP))) {
esp_index = i;
j++;
break;
}
}
if (j > 1) {
uprintf("ESP toggling is not available for drives with more than one ESP");
goto out;
}
if (j == 1) {
if (esp_index >= 0) {
// ESP -> Basic Data
i = esp_index;
uprintf("ESP name: '%S'", DriveLayout->PartitionEntry[i].Gpt.Name);
if (!StoreEspInfo(&DriveLayout->PartitionEntry[i].Gpt.PartitionId)) {
if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {
uprintf("ESP name: '%S'", DriveLayout->PartitionEntry[esp_index].Gpt.Name);
guid = &DriveLayout->PartitionEntry[esp_index].Gpt.PartitionId;
} else {
// For MBR we create a GUID from the disk signature and the offset
mbr_guid.Data1 = DriveLayout->Mbr.Signature;
mbr_guid.Data2 = 0; mbr_guid.Data3 = 0;
*((uint64_t*)&mbr_guid.Data4) = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;
guid = &mbr_guid;
}
if (!StoreEspInfo(guid)) {
uprintf("ESP toggling data could not be stored");
goto out;
}
DriveLayout->PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;
if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {
DriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;
} else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) {
// Default to FAT32 (non LBA) if we can't determine anything better
DriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0x0b;
// Now detect if we're dealing with FAT12/16/32
if (SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[esp_index].StartingOffset, NULL, FILE_BEGIN) &&
ReadFile(hPhysical, buf, 512, &size, NULL) && size == 512) {
for (offset = 0x36; offset <= 0x52; offset += 0x1c) {
for (i = 0; i < ARRAYSIZE(fat_mbr_types); i++) {
if (memcmp(&buf[offset], fat_mbr_types[i].magic, 8) == 0) {
DriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = fat_mbr_types[i].mbr_type;
break;
}
}
}
}
}
} else {
// Basic Data -> ESP
for (j = 1; j <= MAX_ESP_TOGGLE; j++) {
guid = GetEspGuid((uint8_t)j);
if (guid != NULL) {
for (i = 0; i < DriveLayout->PartitionCount; i++) {
if (CompareGUID(guid, &DriveLayout->PartitionEntry[i].Gpt.PartitionId)) {
found = TRUE;
break;
for (i = 1; i <= MAX_ESP_TOGGLE && esp_index < 0; i++) {
stored_guid = GetEspGuid((uint8_t)i);
if (stored_guid != NULL) {
for (j = 0; j < (int)DriveLayout->PartitionCount && esp_index < 0; j++) {
if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {
guid = &DriveLayout->PartitionEntry[j].Gpt.PartitionId;
} else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) {
mbr_guid.Data1 = DriveLayout->Mbr.Signature;
mbr_guid.Data2 = 0; mbr_guid.Data3 = 0;
*((uint64_t*)&mbr_guid.Data4) = DriveLayout->PartitionEntry[j].StartingOffset.QuadPart;
guid = &mbr_guid;
}
if (CompareGUID(stored_guid, guid)) {
esp_index = j;
delete_data = TRUE;
if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT)
DriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_GENERIC_ESP;
else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)
DriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0xef;
}
}
if (found)
break;
}
}
if (j > MAX_ESP_TOGGLE)
goto out;
DriveLayout->PartitionEntry[i].Gpt.PartitionType = PARTITION_GENERIC_ESP;
}
} else {
for (i = 0, j = 0; i < DriveLayout->PartitionCount; i++) {
for (i = 0; i < (int)DriveLayout->PartitionCount; i++) {
if (DriveLayout->PartitionEntry[i].StartingOffset.QuadPart == PartitionOffset) {
DriveLayout->PartitionEntry[i].Gpt.PartitionType = PARTITION_GENERIC_ESP;
esp_index = i;
if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT)
DriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_GENERIC_ESP;
else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)
DriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0xef;
break;
}
}
}
if (i >= DriveLayout->PartitionCount) {
if (esp_index < 0) {
uprintf("No partition to toggle");
goto out;
}
DriveLayout->PartitionEntry[i].RewritePartition = TRUE; // Just in case
r = DeviceIoControl(hPhysical, IOCTL_DISK_SET_DRIVE_LAYOUT_EX, (BYTE*)DriveLayout, size, NULL, 0, &size, NULL);
DriveLayout->PartitionEntry[esp_index].RewritePartition = TRUE; // Just in case
r = DeviceIoControl(hPhysical, IOCTL_DISK_SET_DRIVE_LAYOUT_EX, (BYTE*)DriveLayout, dl_size, NULL, 0, &dl_size, NULL);
if (!r) {
uprintf("Could not set drive layout: %s", WindowsErrorString());
goto out;
}
RefreshDriveLayout(hPhysical);
if (PartitionOffset == 0) {
if (CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP)) {
if (delete_data) {
// We successfully reverted ESP from Basic Data -> Delete stored ESP info
ClearEspInfo((uint8_t)j);
} else if (!IsDriveLetterInUse(*mount_point)) {
// We successfully switched ESP to Basic Data -> Try to mount it
volume_name = GetLogicalName(DriveIndex, DriveLayout->PartitionEntry[i].StartingOffset.QuadPart, TRUE, FALSE);
volume_name = GetLogicalName(DriveIndex, DriveLayout->PartitionEntry[esp_index].StartingOffset.QuadPart, TRUE, FALSE);
IGNORE_RETVAL(MountVolume(mount_point, volume_name));
free(volume_name);
}
@ -1639,7 +1714,8 @@ out:
}
// This is a crude attempt at detecting file systems through their superblock magic.
// Note that we only attempt to detect the file systems that Rufus can actually format.
// Note that we only attempt to detect the file systems that Rufus can format as
// well as a couple other maintsream ones.
const char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset)
{
typedef struct {
@ -1713,7 +1789,7 @@ const char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset)
goto out;
}
// Switch to offset 1024
memset(buf, sector_size, 0);
memset(buf, 0, sector_size);
StartingOffset.QuadPart += 0x0400ULL;
if (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))
goto out;
@ -1748,7 +1824,7 @@ const char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset)
// 4. Try to detect UDF through by looking for a "BEA01\0" string at offset 0xC001
// NB: This is not thorough UDF detection but good enough for our purpose.
// For the full specs see: http://www.osta.org/specs/pdf/udf260.pdf
memset(buf, sector_size, 0);
memset(buf, 0, sector_size);
StartingOffset.QuadPart += 0x8000ULL - 0x0400ULL;
if (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))
goto out;

View file

@ -94,7 +94,12 @@ typedef struct _FILE_FS_DEVICE_INFORMATION {
ULONG Characteristics;
} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
#else
/* MinGW is currently missing all the VDS COM stuff */
/*
* MinGW is currently missing most of the VDS COM stuff.
* Oh, and MinGW's vds.h is screwed up unless you define the following:
*/
#define VDS_LUN_INFORMATION void
#define __vdslun_h__
#include <vds.h>
typedef interface IVdsServiceLoader IVdsServiceLoader;
typedef interface IVdsService IVdsService;
@ -413,4 +418,5 @@ BOOL CyclePort(int index);
int CycleDevice(int index);
BOOL RefreshLayout(DWORD DriveIndex);
BOOL GetOpticalMedia(IMG_SAVE* img_save);
uint64_t GetEspOffset(DWORD DriveIndex);
BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset);

View file

@ -31,7 +31,9 @@
#include <ctype.h>
#include <locale.h>
#include <assert.h>
#if !defined(__MINGW32__)
#include <vds.h>
#endif
#include "rufus.h"
#include "missing.h"
@ -1870,6 +1872,8 @@ DWORD WINAPI FormatThread(void* param)
char drive_letters[27], fs_name[32], label[64];
char logfile[MAX_PATH], *userdir;
char efi_dst[] = "?:\\efi\\boot\\bootx64.efi";
char appraiserres_dll_src[] = "?:\\sources\\appraiserres.dll";
char appraiserres_dll_dst[] = "?:\\sources\\appraiserres.bak";
char kolibri_dst[] = "?:\\MTLD_F32";
char grub4dos_dst[] = "?:\\grldr";
@ -2060,23 +2064,6 @@ DWORD WINAPI FormatThread(void* param)
// Write an image file
if ((boot_type == BT_IMAGE) && write_as_image) {
WriteDrive(hPhysicalDrive, FALSE);
// Trying to mount accessible partitions after writing an image leads to the
// creation of the infamous 'System Volume Information' folder on ESPs, which
// in turn leads to checksum errors for Ubuntu's boot/grub/efi.img (that maps
// to the Ubuntu ESP). So we only call the code below for Ventoy's vtsi images.
if (img_report.compression_type == BLED_COMPRESSION_VTSI) {
// If the image contains a partition we might be able to access, try to re-mount it
safe_unlockclose(hPhysicalDrive);
safe_unlockclose(hLogicalVolume);
Sleep(200);
WaitForLogical(DriveIndex, 0);
if (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE)) {
volume_name = GetLogicalName(DriveIndex, 0, TRUE, TRUE);
if ((volume_name != NULL) && (MountVolume(drive_name, volume_name)))
uprintf("Remounted %s as %c:", volume_name, toupper(drive_name[0]));
}
}
goto out;
}
@ -2358,6 +2345,18 @@ DWORD WINAPI FormatThread(void* param)
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_PATCH);
}
if (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_EXTENDED) {
// Create a backup of sources\appraiserres.dll and then create an empty file to
// allow in-place upgrades without TPM/SB. Note that we need to create an empty,
// appraiserres.dll otherwise setup.exe extracts its own.
appraiserres_dll_src[0] = drive_name[0];
appraiserres_dll_dst[0] = drive_name[0];
uprintf("Renaming: '%s' → '%s'", appraiserres_dll_src, appraiserres_dll_dst);
if (!MoveFileExU(appraiserres_dll_src, appraiserres_dll_dst, MOVEFILE_REPLACE_EXISTING))
uprintf(" Rename failed: %s", WindowsErrorString());
else
CloseHandle(CreateFileU(appraiserres_dll_src, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));
// Now patch for boot-time TPM/SB checks.
if (!RemoveWindows11Restrictions(drive_name[0]))
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | APPERR(ERROR_CANT_PATCH);
}
@ -2387,13 +2386,27 @@ out:
AltUnmountVolume(volume_name, TRUE);
else
safe_free(volume_name);
if ((boot_type == BT_IMAGE) && write_as_image) {
PrintInfo(0, MSG_320, lmprintf(MSG_307));
VdsRescan(VDS_RESCAN_REFRESH, 0, TRUE);
}
safe_free(buffer);
safe_unlockclose(hLogicalVolume);
safe_unlockclose(hPhysicalDrive); // This can take a while
if ((boot_type == BT_IMAGE) && write_as_image) {
PrintInfo(0, MSG_320, lmprintf(MSG_307));
Sleep(200);
VdsRescan(VDS_RESCAN_REFRESH, 0, TRUE);
// Trying to mount accessible partitions after writing an image leads to the
// creation of the infamous 'System Volume Information' folder on ESPs, which
// in turn leads to checksum errors for Ubuntu's boot/grub/efi.img (that maps
// to the Ubuntu ESP). So we only call the code below if there are no ESPs or
// if we're running a Ventoy image.
if ((GetEspOffset(DriveIndex) == 0) || (img_report.compression_type == BLED_COMPRESSION_VTSI)) {
WaitForLogical(DriveIndex, 0);
if (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE)) {
volume_name = GetLogicalName(DriveIndex, 0, TRUE, TRUE);
if ((volume_name != NULL) && (MountVolume(drive_name, volume_name)))
uprintf("Remounted %s as %c:", volume_name, toupper(drive_name[0]));
}
}
}
if (IS_ERROR(FormatStatus)) {
volume_name = GetLogicalName(DriveIndex, partition_offset[PI_MAIN], TRUE, TRUE);
if (volume_name != NULL) {

View file

@ -1557,6 +1557,7 @@ BOOL DumpFatDir(const char* path, int32_t cluster)
}
do {
// coverity[-taint_source]
dirpos.cluster = libfat_dumpdir(lf_fs, &dirpos, &diritem);
if (dirpos.cluster >= 0) {
name = wchar_to_utf8(diritem.name);

View file

@ -165,7 +165,7 @@ mbr_type_t mbr_type[] = {
{ 0xec, "SkyFS" },
{ 0xed, "GPT Hybrid MBR" },
{ 0xee, "GPT Protective MBR" },
{ 0xef, "EFI FAT" },
{ 0xef, "EFI System Partition" },
{ 0xf0, "PA-RISC Boot" },
{ 0xf1, "SpeedStor" },
{ 0xf2, "DOS secondary" },

View file

@ -57,6 +57,10 @@ static DWORD error_code, fido_len = 0;
static BOOL force_update_check = FALSE;
static const char* request_headers = "Accept-Encoding: gzip, deflate";
#if defined(__MINGW32__)
#define INetworkListManager_get_IsConnectedToInternet INetworkListManager_IsConnectedToInternet
#endif
/*
* FormatMessage does not handle internet errors
* https://docs.microsoft.com/en-us/windows/desktop/wininet/wininet-errors
@ -267,16 +271,18 @@ static HINTERNET GetInternetSession(BOOL bRetry)
int i;
char agent[64];
BOOL decodingSupport = TRUE;
DWORD dwTimeout = NET_SESSION_TIMEOUT, dwProtocolSupport = HTTP_PROTOCOL_FLAG_HTTP2;
VARIANT_BOOL InternetConnection = VARIANT_FALSE;
DWORD dwFlags, dwTimeout = NET_SESSION_TIMEOUT, dwProtocolSupport = HTTP_PROTOCOL_FLAG_HTTP2;
HINTERNET hSession = NULL;
HRESULT hr = S_FALSE;
INetworkListManager* pNetworkListManager;
NLM_CONNECTIVITY Connectivity = NLM_CONNECTIVITY_DISCONNECTED;
PF_TYPE_DECL(WINAPI, HINTERNET, InternetOpenA, (LPCSTR, DWORD, LPCSTR, LPCSTR, DWORD));
PF_TYPE_DECL(WINAPI, BOOL, InternetSetOptionA, (HINTERNET, DWORD, LPVOID, DWORD));
PF_TYPE_DECL(WINAPI, BOOL, InternetGetConnectedState, (LPDWORD, DWORD));
PF_INIT_OR_OUT(InternetOpenA, WinInet);
PF_INIT_OR_OUT(InternetSetOptionA, WinInet);
PF_INIT(InternetGetConnectedState, WinInet);
// Create a NetworkListManager Instance to check the network connection
IGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));
@ -284,13 +290,20 @@ static HINTERNET GetInternetSession(BOOL bRetry)
&IID_INetworkListManager, (LPVOID*)&pNetworkListManager);
if (hr == S_OK) {
for (i = 0; i <= WRITE_RETRIES; i++) {
hr = INetworkListManager_GetConnectivity(pNetworkListManager, &Connectivity);
hr = INetworkListManager_get_IsConnectedToInternet(pNetworkListManager, &InternetConnection);
// INetworkListManager may fail with ERROR_SERVICE_DEPENDENCY_FAIL if the DHCP service
// is not running, in which case we must fall back to using InternetGetConnectedState().
// See https://github.com/pbatard/rufus/issues/1801.
if ((hr == HRESULT_FROM_WIN32(ERROR_SERVICE_DEPENDENCY_FAIL)) && (pfInternetGetConnectedState != NULL)) {
InternetConnection = pfInternetGetConnectedState(&dwFlags, 0) ? VARIANT_TRUE : VARIANT_FALSE;
break;
}
if (hr == S_OK || !bRetry)
break;
Sleep(1000);
}
}
if (Connectivity == NLM_CONNECTIVITY_DISCONNECTED) {
if (InternetConnection == VARIANT_FALSE) {
SetLastError(ERROR_INTERNET_DISCONNECTED);
goto out;
}

View file

@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* PKI functions (code signing, etc.)
* Copyright © 2015-2016 Pete Batard <pete@akeo.ie>
* Copyright © 2015-2022 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -572,9 +572,11 @@ out:
// From https://msdn.microsoft.com/en-us/library/windows/desktop/aa382384.aspx
LONG ValidateSignature(HWND hDlg, const char* path)
{
LONG r;
LONG r = TRUST_E_SYSTEM_ERROR;
WINTRUST_DATA trust_data = { 0 };
WINTRUST_FILE_INFO trust_file = { 0 };
PF_TYPE_DECL(WINAPI, long, WinVerifyTrustEx, (HWND, GUID*, WINTRUST_DATA*));
PF_INIT(WinVerifyTrustEx, WinTrust);
GUID guid_generic_verify = // WINTRUST_ACTION_GENERIC_VERIFY_V2
{ 0xaac56b, 0xcd44, 0x11d0,{ 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee } };
char *signature_name;
@ -625,7 +627,8 @@ LONG ValidateSignature(HWND hDlg, const char* path)
trust_data.dwUnionChoice = WTD_CHOICE_FILE;
trust_data.pFile = &trust_file;
r = WinVerifyTrustEx(INVALID_HANDLE_VALUE, &guid_generic_verify, &trust_data);
if (pfWinVerifyTrustEx != NULL)
r = pfWinVerifyTrustEx(INVALID_HANDLE_VALUE, &guid_generic_verify, &trust_data);
safe_free(trust_file.pcwszFilePath);
switch (r) {
case ERROR_SUCCESS:

View file

@ -1168,7 +1168,8 @@ static void UpdateImage(BOOL update_image_option_only)
ComboBox_ResetContent(hImageOption);
if (!img_report.is_windows_img) { // Straight install.wim/install.esd only have Windows To Go option
if (img_report.win_version.major == 11) {
// Can't remove restrictions if running on Windows 7 or when running the appstore version
if (nWindowsVersion >= WINDOWS_8 && !appstore_version && img_report.win_version.major == 11) {
IGNORE_RETVAL(ComboBox_SetItemData(hImageOption, ComboBox_AddStringU(hImageOption, lmprintf(MSG_322)), IMOP_WIN_STANDARD));
IGNORE_RETVAL(ComboBox_SetItemData(hImageOption, ComboBox_AddStringU(hImageOption, lmprintf(MSG_323)), IMOP_WIN_EXTENDED));
} else {
@ -1267,6 +1268,7 @@ DWORD WINAPI ImageScanThread(LPVOID param)
"^OL-8.*", // Oracle Linux 8.x
"^RHEL-8.*", // Red Hat 8.x
"^Rocky-8.*", // Rocky Linux 8.x
"^MIRACLE-LINUX-8-.*", // MIRACLE LINUX 8.x
};
int i, len;
uint8_t arch;

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.18.1867"
CAPTION "Rufus 3.19.1878"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,18,1867,0
PRODUCTVERSION 3,18,1867,0
FILEVERSION 3,19,1878,0
PRODUCTVERSION 3,19,1878,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.18.1867"
VALUE "FileVersion", "3.19.1878"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.18.exe"
VALUE "OriginalFilename", "rufus-3.19.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.18.1867"
VALUE "ProductVersion", "3.19.1878"
END
END
BLOCK "VarFileInfo"