DEFINE_ACQUIRE(AcquireNormal, TRUE, KeAcquireSpinLock(SpinLock, &CheckData->Irql))
DEFINE_RELEASE(ReleaseNormal, TRUE, KeReleaseSpinLock(SpinLock, CheckData->Irql))
+#ifdef _X86_
DEFINE_ACQUIRE(AcquireExp, TRUE, (KeAcquireSpinLock)(SpinLock, &CheckData->Irql))
DEFINE_RELEASE(ReleaseExp, TRUE, (KeReleaseSpinLock)(SpinLock, CheckData->Irql))
+#else
+DEFINE_ACQUIRE(AcquireExp, TRUE, KeAcquireSpinLock(SpinLock, &CheckData->Irql))
+DEFINE_RELEASE(ReleaseExp, TRUE, KeReleaseSpinLock(SpinLock, CheckData->Irql))
+#endif
DEFINE_ACQUIRE(AcquireSynch, TRUE, CheckData->Irql = KeAcquireSpinLockRaiseToSynch(SpinLock))
DEFINE_ACQUIRE(AcquireInStackQueued, TRUE, KeAcquireInStackQueuedSpinLock(SpinLock, &CheckData->QueueHandle))
{
NTSTATUS Status = STATUS_SUCCESS;
NTSTATUS ExceptionStatus;
- const PVOID InvalidPointer = (PVOID)0x5555555555555555LLU;
+ const PVOID InvalidPointer = (PVOID)0x5555555555555555ULL;
PVOID SectionObject;
LARGE_INTEGER MaximumSize;
ok_eq_hex(Status, STATUS_INVALID_PAGE_PROTECTION);
ok_eq_pointer(SectionObject, InvalidPointer);
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
StartSeh()
Status = MmCreateSection(NULL, 0, NULL, NULL, PAGE_READONLY, SEC_RESERVE, NULL, NULL);
EndSeh(STATUS_ACCESS_VIOLATION);
EndSeh(STATUS_ACCESS_VIOLATION);
ok_eq_pointer(SectionObject, InvalidPointer);
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
+ SectionObject = InvalidPointer;
+ MaximumSize.QuadPart = 0;
+ StartSeh()
+ Status = MmCreateSection(&SectionObject, 0, NULL, &MaximumSize, PAGE_READONLY, SEC_IMAGE, NULL, NULL);
+ EndSeh(STATUS_SUCCESS);
+ ok_eq_hex(Status, STATUS_INVALID_FILE_FOR_SECTION);
+ ok_eq_longlong(MaximumSize.QuadPart, 0LL);
+ ok_eq_pointer(SectionObject, InvalidPointer);
+
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
MaximumSize.QuadPart = 0;
StartSeh()
Status = MmCreateSection(NULL, 0, NULL, &MaximumSize, PAGE_READONLY, SEC_RESERVE, NULL, NULL);
ok_eq_hex(Status, STATUS_INVALID_PARAMETER_4);
ok_eq_longlong(MaximumSize.QuadPart, 0LL);
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
MaximumSize.QuadPart = 1;
StartSeh()
Status = MmCreateSection(NULL, 0, NULL, &MaximumSize, PAGE_READONLY, SEC_RESERVE, NULL, NULL);
EndSeh(STATUS_ACCESS_VIOLATION);
ok_eq_longlong(MaximumSize.QuadPart, 1LL);
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
SectionObject = InvalidPointer;
MaximumSize.QuadPart = 0;
StartSeh()
ok_eq_longlong(MaximumSize.QuadPart, 0LL);
ok_eq_pointer(SectionObject, InvalidPointer);
+ if (SectionObject && SectionObject != InvalidPointer)
+ ObDereferenceObject(SectionObject);
+
SectionObject = InvalidPointer;
MaximumSize.QuadPart = 1;
StartSeh()
if (SectionObject && SectionObject != InvalidPointer)
ObDereferenceObject(SectionObject);
-
- SectionObject = InvalidPointer;
- MaximumSize.QuadPart = 1;
- StartSeh()
- Status = MmCreateSection(&SectionObject, 0, NULL, &MaximumSize, PAGE_READONLY, SEC_IMAGE, NULL, NULL);
- EndSeh(STATUS_SUCCESS);
- ok_eq_hex(Status, STATUS_INVALID_FILE_FOR_SECTION);
- ok_eq_longlong(MaximumSize.QuadPart, 1LL);
- ok_eq_pointer(SectionObject, InvalidPointer);
}