https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7b33915adc92b76c80a97a81899f11a135ed1df4

commit 7b33915adc92b76c80a97a81899f11a135ed1df4
Author:     Mark Jansen <[email protected]>
AuthorDate: Sun Sep 26 17:26:03 2021 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Wed Oct 19 19:36:26 2022 +0200

    [SYSSETUP] Add support for shortcut arguments
---
 dll/win32/syssetup/install.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dll/win32/syssetup/install.c b/dll/win32/syssetup/install.c
index 4a89017d5bc..fe2ccf89394 100644
--- a/dll/win32/syssetup/install.c
+++ b/dll/win32/syssetup/install.c
@@ -121,7 +121,8 @@ CreateShortcut(
     LPCWSTR pszCommand,
     LPCWSTR pszDescription,
     INT iIconNr,
-    LPCWSTR pszWorkingDir)
+    LPCWSTR pszWorkingDir,
+    LPCWSTR pszArgs)
 {
     DWORD dwLen;
     LPWSTR Ptr;
@@ -170,7 +171,7 @@ CreateShortcut(
     /* Create the shortcut */
     return SUCCEEDED(CreateShellLink(szPath,
                                      pszCommand,
-                                     L"",
+                                     pszArgs,
                                      pszWorkingDir,
                                      /* Special value to indicate no icon */
                                      (iIconNr != -1 ? pszCommand : NULL),
@@ -188,6 +189,7 @@ static BOOL CreateShortcutsFromSection(HINF hinf, LPWSTR 
pszSection, LPCWSTR psz
     WCHAR szName[MAX_PATH];
     WCHAR szDescription[MAX_PATH];
     WCHAR szDirectory[MAX_PATH];
+    WCHAR szArgs[MAX_PATH];
 
     if (!SetupFindFirstLine(hinf, pszSection, NULL, &Context))
         return FALSE;
@@ -213,9 +215,12 @@ static BOOL CreateShortcutsFromSection(HINF hinf, LPWSTR 
pszSection, LPCWSTR psz
         if (dwFieldCount < 5 || !SetupGetStringFieldW(&Context, 5, 
szDirectory, ARRAYSIZE(szDirectory), NULL))
             szDirectory[0] = L'\0';
 
+        if (dwFieldCount < 6 || !SetupGetStringFieldW(&Context, 6, szArgs, 
ARRAYSIZE(szArgs), NULL))
+            szArgs[0] = L'\0';
+
         wcscat(szName, L".lnk");
 
-        CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, 
szDirectory);
+        CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, 
szDirectory, szArgs);
 
     } while (SetupFindNextLine(&Context, &Context));
 

Reply via email to