1c2c66affSColin Finck /*
2c2c66affSColin Finck * PROJECT: ReactOS api tests
3c2c66affSColin Finck * LICENSE: GPLv2+ - See COPYING in the top level directory
4c2c66affSColin Finck * PURPOSE: Test spoiling of StaticUnicodeString by CreateProcessA
5c2c66affSColin Finck * PROGRAMMERS: Mark Jansen
6c2c66affSColin Finck */
7c2c66affSColin Finck
8*e00cc972SAmine Khaldi #include "precomp.h"
9c2c66affSColin Finck
10*e00cc972SAmine Khaldi #include <ndk/rtlfuncs.h>
11c2c66affSColin Finck
START_TEST(CreateProcess)12c2c66affSColin Finck START_TEST(CreateProcess)
13c2c66affSColin Finck {
14c2c66affSColin Finck PUNICODE_STRING StaticString;
15c2c66affSColin Finck UNICODE_STRING CompareString;
16c2c66affSColin Finck BOOL Process;
17c2c66affSColin Finck STARTUPINFO si = {0};
18c2c66affSColin Finck PROCESS_INFORMATION pi = {0};
19c2c66affSColin Finck LONG Result;
20c2c66affSColin Finck
21c2c66affSColin Finck StaticString = &NtCurrentTeb()->StaticUnicodeString;
22c2c66affSColin Finck RtlInitUnicodeString(&CompareString, L"--sentinel--");
23c2c66affSColin Finck RtlCopyUnicodeString(StaticString, &CompareString);
24c2c66affSColin Finck
25c2c66affSColin Finck si.cb = sizeof(si);
26c2c66affSColin Finck Process = CreateProcessA("ApplicationName", "CommandLine", NULL, NULL, FALSE, 0, NULL, "CurrentDir", &si, &pi);
27c2c66affSColin Finck ok_int(Process, 0);
28c2c66affSColin Finck
29c2c66affSColin Finck Result = RtlCompareUnicodeString(StaticString, &CompareString, TRUE);
30c2c66affSColin Finck ok(!Result, "Expected %s to equal %s\n",
31c2c66affSColin Finck wine_dbgstr_wn(StaticString->Buffer, StaticString->Length / sizeof(WCHAR)),
32c2c66affSColin Finck wine_dbgstr_wn(CompareString.Buffer, CompareString.Length / sizeof(WCHAR)));
33c2c66affSColin Finck }
34