Skip to content

Commit 073a100

Browse files
committed
[wue] add an option to copy SkuSiPolicy.p7b to the ESP on install
* This basically accomplishes the steps described in https://support.microsoft.com/kb/5042562 on first logon. * Note that we use the installed system's SkuSiPolicy.p7b rather than the host system's, even if the latter is usually more up to date, because otherwise, the user may run into Error code: 0xc0000428 on first reboot. * Likewise, we do not provide this option for Windows To Go, as it could prevent the existing Windows install from booting, and we'd have to extract SkuSiPolicy.p7b from `install.wim` to do so. * Also remove dead code related to SkuSiPolicy.p7b hash parsing (which Microsoft no longer uses). * Closes #2919 (though it doesn't actually address the issue reported there, which we couldn't replicate).
1 parent eb7b684 commit 073a100

File tree

8 files changed

+50
-179
lines changed

8 files changed

+50
-179
lines changed

res/loc/rufus.loc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ t MSG_320 "Refreshing partition layout (%s)..."
577577
t MSG_321 "The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File "
578578
"copy mode.\nAs a result, DD image writing mode will be enforced."
579579
t MSG_322 "Unable to open or read '%s'"
580+
t MSG_324 "Apply SkuSiPolicy.p7b on installation (See KB5042562)"
580581
t MSG_325 "Applying Windows customization: %s"
581582
t MSG_326 "Applying user options..."
582583
t MSG_327 "Windows User Experience"
@@ -609,7 +610,7 @@ t MSG_346 "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)"
609610
t MSG_347 "Expert Mode"
610611
t MSG_348 "Extracting archive files: %s"
611612
t MSG_349 "Use Rufus MBR"
612-
t MSG_350 "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)"
613+
t MSG_350 "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)"
613614
t MSG_351 "Checking for UEFI bootloader revocation..."
614615
t MSG_352 "Checking for UEFI DBX updates..."
615616
t MSG_353 "DBX update available"

src/format.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,6 @@ DWORD WINAPI FormatThread(void* param)
19791979
}
19801980
}
19811981
}
1982-
CopySKUSiPolicy(drive_name);
19831982
if ( (target_type == TT_BIOS) && HAS_WINPE(img_report) ) {
19841983
// Apply WinPE fixup
19851984
if (!SetupWinPE(drive_name[0]))

src/license.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ const char* additional_copyrights =
144144
"https://github.com/u-boot/u-boot\\line\n"
145145
"GNU General Public License (GPL) v2 or later\\line\n"
146146
"\\line\n"
147-
"SkuSiPolicy.p7b parsing derived from:\\line\n"
148-
"https://gist.github.com/mattifestation/92e545bf1ee5b68eeb71d254cec2f78e\\line\n"
149-
"by Matthew Graeber, with contributions by James Forshaw\\line\n"
150-
"BSD 3-Clause\\line\n"
151-
"\\line\n"
152147
"About and License dialogs inspired by WinSCP by Martin Prikryl\\line\n"
153148
"https://winscp.net/\\line\n"
154149
"GNU General Public License (GPL) v3 or later\\line\n"

src/pki.c

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Rufus: The Reliable USB Formatting Utility
33
* PKI functions (code signing, etc.)
4-
* Copyright © 2015-2024 Pete Batard <pete@akeo.ie>
4+
* Copyright © 2015-2026 Pete Batard <pete@akeo.ie>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -260,7 +260,7 @@ const char* WinPKIErrorString(void)
260260
}
261261
}
262262

