From f1f6e4b4ea19344cdac082ed1a71d18879e5ee45 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 15 Feb 2020 00:09:43 +0000 Subject: [PATCH] [process] remove Vista-specific code --- src/process.c | 12 ++++-------- src/rufus.rc | 10 +++++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/process.c b/src/process.c index f5090965..00b43565 100644 --- a/src/process.c +++ b/src/process.c @@ -4,7 +4,7 @@ * * Modified from Process Hacker: * https://github.com/processhacker2/processhacker2/ - * Copyright © 2017-2019 Pete Batard + * Copyright © 2017-2020 Pete Batard * Copyright © 2017 dmex * Copyright © 2009-2016 wj32 * @@ -52,9 +52,6 @@ PF_TYPE_DECL(NTAPI, NTSTATUS, NtOpenProcessToken, (HANDLE, ACCESS_MASK, PHANDLE) PF_TYPE_DECL(NTAPI, NTSTATUS, NtAdjustPrivilegesToken, (HANDLE, BOOLEAN, PTOKEN_PRIVILEGES, ULONG, PTOKEN_PRIVILEGES, PULONG)); PF_TYPE_DECL(NTAPI, NTSTATUS, NtClose, (HANDLE)); -// This one is only available on Vista or later... -PF_TYPE_DECL(WINAPI, BOOL, QueryFullProcessImageNameW, (HANDLE, DWORD, LPWSTR, PDWORD)); - static PVOID PhHeapHandle = NULL; static wchar_t* _wHandleName; static BOOL _bPartialMatch, _bIgnoreSelf, _bQuiet; @@ -598,6 +595,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) // Where possible, try to get the full command line bGotCmdLine = FALSE; + size = MAX_PATH; wcmdline = GetProcessCommandLine(processHandle); if (wcmdline != NULL) { bGotCmdLine = TRUE; @@ -611,10 +609,8 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) // The above may not work on Windows 7, so try QueryFullProcessImageName (Vista or later) if (!bGotCmdLine) { - size = MAX_PATH; - PF_INIT(QueryFullProcessImageNameW, kernel32); - if ( (pfQueryFullProcessImageNameW != NULL) && - (bGotCmdLine = pfQueryFullProcessImageNameW(processHandle, 0, wexe_path, &size)) ) + bGotCmdLine = QueryFullProcessImageNameW(processHandle, 0, wexe_path, &size); + if (bGotCmdLine) wchar_to_utf8_no_alloc(wexe_path, cmdline, sizeof(cmdline)); } diff --git a/src/rufus.rc b/src/rufus.rc index 40617e44..fcc373ab 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 3.9.1610" +CAPTION "Rufus 3.9.1611" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -394,8 +394,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,9,1610,0 - PRODUCTVERSION 3,9,1610,0 + FILEVERSION 3,9,1611,0 + PRODUCTVERSION 3,9,1611,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -413,13 +413,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.9.1610" + VALUE "FileVersion", "3.9.1611" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.9.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.9.1610" + VALUE "ProductVersion", "3.9.1611" END END BLOCK "VarFileInfo"