diff --git a/src/bled/decompress_unzip.c b/src/bled/decompress_unzip.c index fffdf3d2..ad698352 100644 --- a/src/bled/decompress_unzip.c +++ b/src/bled/decompress_unzip.c @@ -209,7 +209,7 @@ do { if (BB_BIG_ENDIAN) { \ (c64).fmt.cdf_offset = SWAP_LE64((c64).fmt.cdf_offset); \ }} while (0) -inline void BUG() { +inline void BUG(void) { /* Check the offset of the last element, not the length. This leniency * allows for poor packing, whereby the overall struct may be too long, * even though the elements are all in the right place. diff --git a/src/pki.c b/src/pki.c index 8f327325..2b4cc2da 100644 --- a/src/pki.c +++ b/src/pki.c @@ -812,7 +812,8 @@ BOOL ParseSKUSiPolicy(void) pe256ssp_size = 0; safe_free(pe256ssp); - static_sprintf(path, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", system_dir); + // Must use sysnative for WOW + static_sprintf(path, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", sysnative_dir); wpath = utf8_to_wchar(path); if (wpath == NULL) goto out; diff --git a/src/rufus.rc b/src/rufus.rc index 05f7d7fd..3140cb7a 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -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 4.2.2058" +CAPTION "Rufus 4.2.2059" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -392,8 +392,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,2058,0 - PRODUCTVERSION 4,2,2058,0 + FILEVERSION 4,2,2059,0 + PRODUCTVERSION 4,2,2059,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -411,13 +411,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.2.2058" + VALUE "FileVersion", "4.2.2059" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.2.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.2.2058" + VALUE "ProductVersion", "4.2.2059" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 1bb4e090..5316fb40 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -103,7 +103,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options) IFileDialog *pfd = NULL; IShellItem *psiResult; COMDLG_FILTERSPEC* filter_spec = NULL; - wchar_t *wpath = NULL, *wfilename = NULL; + wchar_t *wpath = NULL, *wfilename = NULL, *wext = NULL; IShellItem *si_path = NULL; // Automatically freed if ((ext == NULL) || (ext->count == 0) || (ext->extension == NULL) || (ext->description == NULL)) @@ -162,11 +162,20 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options) if (wfilename != NULL) { IFileDialog_SetFileName(pfd, wfilename); } + // Set a default extension so that when the user switches filters it gets + // automatically updated. Note that the IFileDialog::SetDefaultExtension() + // doc says the extension shouldn't be prefixed with unwanted characters + // but it appears to work regardless so we don't bother cleaning it. + wext = utf8_to_wchar((ext->extension == NULL) ? "" : ext->extension[0]); + if (wext != NULL) { + IFileDialog_SetDefaultExtension(pfd, wext); + } // Display the dialog hr = IFileDialog_Show(pfd, hMainDialog); // Cleanup + safe_free(wext); safe_free(wfilename); for (i = 0; i < ext->count; i++) { safe_free(filter_spec[i].pszSpec);