263-
// Mostly from https://support.microsoft.com/en-us/kb/323809
263+
// Mostly from https://support.microsoft.com/kb/323809
264264
char* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent)
265265
{
266266
static char szSubjectName[128];
@@ -900,120 +900,3 @@ BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignatu
900900
CryptReleaseContext(hProv, 0);
901901
return r;
902902
}
903-
904-
// The following SkuSiPolicy.p7b parsing code is derived from:
905-
// https://gist.github.com/mattifestation/92e545bf1ee5b68eeb71d254cec2f78e
906-
// by Matthew Graeber, with contributions by James Forshaw.
907-
BOOL ParseSKUSiPolicy(void)
908-
{
909-
char path[MAX_PATH];
910-
wchar_t* wpath = NULL;
911-
BOOL r = FALSE;
912-
DWORD i, dwEncoding, dwContentType, dwFormatType;
913-
DWORD dwPolicySize = 0, dwBaseIndex = 0, dwSizeCount;
914-
HCRYPTMSG hMsg = NULL;
915-
CRYPT_DATA_BLOB pkcsData = { 0 };
916-
DWORD* pdwEkuRules;
917-
BYTE* pbRule;
918-
CIHeader* Header;
919-
CIFileRuleHeader* FileRuleHeader;
920-
CIFileRuleData* FileRuleData;
921-
922-
pe256ssp_size = 0;
923-
safe_free(pe256ssp);
924-
// Must use sysnative for WOW
925-
static_sprintf(path, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", sysnative_dir);
926-
wpath = utf8_to_wchar(path);
927-
if (wpath == NULL)
928-
goto out;
929-
930-
r = CryptQueryObject(CERT_QUERY_OBJECT_FILE, wpath, CERT_QUERY_CONTENT_FLAG_ALL,
931-
CERT_QUERY_FORMAT_FLAG_ALL, 0, &dwEncoding, &dwContentType, &dwFormatType, NULL,
932-
&hMsg, NULL);
933-
if (!r || dwContentType != CERT_QUERY_CONTENT_PKCS7_SIGNED)
934-
goto out;
935-
936-
r = CryptMsgGetParam(hMsg, CMSG_CONTENT_PARAM, 0, NULL, &pkcsData.cbData);
937-
if (!r || pkcsData.cbData == 0) {
938-
uprintf("ParseSKUSiPolicy: Failed to retreive CMSG_CONTENT_PARAM size: %s", WindowsErrorString());
939-
goto out;
940-
}
941-
pkcsData.pbData = malloc(pkcsData.cbData);
942-
if (pkcsData.pbData == NULL)
943-
goto out;
944-
r = CryptMsgGetParam(hMsg, CMSG_CONTENT_PARAM, 0, pkcsData.pbData, &pkcsData.cbData);
945-
if (!r) {
946-
uprintf("ParseSKUSiPolicy: Failed to retreive CMSG_CONTENT_PARAM: %s", WindowsErrorString());
947-
goto out;
948-
}
949-
950-
// Now process the actual Security Policy content
951-
if (pkcsData.pbData[0] == 4) {
952-
dwPolicySize = pkcsData.pbData[1];
953-
dwBaseIndex = 2;
954-
if ((dwPolicySize & 0x80) == 0x80) {
955-
dwSizeCount = dwPolicySize & 0x7F;
956-
dwBaseIndex += dwSizeCount;
957-
dwPolicySize = 0;
958-
for (i = 0; i < dwSizeCount; i++) {
959-
dwPolicySize = dwPolicySize << 8;
960-
dwPolicySize = dwPolicySize | pkcsData.pbData[2 + i];
961-
}
962-
}
963-
}
964-
965-
// Sanity checks
966-
Header = (CIHeader*)&pkcsData.pbData[dwBaseIndex];
967-
if (Header->HeaderLength + sizeof(uint32_t) != sizeof(CIHeader)) {
968-
uprintf("ParseSKUSiPolicy: Unexpected Code Integrity Header size (0x%02x)", Header->HeaderLength);
969-
goto out;
970-
}
971-
if (!CompareGUID(&Header->PolicyTypeGUID, &SKU_CODE_INTEGRITY_POLICY)) {
972-
uprintf("ParseSKUSiPolicy: Unexpected Policy Type GUID %s", GuidToString(&Header->PolicyTypeGUID, TRUE));
973-
goto out;
974-
}
975-
976-
// Skip the EKU Rules
977-
pdwEkuRules = (DWORD*) &pkcsData.pbData[dwBaseIndex + sizeof(CIHeader)];
978-
for (i = 0; i < Header->EKURuleEntryCount; i++)
979-
pdwEkuRules = &pdwEkuRules[(*pdwEkuRules + (2 * sizeof(DWORD) - 1)) / sizeof(DWORD)];
980-
981-
// Process the Files Rules
982-
pbRule = (BYTE*)pdwEkuRules;
983-
pe256ssp = malloc(Header->FileRuleEntryCount * PE256_HASHSIZE);
984-
if (pe256ssp == NULL)
985-
goto out;
986-
for (i = 0; i < Header->FileRuleEntryCount; i++) {
987-
FileRuleHeader = (CIFileRuleHeader*)pbRule;
988-
pbRule = &pbRule[sizeof(CIFileRuleHeader)];
989-
if (FileRuleHeader->FileNameLength != 0) {
990-
// uprintf("%S", FileRuleHeader->FileName);
991-
pbRule = &pbRule[((FileRuleHeader->FileNameLength + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD)];
992-
}
993-
FileRuleData = (CIFileRuleData*)pbRule;
994-
if (FileRuleData->HashLength > 0x80) {
995-
uprintf("ParseSKUSiPolicy: Unexpected hash length for entry %d (0x%02x)", i, FileRuleData->HashLength);
996-
// We're probably screwed, so bail out
997-
break;
998-
}
999-
// We are only interested in 'DENY' type with PE256 hashes
1000-
if (FileRuleHeader->Type == CI_DENY && FileRuleData->HashLength == PE256_HASHSIZE) {
1001-
// Microsoft has the bad habit of duplicating entries - only add a hash if it's different from previous entry
1002-
if ((pe256ssp_size == 0) ||
1003-
(memcmp(&pe256ssp[(pe256ssp_size - 1) * PE256_HASHSIZE], FileRuleData->Hash, PE256_HASHSIZE) != 0)) {
1004-
memcpy(&pe256ssp[pe256ssp_size * PE256_HASHSIZE], FileRuleData->Hash, PE256_HASHSIZE);
1005-
pe256ssp_size++;
1006-
}
1007-
}
1008-
pbRule = &pbRule[sizeof(CIFileRuleData) + ((FileRuleData->HashLength + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD)];
1009-
}
1010-
1011-
r = TRUE;
1012-
1013-
out:
1014-
if (hMsg != NULL)
1015-
CryptMsgClose(hMsg);
1016-
free(pkcsData.pbData);
1017-
free(wpath);
1018-
return r;
1019-
}

src/rufus.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], u
9393

9494
extern HANDLE update_check_thread;
9595
extern HIMAGELIST hUpImageList, hDownImageList;
96-
extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked;
96+
extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes;
9797
extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel, toggle_dark_mode;
9898
extern BYTE* fido_script;
9999
extern HWND hFidoDlg;
@@ -1505,7 +1505,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
15051505
char tmp[MAX_PATH], tmp2[MAX_PATH], c;
15061506

15071507
syslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0;
1508-
is_bootloader_revoked = FALSE;
15091508
safe_free(grub2_buf);
15101509

15111510
if (ComboBox_GetCurSel(hDeviceList) == CB_ERR)
@@ -1688,6 +1687,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
16881687
if (img_report.win_version.build >= 26200) {
16891688
StrArrayAdd(&options, lmprintf(MSG_350), TRUE);
16901689
MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS);
1690+
StrArrayAdd(&options, lmprintf(MSG_324), TRUE);
1691+
MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY);
16911692
}
16921693
if (expert_mode) {
16931694
StrArrayAdd(&options, lmprintf(MSG_346), TRUE);

src/rufus.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,9 @@ typedef struct {
685685
#define UNATTEND_DISABLE_BITLOCKER 0x00080
686686
#define UNATTEND_FORCE_S_MODE 0x00100
687687
#define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200
688-
#define UNATTEND_FULL_MASK 0x003FF
689-
#define UNATTEND_DEFAULT_MASK 0x002FF // Mask of values that are persisted
688+
#define UNATTEND_APPLY_SKUSIPOLICY 0x00400
689+
#define UNATTEND_FULL_MASK 0x007FF
690+
#define UNATTEND_DEFAULT_MASK 0x006FF // Mask of values that are persisted
690691
#define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go
691692

692693
#define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM)
@@ -815,7 +816,6 @@ extern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan);
815816
extern BOOL ExtractZip(const char* src_zip, const char* dest_dir);
816817
extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes);
817818
extern uint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** buf);
818-
extern BOOL CopySKUSiPolicy(const char* drive_name);
819819
extern BOOL HasEfiImgBootLoaders(void);
820820
extern BOOL DumpFatDir(const char* path, int32_t cluster);
821821
extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs);
@@ -866,7 +866,6 @@ extern int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info);
866866
extern uint64_t GetSignatureTimeStamp(const char* path);
867867
extern LONG ValidateSignature(HWND hDlg, const char* path);
868868
extern BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen);
869-
extern BOOL ParseSKUSiPolicy(void);
870869
extern BOOL IsFontAvailable(const char* font_name);
871870
extern BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
872871
LPDWORD lpNumberOfBytesWritten, DWORD nNumRetries);

