https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8e16f2878906dd332ab6caa5c597deec14a40363

commit 8e16f2878906dd332ab6caa5c597deec14a40363
Author:     Mark Jansen <[email protected]>
AuthorDate: Sat Oct 15 11:40:22 2022 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Wed Oct 19 19:39:29 2022 +0200

    [RUNDLL32] Try to resolve the manifest file manually
    
    This fixes f.e. Ctrl+A not working in the Create Shortcut wizard
    CORE-16669
---
 base/system/rundll32/rundll32.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/base/system/rundll32/rundll32.c b/base/system/rundll32/rundll32.c
index 23bba1e2539..8c14009e8b9 100644
--- a/base/system/rundll32/rundll32.c
+++ b/base/system/rundll32/rundll32.c
@@ -337,6 +337,7 @@ int WINAPI _tWinMain(
 
     LPTSTR *argv;
     LPTSTR lptCmdLine,lptDllName,lptFuncName,lptMsgBuffer;
+    WCHAR ResolvedFile[MAX_PATH + 1] = {0}, *lpManifestName;
     LPSTR lpFuncName,lpaCmdLine;
     LPWSTR lpwCmdLine;
     HMODULE hDll;
@@ -386,7 +387,18 @@ int WINAPI _tWinMain(
     else
         lptCmdLine = _T("");
 
-    ActCtx.lpSource = lptDllName;
+    lpManifestName = lptDllName;
+    if (GetFileAttributesW(lptDllName) == INVALID_FILE_ATTRIBUTES)
+    {
+        LPWSTR FilePart = NULL;
+        if (SearchPathW(NULL, lptDllName, NULL, _countof(ResolvedFile) - 1, 
ResolvedFile, &FilePart))
+        {
+            lpManifestName = ResolvedFile;
+        }
+    }
+
+    // FIXME: If there is a .manifest file next to the input file, we should 
use that instead!
+    ActCtx.lpSource = lpManifestName;
     ActCtx.lpResourceName = (LPCWSTR)123;
     hActCtx = CreateActCtx(&ActCtx);
     bActivated = (hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(hActCtx, 
&cookie) : FALSE);

Reply via email to