Author: pschweitzer
Date: Tue Sep 29 18:43:35 2015
New Revision: 69417
URL:
http://svn.reactos.org/svn/reactos?rev=69417&view=rev
Log:
[KMTESTS:IO]
[KMTESTS:OB]
Simplify kernel mode thread creation
Modified:
trunk/rostests/kmtests/ntos_io/IoCreateFile.c
trunk/rostests/kmtests/ntos_ob/ObWait.c
Modified: trunk/rostests/kmtests/ntos_io/IoCreateFile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_io/IoCreateF…
==============================================================================
--- trunk/rostests/kmtests/ntos_io/IoCreateFile.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/ntos_io/IoCreateFile.c [iso-8859-1] Tue Sep 29 18:43:35 2015
@@ -871,10 +871,7 @@
START_TEST(IoCreateFile)
{
- NTSTATUS Status;
- OBJECT_ATTRIBUTES ObjectAttributes;
- HANDLE ThreadHandle;
- PVOID ThreadObject = NULL;
+ PKTHREAD ThreadHandle;
TestSymlinks();
@@ -882,36 +879,6 @@
UserModeTest();
/* 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);
- }
+ ThreadHandle = KmtStartThread(KernelModeTest, NULL);
+ KmtFinishThread(ThreadHandle, NULL);
}
Modified: trunk/rostests/kmtests/ntos_ob/ObWait.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObWait.c?…
==============================================================================
--- trunk/rostests/kmtests/ntos_ob/ObWait.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/ntos_ob/ObWait.c [iso-8859-1] Tue Sep 29 18:43:35 2015
@@ -23,42 +23,9 @@
START_TEST(ZwWaitForMultipleObjects)
{
- NTSTATUS Status;
- OBJECT_ATTRIBUTES ObjectAttributes;
- HANDLE ThreadHandle;
- PVOID ThreadObject = NULL;
+ PKTHREAD ThreadHandle;
/* 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);
- }
+ ThreadHandle = KmtStartThread(KernelModeTest, NULL);
+ KmtFinishThread(ThreadHandle, NULL);
}