src/rufus.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
3333
IDD_DIALOG DIALOGEX 12, 12, 232, 326
3434
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
3535
EXSTYLE WS_EX_ACCEPTFILES
36-
CAPTION "Rufus 4.14.2317"
36+
CAPTION "Rufus 4.14.2318"
3737
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
3838
BEGIN
3939
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@@ -408,8 +408,8 @@ END
408408
//
409409

410410
VS_VERSION_INFO VERSIONINFO
411-
FILEVERSION 4,14,2317,0
412-
PRODUCTVERSION 4,14,2317,0
411+
FILEVERSION 4,14,2318,0
412+
PRODUCTVERSION 4,14,2318,0
413413
FILEFLAGSMASK 0x3fL
414414
#ifdef _DEBUG
415415
FILEFLAGS 0x1L
@@ -427,13 +427,13 @@ BEGIN
427427
VALUE "Comments", "https://rufus.ie"
428428
VALUE "CompanyName", "Akeo Consulting"
429429
VALUE "FileDescription", "Rufus"
430-
VALUE "FileVersion", "4.14.2317"
430+
VALUE "FileVersion", "4.14.2318"
431431
VALUE "InternalName", "Rufus"
432432
VALUE "LegalCopyright", "� 2011-2026 Pete Batard (GPL v3)"
433433
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
434434
VALUE "OriginalFilename", "rufus-4.14.exe"
435435
VALUE "ProductName", "Rufus"
436-
VALUE "ProductVersion", "4.14.2317"
436+
VALUE "ProductVersion", "4.14.2318"
437437
END
438438
END
439439
BLOCK "VarFileInfo"

