mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
- Remove all NT_ASSERT from the kernel and replace with good old ASSERT, for ease of debugging, especially for tests run on the build servers. There is no need to use NT_ASSERT in the kernel.
- The fish is long gone. svn path=/trunk/; revision=68888
This commit is contained in:
parent
a4f0ae9e87
commit
e4fd9b81bc
23 changed files with 59 additions and 60 deletions
|
@ -453,7 +453,7 @@ CcFastCopyRead (
|
||||||
TRUE,
|
TRUE,
|
||||||
Buffer,
|
Buffer,
|
||||||
IoStatus);
|
IoStatus);
|
||||||
NT_ASSERT(Success == TRUE);
|
ASSERT(Success == TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -479,7 +479,7 @@ CcFastCopyWrite (
|
||||||
Length,
|
Length,
|
||||||
TRUE,
|
TRUE,
|
||||||
Buffer);
|
Buffer);
|
||||||
NT_ASSERT(Success == TRUE);
|
ASSERT(Success == TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -606,7 +606,7 @@ CmpQueryKeyData(IN PHHIVE Hive,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy the class data */
|
/* Copy the class data */
|
||||||
NT_ASSERT(Length >= Offset);
|
ASSERT(Length >= Offset);
|
||||||
RtlCopyMemory(Info->KeyFullInformation.Class,
|
RtlCopyMemory(Info->KeyFullInformation.Class,
|
||||||
ClassData,
|
ClassData,
|
||||||
min(Node->ClassLength, Length - Offset));
|
min(Node->ClassLength, Length - Offset));
|
||||||
|
|
|
@ -24,7 +24,7 @@ CmpGetNextName(IN OUT PUNICODE_STRING RemainingName,
|
||||||
{
|
{
|
||||||
BOOLEAN NameValid = TRUE;
|
BOOLEAN NameValid = TRUE;
|
||||||
|
|
||||||
NT_ASSERT(RemainingName->Length % sizeof(WCHAR) == 0);
|
ASSERT(RemainingName->Length % sizeof(WCHAR) == 0);
|
||||||
|
|
||||||
/* Check if there's nothing left in the name */
|
/* Check if there's nothing left in the name */
|
||||||
if (!(RemainingName->Buffer) ||
|
if (!(RemainingName->Buffer) ||
|
||||||
|
|
|
@ -85,7 +85,7 @@ ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
Entry = NULL;
|
Entry = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ ExpWin32SessionCallout(
|
||||||
if (SessionEntry == NULL)
|
if (SessionEntry == NULL)
|
||||||
{
|
{
|
||||||
/* The requested session does not even exist! */
|
/* The requested session does not even exist! */
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return STATUS_NOT_FOUND;
|
return STATUS_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ ExpWin32SessionCallout(
|
||||||
|
|
||||||
/* Cleanup and return */
|
/* Cleanup and return */
|
||||||
MmQuitNextSession(SessionEntry);
|
MmQuitNextSession(SessionEntry);
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -876,7 +876,7 @@ NextReferenceString:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add final NULL to ReturnBuffer */
|
/* Add final NULL to ReturnBuffer */
|
||||||
NT_ASSERT(ReturnBuffer.Length <= ReturnBuffer.MaximumLength);
|
ASSERT(ReturnBuffer.Length <= ReturnBuffer.MaximumLength);
|
||||||
if (ReturnBuffer.Length >= ReturnBuffer.MaximumLength)
|
if (ReturnBuffer.Length >= ReturnBuffer.MaximumLength)
|
||||||
{
|
{
|
||||||
PWSTR NewBuffer;
|
PWSTR NewBuffer;
|
||||||
|
|
|
@ -934,7 +934,7 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
|
||||||
|
|
||||||
NextEntry = NextEntry->Flink;
|
NextEntry = NextEntry->Flink;
|
||||||
}
|
}
|
||||||
NT_ASSERT(NextEntry != &PsLoadedModuleList);
|
ASSERT(NextEntry != &PsLoadedModuleList);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the driver
|
* Initialize the driver
|
||||||
|
@ -1374,7 +1374,7 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
||||||
/* Set the unload invoked flag and call the unload routine */
|
/* Set the unload invoked flag and call the unload routine */
|
||||||
DriverObject->Flags |= DRVO_UNLOAD_INVOKED;
|
DriverObject->Flags |= DRVO_UNLOAD_INVOKED;
|
||||||
Status = IopLoadUnloadDriver(NULL, &DriverObject);
|
Status = IopLoadUnloadDriver(NULL, &DriverObject);
|
||||||
NT_ASSERT(Status == STATUS_SUCCESS);
|
ASSERT(Status == STATUS_SUCCESS);
|
||||||
|
|
||||||
/* Mark the driver object temporary, so it could be deleted later */
|
/* Mark the driver object temporary, so it could be deleted later */
|
||||||
ObMakeTemporaryObject(DriverObject);
|
ObMakeTemporaryObject(DriverObject);
|
||||||
|
@ -1874,7 +1874,7 @@ IopLoadUnloadDriverWorker(
|
||||||
{
|
{
|
||||||
PLOAD_UNLOAD_PARAMS LoadParams = Parameter;
|
PLOAD_UNLOAD_PARAMS LoadParams = Parameter;
|
||||||
|
|
||||||
NT_ASSERT(PsGetCurrentProcess() == PsInitialSystemProcess);
|
ASSERT(PsGetCurrentProcess() == PsInitialSystemProcess);
|
||||||
LoadParams->Status = IopLoadUnloadDriver(LoadParams->RegistryPath,
|
LoadParams->Status = IopLoadUnloadDriver(LoadParams->RegistryPath,
|
||||||
&LoadParams->DriverObject);
|
&LoadParams->DriverObject);
|
||||||
KeSetEvent(&LoadParams->Event, 0, FALSE);
|
KeSetEvent(&LoadParams->Event, 0, FALSE);
|
||||||
|
|
|
@ -312,7 +312,7 @@ KeUserModeCallback(IN ULONG RoutineIndex,
|
||||||
OUT PVOID *Result,
|
OUT PVOID *Result,
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ KiCallUserMode(
|
||||||
IN PVOID *OutputBuffer,
|
IN PVOID *OutputBuffer,
|
||||||
IN PULONG OutputLength)
|
IN PULONG OutputLength)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ NtCallbackReturn(
|
||||||
_In_ ULONG ResultLength,
|
_In_ ULONG ResultLength,
|
||||||
_In_ NTSTATUS CallbackStatus)
|
_In_ NTSTATUS CallbackStatus)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1537,7 +1537,7 @@ KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
Thread = KeGetCurrentThread();
|
Thread = KeGetCurrentThread();
|
||||||
Thread->TrapFrame = TrapFrame;
|
Thread->TrapFrame = TrapFrame;
|
||||||
Thread->PreviousMode = KiUserTrap(TrapFrame);
|
Thread->PreviousMode = KiUserTrap(TrapFrame);
|
||||||
NT_ASSERT(Thread->PreviousMode != KernelMode);
|
ASSERT(Thread->PreviousMode != KernelMode);
|
||||||
|
|
||||||
/* Pass the register parameters to NtCallbackReturn.
|
/* Pass the register parameters to NtCallbackReturn.
|
||||||
Result pointer is in ecx, result length in edx, status in eax */
|
Result pointer is in ecx, result length in edx, status in eax */
|
||||||
|
|
|
@ -793,7 +793,7 @@ NtRequestWaitReplyPort(IN HANDLE PortHandle,
|
||||||
MessageType = LocalLpcRequest.u2.s2.Type;
|
MessageType = LocalLpcRequest.u2.s2.Type;
|
||||||
|
|
||||||
/* Due to the above probe, we know that TotalLength is positive */
|
/* Due to the above probe, we know that TotalLength is positive */
|
||||||
NT_ASSERT(LocalLpcRequest.u1.s1.TotalLength >= 0);
|
ASSERT(LocalLpcRequest.u1.s1.TotalLength >= 0);
|
||||||
|
|
||||||
/* Validate the length */
|
/* Validate the length */
|
||||||
if ((((ULONG)(USHORT)LocalLpcRequest.u1.s1.DataLength + sizeof(PORT_MESSAGE)) >
|
if ((((ULONG)(USHORT)LocalLpcRequest.u1.s1.DataLength + sizeof(PORT_MESSAGE)) >
|
||||||
|
|
|
@ -189,7 +189,7 @@ MiAccessCheck(IN PMMPTE PointerPte,
|
||||||
/* Check if this is a guard page */
|
/* Check if this is a guard page */
|
||||||
if ((ProtectionMask & MM_PROTECT_SPECIAL) == MM_GUARDPAGE)
|
if ((ProtectionMask & MM_PROTECT_SPECIAL) == MM_GUARDPAGE)
|
||||||
{
|
{
|
||||||
NT_ASSERT(ProtectionMask != MM_DECOMMIT);
|
ASSERT(ProtectionMask != MM_DECOMMIT);
|
||||||
|
|
||||||
/* Attached processes can't expand their stack */
|
/* Attached processes can't expand their stack */
|
||||||
if (KeIsAttachedProcess()) return STATUS_ACCESS_VIOLATION;
|
if (KeIsAttachedProcess()) return STATUS_ACCESS_VIOLATION;
|
||||||
|
@ -200,7 +200,7 @@ MiAccessCheck(IN PMMPTE PointerPte,
|
||||||
|
|
||||||
/* Remove the guard page bit, and return a guard page violation */
|
/* Remove the guard page bit, and return a guard page violation */
|
||||||
TempPte.u.Soft.Protection = ProtectionMask & ~MM_GUARDPAGE;
|
TempPte.u.Soft.Protection = ProtectionMask & ~MM_GUARDPAGE;
|
||||||
NT_ASSERT(TempPte.u.Long != 0);
|
ASSERT(TempPte.u.Long != 0);
|
||||||
MI_WRITE_INVALID_PTE(PointerPte, TempPte);
|
MI_WRITE_INVALID_PTE(PointerPte, TempPte);
|
||||||
return STATUS_GUARD_PAGE_VIOLATION;
|
return STATUS_GUARD_PAGE_VIOLATION;
|
||||||
}
|
}
|
||||||
|
@ -1080,7 +1080,7 @@ MiResolveProtoPteFault(IN BOOLEAN StoreInstruction,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* There is no such thing as a decommitted prototype PTE */
|
/* There is no such thing as a decommitted prototype PTE */
|
||||||
NT_ASSERT(TempPte.u.Long != MmDecommittedPte.u.Long);
|
ASSERT(TempPte.u.Long != MmDecommittedPte.u.Long);
|
||||||
|
|
||||||
/* Check for access rights on the PTE proper */
|
/* Check for access rights on the PTE proper */
|
||||||
PteContents = *PointerPte;
|
PteContents = *PointerPte;
|
||||||
|
@ -1420,7 +1420,7 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
|
||||||
/* Resolve */
|
/* Resolve */
|
||||||
Status = MiResolveTransitionFault(Address, PointerPte, Process, LockIrql, &InPageBlock);
|
Status = MiResolveTransitionFault(Address, PointerPte, Process, LockIrql, &InPageBlock);
|
||||||
|
|
||||||
NT_ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
|
|
||||||
/* And now release the lock and leave*/
|
/* And now release the lock and leave*/
|
||||||
KeReleaseQueuedSpinLock(LockQueuePfnLock, LockIrql);
|
KeReleaseQueuedSpinLock(LockQueuePfnLock, LockIrql);
|
||||||
|
@ -2069,7 +2069,7 @@ UserFault:
|
||||||
if ((ProtectionCode & MM_PROTECT_SPECIAL) == MM_GUARDPAGE)
|
if ((ProtectionCode & MM_PROTECT_SPECIAL) == MM_GUARDPAGE)
|
||||||
{
|
{
|
||||||
/* The VAD protection cannot be MM_DECOMMIT! */
|
/* The VAD protection cannot be MM_DECOMMIT! */
|
||||||
NT_ASSERT(ProtectionCode != MM_DECOMMIT);
|
ASSERT(ProtectionCode != MM_DECOMMIT);
|
||||||
|
|
||||||
/* Remove the bit */
|
/* Remove the bit */
|
||||||
TempPte.u.Soft.Protection = ProtectionCode & ~MM_GUARDPAGE;
|
TempPte.u.Soft.Protection = ProtectionCode & ~MM_GUARDPAGE;
|
||||||
|
@ -2185,7 +2185,7 @@ UserFault:
|
||||||
/* Write the prototype PTE */
|
/* Write the prototype PTE */
|
||||||
TempPte = PrototypePte;
|
TempPte = PrototypePte;
|
||||||
TempPte.u.Soft.Protection = ProtectionCode;
|
TempPte.u.Soft.Protection = ProtectionCode;
|
||||||
NT_ASSERT(TempPte.u.Long != 0);
|
ASSERT(TempPte.u.Long != 0);
|
||||||
MI_WRITE_INVALID_PTE(PointerPte, TempPte);
|
MI_WRITE_INVALID_PTE(PointerPte, TempPte);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1121,7 +1121,7 @@ MiMapViewInSystemSpace(IN PVOID Section,
|
||||||
Status = MiSessionCommitPageTables(Base,
|
Status = MiSessionCommitPageTables(Base,
|
||||||
(PVOID)((ULONG_PTR)Base +
|
(PVOID)((ULONG_PTR)Base +
|
||||||
Buckets * MI_SYSTEM_VIEW_BUCKET_SIZE));
|
Buckets * MI_SYSTEM_VIEW_BUCKET_SIZE));
|
||||||
NT_ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the actual prototype PTEs for this mapping */
|
/* Create the actual prototype PTEs for this mapping */
|
||||||
|
|
|
@ -930,7 +930,7 @@ MmAttachSession(
|
||||||
|
|
||||||
/* The parameter is the actual process! */
|
/* The parameter is the actual process! */
|
||||||
EntryProcess = SessionEntry;
|
EntryProcess = SessionEntry;
|
||||||
NT_ASSERT(EntryProcess != NULL);
|
ASSERT(EntryProcess != NULL);
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
||||||
|
@ -998,7 +998,7 @@ MmDetachSession(
|
||||||
|
|
||||||
/* The parameter is the actual process! */
|
/* The parameter is the actual process! */
|
||||||
EntryProcess = SessionEntry;
|
EntryProcess = SessionEntry;
|
||||||
NT_ASSERT(EntryProcess != NULL);
|
ASSERT(EntryProcess != NULL);
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
||||||
|
@ -1039,7 +1039,7 @@ MmQuitNextSession(
|
||||||
|
|
||||||
/* The parameter is the actual process! */
|
/* The parameter is the actual process! */
|
||||||
EntryProcess = SessionEntry;
|
EntryProcess = SessionEntry;
|
||||||
NT_ASSERT(EntryProcess != NULL);
|
ASSERT(EntryProcess != NULL);
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ASSERT(KeGetCurrentIrql () <= APC_LEVEL);
|
ASSERT(KeGetCurrentIrql () <= APC_LEVEL);
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *******************************************************************/
|
/* INCLUDES *******************************************************************/
|
||||||
/* So long, and Thanks for All the Fish */
|
|
||||||
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -431,7 +430,7 @@ MiDeletePte(IN PMMPTE PointerPte,
|
||||||
/* Make the page free. For prototypes, it will be made free when deleting the section object */
|
/* Make the page free. For prototypes, it will be made free when deleting the section object */
|
||||||
if (Pfn1->u2.ShareCount == 0)
|
if (Pfn1->u2.ShareCount == 0)
|
||||||
{
|
{
|
||||||
NT_ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
|
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
|
||||||
|
|
||||||
/* And it should be in standby or modified list */
|
/* And it should be in standby or modified list */
|
||||||
ASSERT((Pfn1->u3.e1.PageLocation == ModifiedPageList) || (Pfn1->u3.e1.PageLocation == StandbyPageList));
|
ASSERT((Pfn1->u3.e1.PageLocation == ModifiedPageList) || (Pfn1->u3.e1.PageLocation == StandbyPageList));
|
||||||
|
@ -1887,7 +1886,7 @@ MiQueryMemoryBasicInformation(IN HANDLE ProcessHandle,
|
||||||
{
|
{
|
||||||
DPRINT1("MmQuerySectionView failed. MemoryArea=%p (%p-%p), BaseAddress=%p\n",
|
DPRINT1("MmQuerySectionView failed. MemoryArea=%p (%p-%p), BaseAddress=%p\n",
|
||||||
MemoryArea, MA_GetStartingAddress(MemoryArea), MA_GetEndingAddress(MemoryArea), BaseAddress);
|
MemoryArea, MA_GetStartingAddress(MemoryArea), MA_GetEndingAddress(MemoryArea), BaseAddress);
|
||||||
NT_ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4856,7 +4855,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
//
|
//
|
||||||
TempPte.u.Long = 0;
|
TempPte.u.Long = 0;
|
||||||
TempPte.u.Soft.Protection = ProtectionMask;
|
TempPte.u.Soft.Protection = ProtectionMask;
|
||||||
NT_ASSERT(TempPte.u.Long != 0);
|
ASSERT(TempPte.u.Long != 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the PTE, PDE and the last PTE for this address range
|
// Get the PTE, PDE and the last PTE for this address range
|
||||||
|
|
|
@ -301,14 +301,14 @@ MmGetPageFileMapping(
|
||||||
PVOID Address,
|
PVOID Address,
|
||||||
SWAPENTRY* SwapEntry)
|
SWAPENTRY* SwapEntry)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
MmIsDisabledPage(PEPROCESS Process, PVOID Address)
|
MmIsDisabledPage(PEPROCESS Process, PVOID Address)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,6 +317,6 @@ NTAPI
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
MiInitializeSessionSpaceLayout(VOID)
|
MiInitializeSessionSpaceLayout(VOID)
|
||||||
{
|
{
|
||||||
NT_ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1245,7 +1245,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
|
||||||
/* Set the index and the entry into the object type array */
|
/* Set the index and the entry into the object type array */
|
||||||
LocalObjectType->Index = ObpTypeObjectType->TotalNumberOfObjects;
|
LocalObjectType->Index = ObpTypeObjectType->TotalNumberOfObjects;
|
||||||
|
|
||||||
NT_ASSERT(LocalObjectType->Index != 0);
|
ASSERT(LocalObjectType->Index != 0);
|
||||||
|
|
||||||
if (LocalObjectType->Index < 32)
|
if (LocalObjectType->Index < 32)
|
||||||
{
|
{
|
||||||
|
|
|
@ -465,7 +465,7 @@ SeFastTraverseCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
NT_ASSERT(AccessMode != KernelMode);
|
ASSERT(AccessMode != KernelMode);
|
||||||
|
|
||||||
if (SecurityDescriptor == NULL)
|
if (SecurityDescriptor == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -439,10 +439,10 @@ SepPropagateAcl(
|
||||||
PSID Sid;
|
PSID Sid;
|
||||||
BOOLEAN WriteTwoAces;
|
BOOLEAN WriteTwoAces;
|
||||||
|
|
||||||
NT_ASSERT(RtlValidAcl(AclSource));
|
ASSERT(RtlValidAcl(AclSource));
|
||||||
NT_ASSERT(AclSource->AclSize % sizeof(ULONG) == 0);
|
ASSERT(AclSource->AclSize % sizeof(ULONG) == 0);
|
||||||
NT_ASSERT(AclSource->Sbz1 == 0);
|
ASSERT(AclSource->Sbz1 == 0);
|
||||||
NT_ASSERT(AclSource->Sbz2 == 0);
|
ASSERT(AclSource->Sbz2 == 0);
|
||||||
|
|
||||||
Written = 0;
|
Written = 0;
|
||||||
if (*AclLength >= Written + sizeof(ACL))
|
if (*AclLength >= Written + sizeof(ACL))
|
||||||
|
@ -457,18 +457,18 @@ SepPropagateAcl(
|
||||||
CurrentSource = (PUCHAR)(AclSource + 1);
|
CurrentSource = (PUCHAR)(AclSource + 1);
|
||||||
for (i = 0; i < AclSource->AceCount; i++)
|
for (i = 0; i < AclSource->AceCount; i++)
|
||||||
{
|
{
|
||||||
NT_ASSERT((ULONG_PTR)CurrentDest % sizeof(ULONG) == 0);
|
ASSERT((ULONG_PTR)CurrentDest % sizeof(ULONG) == 0);
|
||||||
NT_ASSERT((ULONG_PTR)CurrentSource % sizeof(ULONG) == 0);
|
ASSERT((ULONG_PTR)CurrentSource % sizeof(ULONG) == 0);
|
||||||
AceDest = (PACCESS_ALLOWED_ACE)CurrentDest;
|
AceDest = (PACCESS_ALLOWED_ACE)CurrentDest;
|
||||||
AceSource = (PACCESS_ALLOWED_ACE)CurrentSource;
|
AceSource = (PACCESS_ALLOWED_ACE)CurrentSource;
|
||||||
|
|
||||||
/* These all have the same structure */
|
/* These all have the same structure */
|
||||||
NT_ASSERT(AceSource->Header.AceType == ACCESS_ALLOWED_ACE_TYPE ||
|
ASSERT(AceSource->Header.AceType == ACCESS_ALLOWED_ACE_TYPE ||
|
||||||
AceSource->Header.AceType == ACCESS_DENIED_ACE_TYPE ||
|
AceSource->Header.AceType == ACCESS_DENIED_ACE_TYPE ||
|
||||||
AceSource->Header.AceType == SYSTEM_AUDIT_ACE_TYPE);
|
AceSource->Header.AceType == SYSTEM_AUDIT_ACE_TYPE);
|
||||||
|
|
||||||
NT_ASSERT(AceSource->Header.AceSize % sizeof(ULONG) == 0);
|
ASSERT(AceSource->Header.AceSize % sizeof(ULONG) == 0);
|
||||||
NT_ASSERT(AceSource->Header.AceSize >= sizeof(*AceSource));
|
ASSERT(AceSource->Header.AceSize >= sizeof(*AceSource));
|
||||||
if (!SepShouldPropagateAce(AceSource->Header.AceFlags,
|
if (!SepShouldPropagateAce(AceSource->Header.AceFlags,
|
||||||
&AceFlags,
|
&AceFlags,
|
||||||
IsInherited,
|
IsInherited,
|
||||||
|
@ -482,7 +482,7 @@ SepPropagateAcl(
|
||||||
AceSize = AceSource->Header.AceSize;
|
AceSize = AceSource->Header.AceSize;
|
||||||
Mask = AceSource->Mask;
|
Mask = AceSource->Mask;
|
||||||
Sid = (PSID)&AceSource->SidStart;
|
Sid = (PSID)&AceSource->SidStart;
|
||||||
NT_ASSERT(AceSize >= FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + RtlLengthSid(Sid));
|
ASSERT(AceSize >= FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + RtlLengthSid(Sid));
|
||||||
|
|
||||||
WriteTwoAces = FALSE;
|
WriteTwoAces = FALSE;
|
||||||
/* Map effective ACE to specific rights */
|
/* Map effective ACE to specific rights */
|
||||||
|
@ -598,7 +598,7 @@ SepSelectAcl(
|
||||||
*IsInherited,
|
*IsInherited,
|
||||||
IsDirectoryObject,
|
IsDirectoryObject,
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
NT_ASSERT(Status == STATUS_BUFFER_TOO_SMALL);
|
ASSERT(Status == STATUS_BUFFER_TOO_SMALL);
|
||||||
|
|
||||||
/* Use the parent ACL only if it's not empty */
|
/* Use the parent ACL only if it's not empty */
|
||||||
if (*AclLength != sizeof(ACL))
|
if (*AclLength != sizeof(ACL))
|
||||||
|
@ -633,7 +633,7 @@ SepSelectAcl(
|
||||||
*IsInherited,
|
*IsInherited,
|
||||||
IsDirectoryObject,
|
IsDirectoryObject,
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
NT_ASSERT(Status == STATUS_BUFFER_TOO_SMALL);
|
ASSERT(Status == STATUS_BUFFER_TOO_SMALL);
|
||||||
}
|
}
|
||||||
return Acl;
|
return Acl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -644,7 +644,7 @@ SepAccessCheckAndAuditAlarm(
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* Loop all result entries (only 1 when no list was requested) */
|
/* Loop all result entries (only 1 when no list was requested) */
|
||||||
NT_ASSERT(UseResultList || (ResultListLength == 1));
|
ASSERT(UseResultList || (ResultListLength == 1));
|
||||||
for (i = 0; i < ResultListLength; i++)
|
for (i = 0; i < ResultListLength; i++)
|
||||||
{
|
{
|
||||||
AccessStatusList[i] = SafeAccessStatusList[i];
|
AccessStatusList[i] = SafeAccessStatusList[i];
|
||||||
|
|
|
@ -129,7 +129,7 @@ SepPrivilegeCheck(PTOKEN Token,
|
||||||
SepReleaseTokenLock(Token);
|
SepReleaseTokenLock(Token);
|
||||||
|
|
||||||
/* When we reached this point, we did not find all privileges */
|
/* When we reached this point, we did not find all privileges */
|
||||||
NT_ASSERT(Required > 0);
|
ASSERT(Required > 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -864,7 +864,7 @@ SeSetSecurityDescriptorInfoEx(
|
||||||
Control |= (ObjectSd->Control & SE_OWNER_DEFAULTED);
|
Control |= (ObjectSd->Control & SE_OWNER_DEFAULTED);
|
||||||
}
|
}
|
||||||
OwnerLength = Owner ? RtlLengthSid(Owner) : 0;
|
OwnerLength = Owner ? RtlLengthSid(Owner) : 0;
|
||||||
NT_ASSERT(OwnerLength % sizeof(ULONG) == 0);
|
ASSERT(OwnerLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Get group and group size */
|
/* Get group and group size */
|
||||||
if (SecurityInformation & GROUP_SECURITY_INFORMATION)
|
if (SecurityInformation & GROUP_SECURITY_INFORMATION)
|
||||||
|
@ -878,7 +878,7 @@ SeSetSecurityDescriptorInfoEx(
|
||||||
Control |= (ObjectSd->Control & SE_GROUP_DEFAULTED);
|
Control |= (ObjectSd->Control & SE_GROUP_DEFAULTED);
|
||||||
}
|
}
|
||||||
GroupLength = Group ? RtlLengthSid(Group) : 0;
|
GroupLength = Group ? RtlLengthSid(Group) : 0;
|
||||||
NT_ASSERT(GroupLength % sizeof(ULONG) == 0);
|
ASSERT(GroupLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Get DACL and DACL size */
|
/* Get DACL and DACL size */
|
||||||
if (SecurityInformation & DACL_SECURITY_INFORMATION)
|
if (SecurityInformation & DACL_SECURITY_INFORMATION)
|
||||||
|
@ -1211,7 +1211,7 @@ SeAssignSecurityEx(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OwnerLength = RtlLengthSid(Owner);
|
OwnerLength = RtlLengthSid(Owner);
|
||||||
NT_ASSERT(OwnerLength % sizeof(ULONG) == 0);
|
ASSERT(OwnerLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Inherit the Group SID */
|
/* Inherit the Group SID */
|
||||||
if (ExplicitDescriptor != NULL)
|
if (ExplicitDescriptor != NULL)
|
||||||
|
@ -1248,7 +1248,7 @@ SeAssignSecurityEx(
|
||||||
return STATUS_INVALID_PRIMARY_GROUP;
|
return STATUS_INVALID_PRIMARY_GROUP;
|
||||||
}
|
}
|
||||||
GroupLength = RtlLengthSid(Group);
|
GroupLength = RtlLengthSid(Group);
|
||||||
NT_ASSERT(GroupLength % sizeof(ULONG) == 0);
|
ASSERT(GroupLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Inherit the DACL */
|
/* Inherit the DACL */
|
||||||
DaclLength = 0;
|
DaclLength = 0;
|
||||||
|
@ -1283,7 +1283,7 @@ SeAssignSecurityEx(
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
if (DaclPresent)
|
if (DaclPresent)
|
||||||
Control |= SE_DACL_PRESENT;
|
Control |= SE_DACL_PRESENT;
|
||||||
NT_ASSERT(DaclLength % sizeof(ULONG) == 0);
|
ASSERT(DaclLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Inherit the SACL */
|
/* Inherit the SACL */
|
||||||
SaclLength = 0;
|
SaclLength = 0;
|
||||||
|
@ -1318,7 +1318,7 @@ SeAssignSecurityEx(
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
if (SaclPresent)
|
if (SaclPresent)
|
||||||
Control |= SE_SACL_PRESENT;
|
Control |= SE_SACL_PRESENT;
|
||||||
NT_ASSERT(SaclLength % sizeof(ULONG) == 0);
|
ASSERT(SaclLength % sizeof(ULONG) == 0);
|
||||||
|
|
||||||
/* Allocate and initialize the new security descriptor */
|
/* Allocate and initialize the new security descriptor */
|
||||||
Length = sizeof(SECURITY_DESCRIPTOR_RELATIVE) +
|
Length = sizeof(SECURITY_DESCRIPTOR_RELATIVE) +
|
||||||
|
@ -1356,7 +1356,7 @@ SeAssignSecurityEx(
|
||||||
SaclIsInherited,
|
SaclIsInherited,
|
||||||
IsDirectoryObject,
|
IsDirectoryObject,
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
NT_ASSERT(Status == STATUS_SUCCESS);
|
ASSERT(Status == STATUS_SUCCESS);
|
||||||
Descriptor->Sacl = Current;
|
Descriptor->Sacl = Current;
|
||||||
Current += SaclLength;
|
Current += SaclLength;
|
||||||
}
|
}
|
||||||
|
@ -1371,7 +1371,7 @@ SeAssignSecurityEx(
|
||||||
DaclIsInherited,
|
DaclIsInherited,
|
||||||
IsDirectoryObject,
|
IsDirectoryObject,
|
||||||
GenericMapping);
|
GenericMapping);
|
||||||
NT_ASSERT(Status == STATUS_SUCCESS);
|
ASSERT(Status == STATUS_SUCCESS);
|
||||||
Descriptor->Dacl = Current;
|
Descriptor->Dacl = Current;
|
||||||
Current += DaclLength;
|
Current += DaclLength;
|
||||||
}
|
}
|
||||||
|
|
|
@ -499,8 +499,8 @@ SeCaptureSidAndAttributesArray(
|
||||||
RtlCopyMemory(CurrentDest, SrcSidAndAttributes[i].Sid, SidLength);
|
RtlCopyMemory(CurrentDest, SrcSidAndAttributes[i].Sid, SidLength);
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
NT_ASSERT(RtlLengthSid(SidAndAttributes[i].Sid) == SidLength);
|
ASSERT(RtlLengthSid(SidAndAttributes[i].Sid) == SidLength);
|
||||||
NT_ASSERT(RtlValidSid(SidAndAttributes[i].Sid));
|
ASSERT(RtlValidSid(SidAndAttributes[i].Sid));
|
||||||
|
|
||||||
/* Update the current destination address */
|
/* Update the current destination address */
|
||||||
CurrentDest += ALIGN_UP_BY(SidLength, sizeof(ULONG));
|
CurrentDest += ALIGN_UP_BY(SidLength, sizeof(ULONG));
|
||||||
|
|
|
@ -125,7 +125,7 @@ WmipCaptureGuidObjectAttributes(
|
||||||
_Out_ PWSTR ObjectNameBuffer,
|
_Out_ PWSTR ObjectNameBuffer,
|
||||||
_In_ KPROCESSOR_MODE AccessMode)
|
_In_ KPROCESSOR_MODE AccessMode)
|
||||||
{
|
{
|
||||||
NT_ASSERT(AccessMode != KernelMode);
|
ASSERT(AccessMode != KernelMode);
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue