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