src/wue.c

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Rufus: The Reliable USB Formatting Utility
33
* Windows User Experience
4-
* Copyright © 2022-2025 Pete Batard <pete@akeo.ie>
4+
* Copyright © 2022-2026 Pete Batard <pete@akeo.ie>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -47,7 +47,6 @@ const char* bypass_name[] = { "BypassTPMCheck", "BypassSecureBootCheck", "Bypass
4747
int unattend_xml_flags = 0, wintogo_index = -1, wininst_index = 0;
4848
int unattend_xml_mask = UNATTEND_DEFAULT_SELECTION_MASK;
4949
char *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH];
50-
BOOL is_bootloader_revoked = FALSE;
5150

5251
extern BOOL validate_md5sum;
5352
extern uint64_t md5sum_totalbytes;
@@ -65,7 +64,7 @@ char* CreateUnattendXml(int arch, int flags)
6564
{
6665
const static char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" };
6766
const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local", "NONE" };
68-
static char path[MAX_PATH];
67+
static char path[MAX_PATH], tmp[MAX_PATH];
6968
char* tzstr;
7069
FILE* fd;
7170
TIME_ZONE_INFORMATION tz_info;
@@ -140,7 +139,8 @@ char* CreateUnattendXml(int arch, int flags)
140139
}
141140

