From 4d7dcc6886bcb8eede2da0fac225dc348dbe8513 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 26 Jun 1999 18:24:38 +0000 Subject: [PATCH] Fixed application file name (absolute path) in command line. svn path=/trunk/; revision=566 --- reactos/lib/kernel32/process/create.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index f523bf32a2d..782e164d2ac 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -426,11 +426,24 @@ WINBOOL STDCALL CreateProcessW(LPCWSTR lpApplicationName, ULONG InitialViewSize; PROCESS_BASIC_INFORMATION ProcessBasicInfo; ULONG retlen; + DWORD len = 0; DPRINT("CreateProcessW(lpApplicationName '%w', lpCommandLine '%w')\n", lpApplicationName,lpCommandLine); - - wcscpy(TempCommandLine, lpApplicationName); + + if (lpApplicationName[1] != ':') + { + len = GetCurrentDirectoryW(MAX_PATH,TempCommandLine); + if (TempCommandLine[len - 1] != L'\\') + { + TempCommandLine[len] = L'\\'; + TempCommandLine[len + 1] = 0; + } + wcscat(TempCommandLine,lpApplicationName); + } + else + wcscpy(TempCommandLine, lpApplicationName); + if (lpCommandLine != NULL) { wcscat(TempCommandLine, L" ");