PnpRegQueryValueIndirect
__int64 __fastcall PnpRegQueryValueIndirect(
UINT64 a1,
VOID *a2,
const wchar_t *a3,
unsigned int *a4,
unsigned __int64 a5,
__int64 a6,
bool *a7){
VOID *v7;
unsigned int *v9;
VOID **PoolWithTag;
bool *v13;
unsigned int Value;
unsigned int v15;
unsigned int v17;
unsigned int v18;
int v19;
UINT64 pcbLength;
pcbLength = a1;
v7 = (VOID *)a5;
v9 = (unsigned int *)a6;
PoolWithTag = 0i64;
if( a5 )
v7 = (VOID *)(-(__int64)(*(_DWORD *)a6 != 0) & a5);
else
*(_DWORD *)a6 = 0;
v13 = a7;
if( a7 )
*a7 = 0;
*a4 = 0;
Value = RegRtlQueryValue(a2, a3, a4, v7, (__int64)v9);
v15 = Value;
if( Value && Value != -1073741789 || !v13 )
return v15;
v17 = *a4;
if( *a4 > 3 )
{
if( v17 <= 6 )
goto LABEL_21;
if( v17 != 7 )
{
if( v17 - 8 > 3 )
{
*v13 = (_WORD)v17 == 25;
return v15;
}
LABEL_21:
*v13 = 0;
return v15;
}
}
v18 = *v9;
if( Value )
{
if( v18 <= 0xFFFE )
{
while( 1 )
{
if( PoolWithTag )
ExFreePoolWithTag(PoolWithTag, 0);
PoolWithTag = ExAllocatePoolWithTag(1ui64, v18, 1380994640i64);
if( !PoolWithTag )
break;
LODWORD(pcbLength) = v18;
v19 = RegRtlQueryValue(a2, a3, 0i64, PoolWithTag, (__int64)&pcbLength);
if( v19 != -1073741789 )
goto LABEL_32;
if( (unsigned int)pcbLength <= v18 )
{
v19 = -1073741595;
LABEL_32:
if( v19 )
goto LABEL_19;
v7 = PoolWithTag;
goto LABEL_16;
}
v18 = pcbLength;
if( (unsigned int)pcbLength > 0xFFFE )
goto LABEL_19;
}
}
}
else
{
LABEL_16:
if( RtlStringCbLengthW((WCHAR *)v7, v18, &pcbLength) >= 0
&& (PnpParseIndirectInfString((const wchar_t *)v7) || PnpParseIndirectResourceString((__int64)v7)) )
{
*v13 = 1;
}
LABEL_19:
if( PoolWithTag )
ExFreePoolWithTag(PoolWithTag, 0);
}
return v15;
}Referenced by:
No references.