diff --git a/modules/rostests/apitests/kernel32/CMakeLists.txt b/modules/rostests/apitests/kernel32/CMakeLists.txt index 9e0ca36563..a6b554fe28 100644 --- a/modules/rostests/apitests/kernel32/CMakeLists.txt +++ b/modules/rostests/apitests/kernel32/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND SOURCE GetCurrentDirectory.c GetDriveType.c GetModuleFileName.c + GetPriorityClass.c GetVolumeInformation.c interlck.c IsDBCSLeadByteEx.c diff --git a/modules/rostests/apitests/kernel32/GetPriorityClass.c b/modules/rostests/apitests/kernel32/GetPriorityClass.c new file mode 100644 index 0000000000..f144bcdae4 --- /dev/null +++ b/modules/rostests/apitests/kernel32/GetPriorityClass.c @@ -0,0 +1,41 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test spoiling of StaticUnicodeString by CreateProcessA + * PROGRAMMERS: Mark Jansen + */ + +#include "precomp.h" +#include + +#include + +START_TEST(GetPriorityClass) +{ + PUNICODE_STRING StaticString; + UNICODE_STRING CompareString; + BOOL Process; + STARTUPINFO si = {0}; + PROCESS_INFORMATION pi = {0}; + LONG Result; + + StaticString = &NtCurrentTeb()->StaticUnicodeString; + RtlInitUnicodeString(&CompareString, L"--sentinel--"); + RtlCopyUnicodeString(StaticString, &CompareString); + + si.cb = sizeof(si); + Process = CreateProcessA("ApplicationName", "CommandLine", NULL, NULL, FALSE, 0, NULL, "CurrentDir", &si, &pi); + ok_int(Process, 0); + + Result = RtlCompareUnicodeString(StaticString, &CompareString, TRUE); + ok(!Result, "Expected %s to equal %s\n", + wine_dbgstr_wn(StaticString->Buffer, StaticString->Length / sizeof(WCHAR)), + wine_dbgstr_wn(CompareString.Buffer, CompareString.Length / sizeof(WCHAR))); + + Result = GetPriorityClass(pi.hProcess); + printf("Process Priority is '%lx'.\n", Result); + + Result = GetPriorityClass((HANDLE)0xFFFFFFFF); + printf("Process Priority for INVALID HANDLE is '%lx'.\n", Result); + +} diff --git a/modules/rostests/apitests/kernel32/testlist.c b/modules/rostests/apitests/kernel32/testlist.c index 35240ac377..0130550147 100644 --- a/modules/rostests/apitests/kernel32/testlist.c +++ b/modules/rostests/apitests/kernel32/testlist.c @@ -16,6 +16,7 @@ extern void func_GetComputerNameEx(void); extern void func_GetCurrentDirectory(void); extern void func_GetDriveType(void); extern void func_GetModuleFileName(void); +extern void func_GetPriorityClass(void); extern void func_GetVolumeInformation(void); extern void func_interlck(void); extern void func_IsDBCSLeadByteEx(void); @@ -51,6 +52,7 @@ const struct test winetest_testlist[] = { "GetCurrentDirectory", func_GetCurrentDirectory }, { "GetDriveType", func_GetDriveType }, { "GetModuleFileName", func_GetModuleFileName }, + { "GetPriorityClass", func_GetPriorityClass }, { "GetVolumeInformation", func_GetVolumeInformation }, { "interlck", func_interlck }, { "IsDBCSLeadByteEx", func_IsDBCSLeadByteEx },