142141
if (flags & UNATTEND_OOBE_MASK) {
143-
order = 1;
142+
StrArray first_logon_commands = STRARRAY_EMPTY;
143+
StrArrayCreate(&first_logon_commands, 8);
144144
fprintf(fd, " <settings pass=\"oobeSystem\">\n");
145145
if (flags & UNATTEND_OOBE_SHELL_SETUP_MASK) {
146146
fprintf(fd, " <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" "
@@ -200,20 +200,40 @@ char* CreateUnattendXml(int arch, int flags)
200200
// Since we set a blank password, we'll ask the user to change it at next logon.
201201
// NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple
202202
// <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :(
203-
fprintf(fd, " <FirstLogonCommands>\n");
204-
fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n");
205-
fprintf(fd, " <Order>%d</Order>\n", order++);
206-
fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username);
207-
fprintf(fd, " </SynchronousCommand>\n");
208-
// Some people report that using the `net user` command above might reset the password expiration to 90 days...
203+
static_sprintf(tmp, "net user &quot;%s&quot; /logonpasswordchg:yes", unattend_username);
204+
StrArrayAdd(&first_logon_commands, tmp, TRUE);
205+
// The `net user` command above might reset the password expiration to 90 days...
209206
// To alleviate that, blanket set passwords on the target machine to never expire.
210-
fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n");
211-
fprintf(fd, " <Order>%d</Order>\n", order++);
212-
fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n");
213-
fprintf(fd, " </SynchronousCommand>\n");
214-
fprintf(fd, " </FirstLogonCommands>\n");
207+
StrArrayAdd(&first_logon_commands, "net accounts /maxpwage:unlimited", TRUE);
215208
}
216209
}
210+
211+
// Apply SkuSiPolicy.p7b, if the user requested it and we're not creating a Windows To Go drive.
212+
// See https://support.microsoft.com/kb/5042562. We do it post install, on first logon, because
213+
// we'd have to patch tons of files otherwise. And we *ALWAYS* use the installed system's
214+
// SkuSiPolicy.p7b instead of the host system's, even if the latter might be more recent, on
215+
// account that the bootloaders from the installed system might be trailing behind, and wills
216+
// produce the 0xc0000428 signature validation error on (re)boot if the system hasn't gone
217+
// through a full Windows Update cycle.
218+
if (flags & UNATTEND_APPLY_SKUSIPOLICY) {
219+
StrArrayAdd(&first_logon_commands, "cmd /c mountvol S: /S &amp;&amp; "
220+
"copy %WINDIR%\\system32\\SecureBootUpdates\\SkuSiPolicy.p7b S:\\EFI\\Microsoft\\Boot &amp;&amp; "
221+
"mountvol S: /D", TRUE);
222+
}
223+
224+
// Now that we have all the commands to run, create the FirstLogonCommands section.
225+
for (order = 1; order <= (int)first_logon_commands.Index; order++) {
226+
if (order == 1)
227+
fprintf(fd, " <FirstLogonCommands>\n");
228+
fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n");
229+
fprintf(fd, " <Order>%d</Order>\n", order);
230+
fprintf(fd, " <CommandLine>%s</CommandLine>\n", first_logon_commands.String[order - 1]);
231+
fprintf(fd, " </SynchronousCommand>\n");
232+
if (order == first_logon_commands.Index)
233+
fprintf(fd, " </FirstLogonCommands>\n");
234+
}
235+
StrArrayDestroy(&first_logon_commands);
236+
217237
fprintf(fd, " </component>\n");
218238
}
219239
if (flags & UNATTEND_OOBE_INTERNATIONAL_MASK) {
@@ -510,31 +530,6 @@ BOOL PopulateWindowsVersion(void)
510530
return ((img_report.win_version.major != 0) && (img_report.win_version.build != 0));
511531
}
512532

513-
// Copy this system's SkuSiPolicy.p7b to the target drive so that UEFI bootloaders
514-
// revoked by Windows through WDAC policy do get flagged as revoked.
515-
BOOL CopySKUSiPolicy(const char* drive_name)
516-
{
517-
BOOL r = FALSE;
518-
char src[MAX_PATH], dst[MAX_PATH];
519-
struct __stat64 stat64 = { 0 };
520-
521-
// Only copy SkuPolicy if we warned about the bootloader being revoked.
522-
if ((target_type != TT_UEFI) || !IS_WINDOWS_1X(img_report) ||
523-
(pe256ssp_size == 0) || !is_bootloader_revoked)
524-
return r;
525-
526-
static_sprintf(src, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", system_dir);
527-
static_sprintf(dst, "%s\\EFI\\Microsoft\\Boot\\SKUSiPolicy.p7b", drive_name);
528-
if ((_stat64U(dst, &stat64) != 0) && (_stat64U(src, &stat64) == 0)) {
529-
uprintf("Copying: %s (%s) (from %s)", dst, SizeToHumanReadable(stat64.st_size, FALSE, FALSE), src);
530-
r = CopyFileU(src, dst, TRUE);
531-
if (!r)
532-
uprintf(" Error writing file: %s", WindowsErrorString());
533-
}
534-
535-
return r;
536-
}
537-
538533
/// <summary>
539534
/// Checks which versions of Windows are available in an install image
540535
/// to set our extraction index. Asks the user to select one if needed.
@@ -739,8 +734,6 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp)
739734
ErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT));
740735
}
741736

742-
CopySKUSiPolicy((use_esp) ? ms_efi : drive_name);
743-
744737
UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 99, 100);
745738

746739
// Setting internal drives offline for Windows To Go is crucial if, for instance, you are using ReFS

0 commit comments

Comments
 (0)