RtlpValidAttribute
UINT8 __fastcall RtlpValidAttribute(_CLAIM_SECURITY_ATTRIBUTE_V1 *Attribute){
const wchar_t *Name;
__int64 v3;
ULONG ValueCount;
PLONG64 pInt64;
USHORT ValueType;
ULONG v7;
int v8;
unsigned int v10;
int v11;
size_t pcchLength;
pcchLength = 0i64;
if( !Attribute )
return 0;
Name = Attribute->Name;
if( !Name )
return 0;
if( RtlStringCchLengthW(Name, 0xFFFFui64, &pcchLength) < 0 )
return 0;
if( pcchLength == v3 )
return 0;
if( Attribute->Reserved != (_WORD)v3 )
return 0;
if( (Attribute->Flags & 0xFFC0) != 0 )
return 0;
ValueCount = Attribute->ValueCount;
if( !ValueCount )
return 0;
pInt64 = Attribute->Values.pInt64;
if( !pInt64 )
return 0;
ValueType = Attribute->ValueType;
if( !ValueType )
return 0;
if( ValueType > 2u )
{
switch( ValueType )
{
case 3u:
v11 = v3;
while( pInt64[v11] != v3 )
{
if( ++v11 >= ValueCount )
return 1;
}
break;
case 5u:
v10 = v3;
while( pInt64[2 * v10] != v3 && LODWORD(pInt64[2 * v10 + 1]) != (_DWORD)v3 )
{
if( ++v10 >= ValueCount )
return 1;
}
break;
case 6u:
while( (unsigned __int64)pInt64[(unsigned int)v3] <= 1 )
{
LODWORD(v3) = v3 + 1;
if( (unsigned int)v3 >= ValueCount )
return 1;
}
break;
case 0x10u:
v7 = v3;
do
{
v8 = pInt64[2 * v7 + 1];
if( pInt64[2 * v7] == v3 )
{
if( v8 )
return 0;
}
else if( !v8 )
{
return 0;
}
++v7;
}
while( v7 < ValueCount );
return 1;
}
return 0;
}
return 1;
}Referenced by:
RtlpValidAttributeInfo