Author: pschweitzer Date: Mon Sep 28 12:25:38 2015 New Revision: 69398
URL: http://svn.reactos.org/svn/reactos?rev=69398&view=rev Log: [KMTESTS:OB] Add a test dedicated to Stefan.
Added: trunk/rostests/kmtests/ntos_ob/ObWait.c (with props) Modified: trunk/rostests/kmtests/CMakeLists.txt trunk/rostests/kmtests/kmtest_drv/testlist.c
Modified: trunk/rostests/kmtests/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/CMakeLists.txt?rev... ============================================================================== --- trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] Mon Sep 28 12:25:38 2015 @@ -74,6 +74,7 @@ ntos_ob/ObReference.c ntos_ob/ObType.c ntos_ob/ObTypes.c + ntos_ob/ObWait.c ntos_ps/PsNotify.c ntos_se/SeHelpers.c ntos_se/SeInheritance.c
Modified: trunk/rostests/kmtests/kmtest_drv/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kmtest_drv/testlis... ============================================================================== --- trunk/rostests/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/kmtest_drv/testlist.c [iso-8859-1] Mon Sep 28 12:25:38 2015 @@ -66,6 +66,7 @@ KMT_TESTFUNC Test_ZwAllocateVirtualMemory; KMT_TESTFUNC Test_ZwCreateSection; KMT_TESTFUNC Test_ZwMapViewOfSection; +KMT_TESTFUNC Test_ZwWaitForMultipleObjects;
const KMT_TEST TestList[] = { @@ -128,5 +129,6 @@ { "ZwAllocateVirtualMemory", Test_ZwAllocateVirtualMemory }, { "ZwCreateSection", Test_ZwCreateSection }, { "ZwMapViewOfSection", Test_ZwMapViewOfSection }, + { "ZwWaitForMultipleObjects", Test_ZwWaitForMultipleObjects}, { NULL, NULL } };
Added: trunk/rostests/kmtests/ntos_ob/ObWait.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObWait.c?r... ============================================================================== --- trunk/rostests/kmtests/ntos_ob/ObWait.c (added) +++ trunk/rostests/kmtests/ntos_ob/ObWait.c [iso-8859-1] Mon Sep 28 12:25:38 2015 @@ -0,0 +1,64 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite *WaitForMultipleObjects + * PROGRAMMER: Pierre Schweitzer thomas.faber@reactos.org + */ + +#include <kmt_test.h> + +#define NDEBUG +#include <debug.h> + +static +VOID +NTAPI +KernelModeTest(IN PVOID Context) +{ + NTSTATUS Status; + + Status = ZwWaitForMultipleObjects(2, (void **)0x42424242, WaitAll, FALSE, NULL); + ok_eq_hex(Status, STATUS_ACCESS_VIOLATION); +} + +START_TEST(ZwWaitForMultipleObjects) +{ + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE ThreadHandle; + PVOID ThreadObject = NULL; + + /* We've to be in kernel mode, so spawn a thread */ + InitializeObjectAttributes(&ObjectAttributes, + NULL, + OBJ_KERNEL_HANDLE, + NULL, + NULL); + Status = PsCreateSystemThread(&ThreadHandle, + SYNCHRONIZE, + &ObjectAttributes, + NULL, + NULL, + KernelModeTest, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + if (Status == STATUS_SUCCESS) + { + /* Then, just wait on our thread to finish */ + Status = ObReferenceObjectByHandle(ThreadHandle, + SYNCHRONIZE, + *PsThreadType, + KernelMode, + &ThreadObject, + NULL); + ObCloseHandle(ThreadHandle, KernelMode); + + Status = KeWaitForSingleObject(ThreadObject, + Executive, + KernelMode, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ObDereferenceObject(ThreadObject); + } +}
Propchange: trunk/rostests/kmtests/ntos_ob/ObWait.c ------------------------------------------------------------------------------ svn:eol-style = native