kernelbase: Use command_lineW for GetCommandLineW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48861 Signed-off-by: Myah Caron <qsniyg@protonmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f4a66ad257
commit
d01d3b749d
|
@ -872,6 +872,7 @@ static void test_CommandLine(void)
|
|||
PROCESS_INFORMATION info;
|
||||
STARTUPINFOA startup;
|
||||
BOOL ret;
|
||||
LPWSTR cmdline, cmdline_backup;
|
||||
|
||||
memset(&startup, 0, sizeof(startup));
|
||||
startup.cb = sizeof(startup);
|
||||
|
@ -1074,6 +1075,16 @@ static void test_CommandLine(void)
|
|||
ret = CreateProcessA(NULL, buffer2, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info);
|
||||
ok(!ret, "CreateProcessA unexpectedly succeeded\n");
|
||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
|
||||
|
||||
/* Test whether GetCommandLineW reads directly from TEB or from a cached address */
|
||||
cmdline = GetCommandLineW();
|
||||
ok(cmdline == NtCurrentTeb()->Peb->ProcessParameters->CommandLine.Buffer, "Expected address from TEB, got %p\n", cmdline);
|
||||
|
||||
cmdline_backup = cmdline;
|
||||
NtCurrentTeb()->Peb->ProcessParameters->CommandLine.Buffer = NULL;
|
||||
cmdline = GetCommandLineW();
|
||||
ok(cmdline == cmdline_backup, "Expected cached address from TEB, got %p\n", cmdline);
|
||||
NtCurrentTeb()->Peb->ProcessParameters->CommandLine.Buffer = cmdline_backup;
|
||||
}
|
||||
|
||||
static void test_Directory(void)
|
||||
|
|
|
@ -1289,7 +1289,7 @@ LPSTR WINAPI DECLSPEC_HOTPATCH GetCommandLineA(void)
|
|||
*/
|
||||
LPWSTR WINAPI DECLSPEC_HOTPATCH GetCommandLineW(void)
|
||||
{
|
||||
return NtCurrentTeb()->Peb->ProcessParameters->CommandLine.Buffer;
|
||||
return command_lineW;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue