mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
Fix other _SEH2_YIELD() issues, spotted for most of them by Pigglesworth, the other by myself.
I'm wondering how much remaining ones are in our code. Only the Lord knows... svn path=/trunk/; revision=60053
This commit is contained in:
parent
7af0cfc398
commit
e1e93ee7dd
8 changed files with 32 additions and 32 deletions
|
@ -96,14 +96,14 @@ DetectVMware(int *Version)
|
|||
}
|
||||
#elif defined(_MSC_VER) && defined(_M_AMD64)
|
||||
DPRINT1("DetectVMware stub\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
#else
|
||||
#error TODO
|
||||
#endif
|
||||
}
|
||||
_SEH2_EXCEPT(_SEH2_GetExceptionCode() == EXCEPTION_PRIV_INSTRUCTION ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
|
||||
{
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
|
@ -2838,7 +2838,7 @@ retry:
|
|||
|
||||
DebugPrint((1, "ClassSendSrbSynchronous: Exception %lx "
|
||||
"locking buffer\n", status));
|
||||
return status;
|
||||
_SEH2_YIELD(return status);
|
||||
} _SEH2_END;
|
||||
}
|
||||
|
||||
|
|
|
@ -846,21 +846,21 @@ RtlValidAcl(IN PACL Acl)
|
|||
(Acl->AclRevision > MAX_ACL_REVISION))
|
||||
{
|
||||
DPRINT1("Invalid ACL revision\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Next, validate that the ACL is USHORT-aligned */
|
||||
if (ROUND_DOWN(Acl->AclSize, sizeof(USHORT)) != Acl->AclSize)
|
||||
{
|
||||
DPRINT1("Invalid ACL size\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* And that it's big enough */
|
||||
if (Acl->AclSize < sizeof(ACL))
|
||||
{
|
||||
DPRINT1("Invalid ACL size\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Loop each ACE */
|
||||
|
@ -871,21 +871,21 @@ RtlValidAcl(IN PACL Acl)
|
|||
if (((ULONG_PTR)Ace + sizeof(ACE_HEADER)) >= ((ULONG_PTR)Acl + Acl->AclSize))
|
||||
{
|
||||
DPRINT1("Invalid ACE size\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Validate the length of this ACE */
|
||||
if (ROUND_DOWN(Ace->AceSize, sizeof(USHORT)) != Ace->AceSize)
|
||||
{
|
||||
DPRINT1("Invalid ACE size: %lx\n", Ace->AceSize);
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Validate we have space for the entire ACE */
|
||||
if (((ULONG_PTR)Ace + Ace->AceSize) > ((ULONG_PTR)Acl + Acl->AclSize))
|
||||
{
|
||||
DPRINT1("Invalid ACE size %lx %lx\n", Ace->AceSize, Acl->AclSize);
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Check what kind of ACE this is */
|
||||
|
@ -895,14 +895,14 @@ RtlValidAcl(IN PACL Acl)
|
|||
if (ROUND_DOWN(Ace->AceSize, sizeof(ULONG)) != Ace->AceSize)
|
||||
{
|
||||
DPRINT1("Invalid ACE size\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* The ACE size should at least have enough for the header */
|
||||
if (Ace->AceSize < sizeof(ACE_HEADER))
|
||||
{
|
||||
DPRINT1("Invalid ACE size: %lx %lx\n", Ace->AceSize, sizeof(ACE_HEADER));
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Check if the SID revision is valid */
|
||||
|
@ -910,21 +910,21 @@ RtlValidAcl(IN PACL Acl)
|
|||
if (Sid->Revision != SID_REVISION)
|
||||
{
|
||||
DPRINT1("Invalid SID\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* Check if the SID is out of bounds */
|
||||
if (Sid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES)
|
||||
{
|
||||
DPRINT1("Invalid SID\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
|
||||
/* The ACE size should at least have enough for the header and SID */
|
||||
if (Ace->AceSize < (sizeof(ACE_HEADER) + RtlLengthSid(Sid)))
|
||||
{
|
||||
DPRINT1("Invalid ACE size\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
}
|
||||
else if (Ace->AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE)
|
||||
|
@ -942,7 +942,7 @@ RtlValidAcl(IN PACL Acl)
|
|||
if (Ace->AceSize < sizeof(ACE_HEADER))
|
||||
{
|
||||
DPRINT1("Unknown ACE\n");
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -953,7 +953,7 @@ RtlValidAcl(IN PACL Acl)
|
|||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Something was invalid, fail */
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
|
@ -1587,7 +1587,7 @@ static NTSTATUS parse_manifest( struct actctx_loader* acl, struct assembly_ident
|
|||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
DPRINT1("Exception accessing buffer\n");
|
||||
return STATUS_SXS_CANT_GEN_ACTCTX;
|
||||
_SEH2_YIELD(return STATUS_SXS_CANT_GEN_ACTCTX);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
|
@ -1062,28 +1062,28 @@ RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
|
|||
_SEH2_TRY
|
||||
{
|
||||
/* Fail on bad revisions */
|
||||
if (Sd->Revision != SECURITY_DESCRIPTOR_REVISION) return FALSE;
|
||||
if (Sd->Revision != SECURITY_DESCRIPTOR_REVISION) _SEH2_YIELD(return FALSE);
|
||||
|
||||
/* Owner SID must be valid if present */
|
||||
Owner = SepGetOwnerFromDescriptor(Sd);
|
||||
if ((Owner) && (!RtlValidSid(Owner))) return FALSE;
|
||||
if ((Owner) && (!RtlValidSid(Owner))) _SEH2_YIELD(return FALSE);
|
||||
|
||||
/* Group SID must be valid if present */
|
||||
Group = SepGetGroupFromDescriptor(Sd);
|
||||
if ((Owner) && (!RtlValidSid(Group))) return FALSE;
|
||||
if ((Owner) && (!RtlValidSid(Group))) _SEH2_YIELD(return FALSE);
|
||||
|
||||
/* DACL must be valid if present */
|
||||
Dacl = SepGetDaclFromDescriptor(Sd);
|
||||
if ((Dacl) && (!RtlValidAcl(Dacl))) return FALSE;
|
||||
if ((Dacl) && (!RtlValidAcl(Dacl))) _SEH2_YIELD(return FALSE);
|
||||
|
||||
/* SACL must be valid if present */
|
||||
Sacl = SepGetSaclFromDescriptor(Sd);
|
||||
if ((Sacl) && (!RtlValidAcl(Sacl))) return FALSE;
|
||||
if ((Sacl) && (!RtlValidAcl(Sacl))) _SEH2_YIELD(return FALSE);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Access fault, bail out */
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ RtlValidSid(IN PSID Sid_)
|
|||
(Sid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES)))
|
||||
{
|
||||
/* It's not, fail */
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Access violation, SID is not valid */
|
||||
return FALSE;
|
||||
_SEH2_YIELD(return FALSE);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
|
@ -883,7 +883,7 @@ MiDoMappedCopy(IN PEPROCESS SourceProcess,
|
|||
//
|
||||
// Return the error
|
||||
//
|
||||
return STATUS_WORKING_SET_QUOTA;
|
||||
_SEH2_YIELD(return STATUS_WORKING_SET_QUOTA);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -3343,7 +3343,7 @@ NtGetWriteWatch(IN HANDLE ProcessHandle,
|
|||
//
|
||||
// Catch illegal base address
|
||||
//
|
||||
if (BaseAddress > MM_HIGHEST_USER_ADDRESS) return STATUS_INVALID_PARAMETER_2;
|
||||
if (BaseAddress > MM_HIGHEST_USER_ADDRESS) _SEH2_YIELD(return STATUS_INVALID_PARAMETER_2);
|
||||
|
||||
//
|
||||
// Catch illegal region size
|
||||
|
@ -3353,7 +3353,7 @@ NtGetWriteWatch(IN HANDLE ProcessHandle,
|
|||
//
|
||||
// Fail
|
||||
//
|
||||
return STATUS_INVALID_PARAMETER_3;
|
||||
_SEH2_YIELD(return STATUS_INVALID_PARAMETER_3);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -3370,7 +3370,7 @@ NtGetWriteWatch(IN HANDLE ProcessHandle,
|
|||
//
|
||||
// Must have a count
|
||||
//
|
||||
if (CapturedEntryCount == 0) return STATUS_INVALID_PARAMETER_5;
|
||||
if (CapturedEntryCount == 0) _SEH2_YIELD(return STATUS_INVALID_PARAMETER_5);
|
||||
|
||||
//
|
||||
// Can't be larger than the maximum
|
||||
|
@ -3380,7 +3380,7 @@ NtGetWriteWatch(IN HANDLE ProcessHandle,
|
|||
//
|
||||
// Fail
|
||||
//
|
||||
return STATUS_INVALID_PARAMETER_5;
|
||||
_SEH2_YIELD(return STATUS_INVALID_PARAMETER_5);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -67,7 +67,7 @@ CharLowerA(LPSTR str)
|
|||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return NULL;
|
||||
_SEH2_YIELD(return NULL);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
@ -267,7 +267,7 @@ LPSTR WINAPI CharUpperA(LPSTR str)
|
|||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return NULL;
|
||||
_SEH2_YIELD(return NULL);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
|
|
Loading…
Reference in a new issue