From 04575c37cdc505a082b1ab9353dd9e38769675f5 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 28 Jan 2022 04:39:42 +0200 Subject: [PATCH] Fall back to built-in GUID when looking for the VBScript engine in InputBox --- ExplorerPatcher/utility.c | 4 ++-- ExplorerPatcher/utility.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ExplorerPatcher/utility.c b/ExplorerPatcher/utility.c index f252c99..052fa10 100644 --- a/ExplorerPatcher/utility.c +++ b/ExplorerPatcher/utility.c @@ -1093,7 +1093,7 @@ HRESULT InputBox(BOOL bPassword, HWND hWnd, LPCWSTR wszPrompt, LPCWSTR wszTitle, HRESULT hr = S_OK; GUID guidBuffer; - getEngineGuid(L".vbs", &guidBuffer); + hr = getEngineGuid(L".vbs", &guidBuffer); DWORD cchPromptSafe = 0, cchTitleSafe = 0, cchDefaultSafe = 0; LPWSTR wszPromptSafe = StrReplaceAllW(wszPrompt, L"\"", L"\"\"", &cchPromptSafe); @@ -1117,7 +1117,7 @@ HRESULT InputBox(BOOL bPassword, HWND hWnd, LPCWSTR wszPrompt, LPCWSTR wszTitle, } IActiveScript* pActiveScript = NULL; - hr = CoCreateInstance(&guidBuffer, 0, CLSCTX_ALL, + hr = CoCreateInstance(FAILED(hr) ? &CLSID_VBScript : &guidBuffer, 0, CLSCTX_ALL, &IID_IActiveScript, (void**)&pActiveScript); if (SUCCEEDED(hr) && pActiveScript) diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index 57f42d0..e9bc319 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -53,6 +53,12 @@ DEFINE_GUID(IID_OpenControlPanel, 0x1F, 0x56, 0x21, 0x99, 0x6A, 0xF1 ); +DEFINE_GUID(CLSID_VBScript, + 0xB54F3741, + 0x5B07, 0x11CF, 0xA4, 0xB0, + 0x00, 0xAA, 0x00, 0x4A, 0x55, 0xE8 +); + typedef struct _StuckRectsData { int pvData[6];