Author: tkreuzer Date: Mon May 12 23:36:05 2014 New Revision: 63268
URL: http://svn.reactos.org/svn/reactos?rev=63268&view=rev Log: [KMTEST] Revert the DDK compatibility hack and apply a real fix. I kept the hack for NDK exports, we should consider changing them as well for consistency reasons.
Modified: trunk/rostests/kmtests/npfs/NpfsHelpers.c trunk/rostests/kmtests/ntos_ex/ExFastMutex.c trunk/rostests/kmtests/ntos_ex/ExResource.c trunk/rostests/kmtests/ntos_io/IoCreateFile.c trunk/rostests/kmtests/ntos_ke/KeEvent.c trunk/rostests/kmtests/ntos_ke/KeGuardedMutex.c trunk/rostests/kmtests/ntos_mm/MmSection.c trunk/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c trunk/rostests/kmtests/ntos_ob/ObTypes.c
Modified: trunk/rostests/kmtests/npfs/NpfsHelpers.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/npfs/NpfsHelpers.c... ============================================================================== --- trunk/rostests/kmtests/npfs/NpfsHelpers.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/npfs/NpfsHelpers.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -742,11 +742,7 @@ { Status = ObReferenceObjectByHandle(ThreadHandle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS *PsThreadType, -#else - PsThreadType, -#endif KernelMode, &ThreadObject, NULL);
Modified: trunk/rostests/kmtests/ntos_ex/ExFastMutex.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ex/ExFastMute... ============================================================================== --- trunk/rostests/kmtests/ntos_ex/ExFastMutex.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ex/ExFastMutex.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -196,13 +196,7 @@ 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);
Modified: trunk/rostests/kmtests/ntos_ex/ExResource.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ex/ExResource... ============================================================================== --- trunk/rostests/kmtests/ntos_ex/ExResource.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ex/ExResource.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -268,14 +268,7 @@ 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);
Modified: trunk/rostests/kmtests/ntos_io/IoCreateFile.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_io/IoCreateFi... ============================================================================== --- trunk/rostests/kmtests/ntos_io/IoCreateFile.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_io/IoCreateFile.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -57,11 +57,7 @@ { Status = ObReferenceObjectByHandle(TargetHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&TargetFileObject, NULL); @@ -107,11 +103,7 @@ { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -181,11 +173,7 @@ { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -199,11 +187,7 @@ 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 @@ { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -323,12 +302,7 @@ { Status = ObReferenceObjectByHandle(ParentHandle, FILE_READ_DATA, -#ifdef _PROPER_NT_EXPORTS *IoFileObjectType, -#else - IoFileObjectType, -#endif - KernelMode, (PVOID *)&ParentFileObject, NULL); @@ -342,12 +316,7 @@ 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 @@ /* Then, just wait on our thread to finish */ Status = ObReferenceObjectByHandle(ThreadHandle, SYNCHRONIZE, -#ifdef _PROPER_NT_EXPORTS *PsThreadType, -#else - PsThreadType, -#endif KernelMode, &ThreadObject, NULL);
Modified: trunk/rostests/kmtests/ntos_ke/KeEvent.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ke/KeEvent.c?... ============================================================================== --- trunk/rostests/kmtests/ntos_ke/KeEvent.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ke/KeEvent.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -169,13 +169,7 @@ 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);
Modified: trunk/rostests/kmtests/ntos_ke/KeGuardedMutex.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ke/KeGuardedM... ============================================================================== --- trunk/rostests/kmtests/ntos_ke/KeGuardedMutex.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ke/KeGuardedMutex.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -204,13 +204,7 @@ 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);
Modified: trunk/rostests/kmtests/ntos_mm/MmSection.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/MmSection.... ============================================================================== --- trunk/rostests/kmtests/ntos_mm/MmSection.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/MmSection.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -428,13 +428,7 @@
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 @@
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"); }
Modified: trunk/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/ZwAllocate... ============================================================================== --- trunk/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/ZwAllocateVirtualMemory.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -437,13 +437,7 @@ 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 @@ 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");
Modified: trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/ZwCreateSe... ============================================================================== --- trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -464,13 +464,7 @@ /* 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;
Modified: trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/ZwMapViewO... ============================================================================== --- trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -390,13 +390,7 @@ 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 @@
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
Modified: trunk/rostests/kmtests/ntos_ob/ObTypes.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObTypes.c?... ============================================================================== --- trunk/rostests/kmtests/ntos_ob/ObTypes.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ob/ObTypes.c [iso-8859-1] Mon May 12 23:36:05 2014 @@ -164,14 +164,6 @@ 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 @@ 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 @@ 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);