[USERINIT]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 26 Apr 2010 13:58:09 +0000 (13:58 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 26 Apr 2010 13:58:09 +0000 (13:58 +0000)
- Fix Startup Folder
- ShellExecuteEx needs lots of work
See issue #4568 for more details.

svn path=/trunk/; revision=47035

reactos/base/system/userinit/userinit.c

index 9eb9602..81027d4 100644 (file)
@@ -212,7 +212,6 @@ StartAutoApplications(
         WARN("FindFirstFile(%s) failed with error %lu\n", debugstr_w(szPath), GetLastError());
         return;
     }
         WARN("FindFirstFile(%s) failed with error %lu\n", debugstr_w(szPath), GetLastError());
         return;
     }
-    szPath[len] = L'\0';
 
     do
     {
 
     do
     {
@@ -220,9 +219,10 @@ StartAutoApplications(
         {
             memset(&ExecInfo, 0x0, sizeof(SHELLEXECUTEINFOW));
             ExecInfo.cbSize = sizeof(ExecInfo);
         {
             memset(&ExecInfo, 0x0, sizeof(SHELLEXECUTEINFOW));
             ExecInfo.cbSize = sizeof(ExecInfo);
+            wcscpy(&szPath[len+1], findData.cFileName);
             ExecInfo.lpVerb = L"open";
             ExecInfo.lpVerb = L"open";
-            ExecInfo.lpFile = findData.cFileName;
-            ExecInfo.lpDirectory = szPath;
+            ExecInfo.lpFile = szPath;
+            ExecInfo.lpDirectory = NULL;
             TRACE("Executing %s in directory %s\n",
                 debugstr_w(findData.cFileName), debugstr_w(szPath));
             ShellExecuteExW(&ExecInfo);
             TRACE("Executing %s in directory %s\n",
                 debugstr_w(findData.cFileName), debugstr_w(szPath));
             ShellExecuteExW(&ExecInfo);