mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
[KMTESTS]
- Add missing OBJ_KERNEL_HANDLE - OBJ_KERNEL_HANDLE in user mode has no effect... no reason to make a define around it CORE-10207 svn path=/trunk/; revision=69296
This commit is contained in:
parent
cd8e7fa978
commit
2ea155305a
3 changed files with 12 additions and 12 deletions
|
@ -454,7 +454,7 @@ UserModeTest(VOID)
|
||||||
ok_eq_hex(IoStatusBlock.Status, 0xFFFFFFFF);
|
ok_eq_hex(IoStatusBlock.Status, 0xFFFFFFFF);
|
||||||
if (Status == STATUS_SUCCESS)
|
if (Status == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
ObCloseHandle(ParentHandle, KernelMode);
|
ObCloseHandle(ParentHandle, UserMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt relative target open */
|
/* Attempt relative target open */
|
||||||
|
@ -462,7 +462,7 @@ UserModeTest(VOID)
|
||||||
IoStatusBlock.Information = 0xFFFFFFFF;
|
IoStatusBlock.Information = 0xFFFFFFFF;
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&SystemRoot,
|
&SystemRoot,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
Status = ZwOpenFile(&SystemRootHandle,
|
Status = ZwOpenFile(&SystemRootHandle,
|
||||||
GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE,
|
GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE,
|
||||||
|
@ -478,7 +478,7 @@ UserModeTest(VOID)
|
||||||
IoStatusBlock.Information = 0xFFFFFFFF;
|
IoStatusBlock.Information = 0xFFFFFFFF;
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Regedit,
|
&Regedit,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
SystemRootHandle,
|
SystemRootHandle,
|
||||||
NULL);
|
NULL);
|
||||||
Status = IoCreateFile(&ParentHandle,
|
Status = IoCreateFile(&ParentHandle,
|
||||||
|
|
|
@ -155,6 +155,7 @@ TestEventConcurrent(
|
||||||
PVOID ThreadObjects[RTL_NUMBER_OF(Threads)];
|
PVOID ThreadObjects[RTL_NUMBER_OF(Threads)];
|
||||||
LONG State;
|
LONG State;
|
||||||
PKTHREAD Thread = KeGetCurrentThread();
|
PKTHREAD Thread = KeGetCurrentThread();
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
|
||||||
LongTimeout.QuadPart = -100 * MILLISECOND;
|
LongTimeout.QuadPart = -100 * MILLISECOND;
|
||||||
ShortTimeout.QuadPart = -1 * MILLISECOND;
|
ShortTimeout.QuadPart = -1 * MILLISECOND;
|
||||||
|
@ -165,7 +166,12 @@ TestEventConcurrent(
|
||||||
{
|
{
|
||||||
Threads[i].Event = Event;
|
Threads[i].Event = Event;
|
||||||
Threads[i].Signal = FALSE;
|
Threads[i].Signal = FALSE;
|
||||||
Status = PsCreateSystemThread(&Threads[i].Handle, GENERIC_ALL, NULL, NULL, NULL, WaitForEventThread, &Threads[i]);
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
NULL,
|
||||||
|
OBJ_KERNEL_HANDLE,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
Status = PsCreateSystemThread(&Threads[i].Handle, GENERIC_ALL, &ObjectAttributes, NULL, NULL, WaitForEventThread, &Threads[i]);
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||||
Status = ObReferenceObjectByHandle(Threads[i].Handle, SYNCHRONIZE, *PsThreadType, KernelMode, (PVOID *)&Threads[i].Thread, NULL);
|
Status = ObReferenceObjectByHandle(Threads[i].Handle, SYNCHRONIZE, *PsThreadType, KernelMode, (PVOID *)&Threads[i].Thread, NULL);
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
#define KMT_EMULATE_KERNEL
|
#define KMT_EMULATE_KERNEL
|
||||||
#include <kmt_test.h>
|
#include <kmt_test.h>
|
||||||
|
|
||||||
#ifdef KMT_KERNEL_MODE
|
|
||||||
#define KMT_KERNEL_HANDLE OBJ_KERNEL_HANDLE
|
|
||||||
#else
|
|
||||||
#define KMT_KERNEL_HANDLE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef RTL_NUMBER_OF
|
#ifndef RTL_NUMBER_OF
|
||||||
#define RTL_NUMBER_OF(x) (sizeof(x) / sizeof(x[0]))
|
#define RTL_NUMBER_OF(x) (sizeof(x) / sizeof(x[0]))
|
||||||
#endif
|
#endif
|
||||||
|
@ -212,7 +206,7 @@ START_TEST(RtlRegistry)
|
||||||
RtlInitUnicodeString(&KeyName, L"\\Registry\\MACHINE\\Software");
|
RtlInitUnicodeString(&KeyName, L"\\Registry\\MACHINE\\Software");
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&KeyName,
|
&KeyName,
|
||||||
OBJ_CASE_INSENSITIVE | KMT_KERNEL_HANDLE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
Status = ZwOpenKey(&SoftwareHandle,
|
Status = ZwOpenKey(&SoftwareHandle,
|
||||||
|
@ -225,7 +219,7 @@ START_TEST(RtlRegistry)
|
||||||
RtlInitUnicodeString(&KeyName, L"RtlRegistryKmtestKey");
|
RtlInitUnicodeString(&KeyName, L"RtlRegistryKmtestKey");
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&KeyName,
|
&KeyName,
|
||||||
OBJ_CASE_INSENSITIVE | KMT_KERNEL_HANDLE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
SoftwareHandle,
|
SoftwareHandle,
|
||||||
NULL);
|
NULL);
|
||||||
Status = ZwCreateKey(&KeyHandle,
|
Status = ZwCreateKey(&KeyHandle,
|
||||||
|
|
Loading…
Reference in a new issue