ReactOS  0.4.14-dev-376-gaedba84
CreateProcess.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Test spoiling of StaticUnicodeString by CreateProcessA
5  * PROGRAMMERS: Mark Jansen
6  */
7 
8 #include "precomp.h"
9 
10 #include <ndk/rtlfuncs.h>
11 
13 {
16  BOOL Process;
17  STARTUPINFO si = {0};
18  PROCESS_INFORMATION pi = {0};
19  LONG Result;
20 
21  StaticString = &NtCurrentTeb()->StaticUnicodeString;
22  RtlInitUnicodeString(&CompareString, L"--sentinel--");
24 
25  si.cb = sizeof(si);
26  Process = CreateProcessA("ApplicationName", "CommandLine", NULL, NULL, FALSE, 0, NULL, "CurrentDir", &si, &pi);
27  ok_int(Process, 0);
28 
30  ok(!Result, "Expected %s to equal %s\n",
32  wine_dbgstr_wn(CompareString.Buffer, CompareString.Length / sizeof(WCHAR)));
33 }
#define TRUE
Definition: types.h:120
START_TEST(CreateProcess)
Definition: CreateProcess.c:12
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define ok_int(expression, result)
Definition: atltest.h:134
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
#define CompareString
Definition: winnls.h:1171
DWORD cb
Definition: winbase.h:803
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4742
static DWORD pi
Definition: protocol.c:150
static const WCHAR L[]
Definition: oid.c:1250
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
const char * wine_dbgstr_wn(const WCHAR *str, int n)
Definition: compat.c:342
#define CreateProcess
Definition: winbase.h:3582
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define ok(value,...)
Definition: atltest.h:57
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING StaticString