diff --git a/rostests/kmtests/npfs/NpfsHelpers.c b/rostests/kmtests/npfs/NpfsHelpers.c index a06aec7f527..f4cd46e945a 100644 --- a/rostests/kmtests/npfs/NpfsHelpers.c +++ b/rostests/kmtests/npfs/NpfsHelpers.c @@ -742,11 +742,7 @@ KmtStartThread( { Status = ObReferenceObjectByHandle(ThreadHandle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS *PsThreadType, -#else - PsThreadType, -#endif KernelMode, &ThreadObject, NULL); diff --git a/rostests/kmtests/ntos_ex/ExFastMutex.c b/rostests/kmtests/ntos_ex/ExFastMutex.c index 6ac87b68cc8..db5cf14d0e8 100644 --- a/rostests/kmtests/ntos_ex/ExFastMutex.c +++ b/rostests/kmtests/ntos_ex/ExFastMutex.c @@ -196,13 +196,7 @@ StartThread( InitializeObjectAttributes(&Attributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL); Status = PsCreateSystemThread(&ThreadData->Handle, GENERIC_ALL, &Attributes, NULL, NULL, AcquireMutexThread, ThreadData); ok_eq_hex(Status, STATUS_SUCCESS); - Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, (PVOID *)&ThreadData->Thread, NULL); + Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, *PsThreadType, KernelMode, (PVOID *)&ThreadData->Thread, NULL); ok_eq_hex(Status, STATUS_SUCCESS); return KeWaitForSingleObject(&ThreadData->OutEvent, Executive, KernelMode, FALSE, Timeout); diff --git a/rostests/kmtests/ntos_ex/ExResource.c b/rostests/kmtests/ntos_ex/ExResource.c index 2463c3c9ee5..5ace01a0b0d 100644 --- a/rostests/kmtests/ntos_ex/ExResource.c +++ b/rostests/kmtests/ntos_ex/ExResource.c @@ -268,14 +268,7 @@ StartThread( InitializeObjectAttributes(&Attributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL); Status = PsCreateSystemThread(&ThreadData->Handle, GENERIC_ALL, &Attributes, NULL, NULL, AcquireResourceThread, ThreadData); ok_eq_hex(Status, STATUS_SUCCESS); - Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - - KernelMode, (PVOID *)&ThreadData->Thread, NULL); + Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, *PsThreadType, KernelMode, (PVOID *)&ThreadData->Thread, NULL); ok_eq_hex(Status, STATUS_SUCCESS); return KeWaitForSingleObject(&ThreadData->OutEvent, Executive, KernelMode, FALSE, Timeout); diff --git a/rostests/kmtests/ntos_io/IoCreateFile.c b/rostests/kmtests/ntos_io/IoCreateFile.c index f970e4d7738..836274535d9 100644 --- a/rostests/kmtests/ntos_io/IoCreateFile.c +++ b/rostests/kmtests/ntos_io/IoCreateFile.c @@ -57,11 +57,7 @@ KernelModeTest(IN PVOID Context) { Status = ObReferenceObjectByHandle(TargetHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&TargetFileObject, NULL); @@ -107,11 +103,7 @@ KernelModeTest(IN PVOID Context) { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -181,11 +173,7 @@ KernelModeTest(IN PVOID Context) { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -199,11 +187,7 @@ KernelModeTest(IN PVOID Context) ok_eq_long(RtlCompareUnicodeString(&ParentFileObject->FileName, &TargetFileObject->FileName, FALSE), 0); Status = ObReferenceObjectByHandle(SystemRootHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&SystemRootFileObject, NULL); @@ -256,12 +240,7 @@ KernelModeTest(IN PVOID Context) { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -323,12 +302,7 @@ KernelModeTest(IN PVOID Context) { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -342,12 +316,7 @@ KernelModeTest(IN PVOID Context) ok_eq_long(RtlCompareUnicodeString(&ParentFileObject->FileName, &TargetFileObject->FileName, FALSE), 0); Status = ObReferenceObjectByHandle(SystemRootHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&SystemRootFileObject, NULL); @@ -565,11 +534,7 @@ START_TEST(IoCreateFile) /* Then, just wait on our thread to finish */ Status = ObReferenceObjectByHandle(ThreadHandle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS *PsThreadType, -#else - PsThreadType, -#endif KernelMode, &ThreadObject, NULL); diff --git a/rostests/kmtests/ntos_ke/KeEvent.c b/rostests/kmtests/ntos_ke/KeEvent.c index 95feb125ace..e6d45db1a99 100644 --- a/rostests/kmtests/ntos_ke/KeEvent.c +++ b/rostests/kmtests/ntos_ke/KeEvent.c @@ -169,13 +169,7 @@ TestEventConcurrent( Threads[i].Signal = FALSE; Status = PsCreateSystemThread(&Threads[i].Handle, GENERIC_ALL, NULL, NULL, NULL, WaitForEventThread, &Threads[i]); ok_eq_hex(Status, STATUS_SUCCESS); - Status = ObReferenceObjectByHandle(Threads[i].Handle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - 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); ThreadObjects[i] = Threads[i].Thread; Priority = KeQueryPriorityThread(Threads[i].Thread); diff --git a/rostests/kmtests/ntos_ke/KeGuardedMutex.c b/rostests/kmtests/ntos_ke/KeGuardedMutex.c index 3acbec1a312..317ca1174fb 100644 --- a/rostests/kmtests/ntos_ke/KeGuardedMutex.c +++ b/rostests/kmtests/ntos_ke/KeGuardedMutex.c @@ -204,13 +204,7 @@ StartThread( InitializeObjectAttributes(&Attributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL); Status = PsCreateSystemThread(&ThreadData->Handle, GENERIC_ALL, &Attributes, NULL, NULL, AcquireMutexThread, ThreadData); ok_eq_hex(Status, STATUS_SUCCESS); - Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, (PVOID *)&ThreadData->Thread, NULL); + Status = ObReferenceObjectByHandle(ThreadData->Handle, SYNCHRONIZE, *PsThreadType, KernelMode, (PVOID *)&ThreadData->Thread, NULL); ok_eq_hex(Status, STATUS_SUCCESS); return KeWaitForSingleObject(&ThreadData->OutEvent, Executive, KernelMode, FALSE, Timeout); diff --git a/rostests/kmtests/ntos_mm/MmSection.c b/rostests/kmtests/ntos_mm/MmSection.c index e465721d0b7..393dba9866d 100644 --- a/rostests/kmtests/ntos_mm/MmSection.c +++ b/rostests/kmtests/ntos_mm/MmSection.c @@ -428,13 +428,7 @@ START_TEST(MmSection) if (!skip(Status == STATUS_SUCCESS && FileHandle1 != NULL, "Failed to open file 1\n")) { - Status = ObReferenceObjectByHandle(FileHandle1, FILE_READ_DATA | FILE_WRITE_DATA, -#ifdef _PROPER_NT_EXPORTS - *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&FileObject1, NULL); + Status = ObReferenceObjectByHandle(FileHandle1, FILE_READ_DATA | FILE_WRITE_DATA, *IoFileObjectType, KernelMode, (PVOID *)&FileObject1, NULL); ok_eq_hex(Status, STATUS_SUCCESS); ok(FileObject1 != NULL, "FileObject1 is NULL\n"); CheckObject(FileHandle1, 3L, 1L); @@ -442,13 +436,7 @@ START_TEST(MmSection) if (!skip(Status == STATUS_SUCCESS && FileHandle2 != NULL, "Failed to open file 2\n")) { - Status = ObReferenceObjectByHandle(FileHandle2, FILE_READ_DATA | FILE_WRITE_DATA, -#ifdef _PROPER_NT_EXPORTS - *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&FileObject2, NULL); + Status = ObReferenceObjectByHandle(FileHandle2, FILE_READ_DATA | FILE_WRITE_DATA, *IoFileObjectType, KernelMode, (PVOID *)&FileObject2, NULL); ok_eq_hex(Status, STATUS_SUCCESS); ok(FileObject2 != NULL, "FileObject2 is NULL\n"); } diff --git a/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c b/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c index 2d7b7b74824..785cb51030e 100644 --- a/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c +++ b/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c @@ -437,13 +437,7 @@ SystemProcessTest(VOID) goto cleanup; } - Status = ObReferenceObjectByHandle(Thread1, THREAD_ALL_ACCESS, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, &ThreadObjects[0], NULL); + Status = ObReferenceObjectByHandle(Thread1, THREAD_ALL_ACCESS, *PsThreadType, KernelMode, &ThreadObjects[0], NULL); if (!NT_SUCCESS(Status)) { trace("error referencing thread1\n"); @@ -457,13 +451,7 @@ SystemProcessTest(VOID) goto cleanup; } - Status = ObReferenceObjectByHandle(Thread2, THREAD_ALL_ACCESS, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, &ThreadObjects[1], NULL); + Status = ObReferenceObjectByHandle(Thread2, THREAD_ALL_ACCESS, *PsThreadType, KernelMode, &ThreadObjects[1], NULL); if (!NT_SUCCESS(Status)) { trace("error referencing thread2\n"); diff --git a/rostests/kmtests/ntos_mm/ZwCreateSection.c b/rostests/kmtests/ntos_mm/ZwCreateSection.c index 55720dab999..1e9ccdb2f66 100644 --- a/rostests/kmtests/ntos_mm/ZwCreateSection.c +++ b/rostests/kmtests/ntos_mm/ZwCreateSection.c @@ -464,13 +464,7 @@ BasicBehaviorChecks(HANDLE FileHandle) /* FIXME: Null pointer dereference. See ROSTESTS-108 */ #ifdef ROSTESTS_108_FIXED //mimic lack of section support for a particular file as well. - Status = ObReferenceObjectByHandle(FileHandle, STANDARD_RIGHTS_ALL, -#ifdef _PROPER_NT_EXPORTS - *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&FileObject, NULL); + Status = ObReferenceObjectByHandle(FileHandle, STANDARD_RIGHTS_ALL, *IoFileObjectType, KernelMode, (PVOID *)&FileObject, NULL); if (!skip(NT_SUCCESS(Status), "Cannot reference object by handle\n")) { PSECTION_OBJECT_POINTERS Pointers = FileObject->SectionObjectPointer; diff --git a/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c b/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c index 3a4bcad2336..09083edfa2a 100644 --- a/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c +++ b/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c @@ -390,13 +390,7 @@ BehaviorChecks(HANDLE FileHandleReadOnly, HANDLE FileHandleWriteOnly) Status = PsCreateSystemThread(&SysThreadHandle, STANDARD_RIGHTS_ALL, &ObjectAttributes, NULL, NULL, SystemProcessWorker, NULL); if (!skip(NT_SUCCESS(Status), "Error creating System thread. Error = %p\n", Status)) { - Status = ObReferenceObjectByHandle(SysThreadHandle, THREAD_ALL_ACCESS, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, &ThreadObject, NULL); + Status = ObReferenceObjectByHandle(SysThreadHandle, THREAD_ALL_ACCESS, *PsThreadType, KernelMode, &ThreadObject, NULL); if (!skip(NT_SUCCESS(Status), "Error getting reference to System thread when testing file-backed section\n")) { //wait until the system thread actually terminates @@ -521,13 +515,7 @@ PageFileBehaviorChecks() if (!skip(NT_SUCCESS(Status), "Error creating System thread. Error = %p\n", Status)) { - Status = ObReferenceObjectByHandle(SysThreadHandle, THREAD_ALL_ACCESS, -#ifdef _PROPER_NT_EXPORTS - *PsThreadType, -#else - PsThreadType, -#endif - KernelMode, &ThreadObject, NULL); + Status = ObReferenceObjectByHandle(SysThreadHandle, THREAD_ALL_ACCESS, *PsThreadType, KernelMode, &ThreadObject, NULL); if (!skip(NT_SUCCESS(Status), "Error getting reference to System thread when testing pagefile-backed section\n")) { //wait until the system thread actually terminates diff --git a/rostests/kmtests/ntos_ob/ObTypes.c b/rostests/kmtests/ntos_ob/ObTypes.c index 5f2e14fc3b1..70d6e8e7e20 100644 --- a/rostests/kmtests/ntos_ob/ObTypes.c +++ b/rostests/kmtests/ntos_ob/ObTypes.c @@ -164,14 +164,6 @@ TestObjectTypes(VOID) SeDefaultObjectMethod = ObpTypeObjectType->TypeInfo.SecurityProcedure; ok(SeDefaultObjectMethod != NULL, "No SeDefaultObjectMethod\n"); -#ifdef _PROPER_NT_EXPORTS -#define ExSemaphoreObjectType *ExSemaphoreObjectType -#define SeTokenObjectType *SeTokenObjectType -#define PsProcessType *PsProcessType -#define PsThreadType *PsThreadType -#define ExEventObjectType *ExEventObjectType -#define IoFileObjectType *IoFileObjectType -#endif #ifdef _PROPER_NT_NDK_EXPORTS #define ObpTypeObjectType *ObpTypeObjectType #define ObpDirectoryObjectType *ObpDirectoryObjectType @@ -203,16 +195,16 @@ TestObjectTypes(VOID) ok_eq_hex(ObpTypeObjectType->Key, TAG('ObjT')); CheckObjectType(Directory, ObpDirectoryObjectType, OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020003, 0x02000c, 0x020003, 0x0f000f, 0x0f000f); CheckObjectType(SymbolicLink, ObpSymbolicLinkObjectType, OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020001, 0x020000, 0x020001, 0x0f0001, 0x0f0001); - CheckObjectType(Token, SeTokenObjectType, OBT_SECURITY_REQUIRED | OBT_PAGED_POOL, 0x100, 0x020008, 0x0200e0, 0x020000, 0x0f01ff, 0x1f01ff); - CheckObjectType(Process, PsProcessType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020410, 0x020beb, 0x120000, 0x1f0fff, 0x1f0fff); - CheckObjectType(Thread, PsThreadType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020048, 0x020037, 0x120000, 0x1f03ff, 0x1f03ff); + CheckObjectType(Token, *SeTokenObjectType, OBT_SECURITY_REQUIRED | OBT_PAGED_POOL, 0x100, 0x020008, 0x0200e0, 0x020000, 0x0f01ff, 0x1f01ff); + CheckObjectType(Process, *PsProcessType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020410, 0x020beb, 0x120000, 0x1f0fff, 0x1f0fff); + CheckObjectType(Thread, *PsThreadType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020048, 0x020037, 0x120000, 0x1f03ff, 0x1f03ff); CheckObjectType(Job, PsJobType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020004, 0x02000b, 0x120000, 0x1f03ff, 0x1f001f); CheckObjectType(DebugObject, DbgkDebugObjectType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020001, 0x020002, 0x120000, 0x1f000f, 0x1f000f); - CheckObjectType(Event, ExEventObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); + CheckObjectType(Event, *ExEventObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(EventPair, ExEventPairObjectType, 0, 0x100, 0x120000, 0x120000, 0x120000, 0x1f0000, 0x1f0000); CheckObjectType(Mutant, ExMutantObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020000, 0x120000, 0x1f0001, 0x1f0001); CheckObjectType(Callback, ExCallbackObjectType, OBT_NO_DEFAULT, 0x100, 0x020000, 0x020001, 0x120000, 0x1f0001, 0x1f0001); - CheckObjectType(Semaphore, ExSemaphoreObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); + CheckObjectType(Semaphore, *ExSemaphoreObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(Timer, ExTimerObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(Profile, ExProfileObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020001, 0x020001, 0x0f0001, 0x0f0001); CheckObjectType(KeyedEvent, ExpKeyedEventObjectType, OBT_PAGED_POOL, 0x000, 0x020001, 0x020002, 0x020000, 0x0f0003, 0x1f0003); @@ -231,7 +223,7 @@ TestObjectTypes(VOID) 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(Driver, IoDriverObjectType, OBT_CASE_INSENSITIVE, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(IoCompletion, IoCompletionObjectType, OBT_CASE_INSENSITIVE, 0x110, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); - CheckObjectType(File, IoFileObjectType, OBT_NO_DEFAULT | OBT_CUSTOM_SECURITY_PROC | OBT_CASE_INSENSITIVE | OBT_MAINTAIN_HANDLE_COUNT, + CheckObjectType(File, *IoFileObjectType, OBT_NO_DEFAULT | OBT_CUSTOM_SECURITY_PROC | OBT_CASE_INSENSITIVE | OBT_MAINTAIN_HANDLE_COUNT, 0x130, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(WmiGuid, WmipGuidObjectType, OBT_NO_DEFAULT | OBT_CUSTOM_SECURITY_PROC | OBT_SECURITY_REQUIRED, 0x100, 0x000001, 0x000002, 0x000010, 0x120fff, 0x1f0fff);