PipAddRequestToEdge
NTSTATUS __fastcall PipAddRequestToEdge(_PNP_DEPENDENCY_EDGE *TargetEdge, _UNICODE_STRING **a2){
_QWORD *v2;
_PNP_DEPENDENCY_EDGE *v3;
_PNP_DEPENDENCY_EDGE *v4;
__int64 v5;
_PNP_DEPENDENCY_EDGE *v8;
_PNP_DEPENDENCY_EDGE *v9;
_PNP_DEPENDENCY_EDGE v10;
VOID **PoolWithTag;
int v12;
VOID **v13;
_PNP_DEPENDENCY_EDGE **v14;
v2 = 0i64;
v3 = TargetEdge + 14;
v4 = (_PNP_DEPENDENCY_EDGE *)*((_QWORD *)TargetEdge + 7);
v5 = 0i64;
while( v4 != v3 )
{
v8 = v4;
if( v5 )
goto LABEL_11;
v9 = v4;
v4 = *(_PNP_DEPENDENCY_EDGE **)v4;
v10 = v9[4];
if( v10 == *(_DWORD *)a2 )
{
if( v10 )
{
if( v10 == 1 )
v5 = (unsigned __int64)v8 & -(__int64)((unsigned __int8)RtlEqualUnicodeString(
*((PCUNICODE_STRING *)v9 + 3),
a2[1],
0) != 0);
}
else if( *((_UNICODE_STRING **)v9 + 3) == a2[1] )
{
v5 = (__int64)v9;
}
}
}
if( v5 )
{
LABEL_11:
*(_DWORD *)(v5 + 32) |= *((_DWORD *)a2 + 4);
goto LABEL_21;
}
PoolWithTag = ExAllocatePoolWithTag(1ui64, 0x28ui64, 1399877200i64);
v2 = PoolWithTag;
if( PoolWithTag )
{
*((_DWORD *)PoolWithTag + 8) = *((_DWORD *)a2 + 4);
v12 = *(_DWORD *)a2;
*((_DWORD *)v2 + 4) = *(_DWORD *)a2;
if( v12 )
{
if( v12 == 1 )
{
v13 = ExAllocatePoolWithTag(1ui64, 0x10ui64, 1399877200i64);
v2[3] = v13;
if( RtlDuplicateUnicodeString(0i64, a2[1], (_UNICODE_STRING *)v13) < 0 )
{
PipFreeBindingRequestEntry(v2);
v2 = 0i64;
goto LABEL_21;
}
}
}
else
{
v2[3] = a2[1];
}
v14 = (_PNP_DEPENDENCY_EDGE **)*((_QWORD *)v3 + 1);
if( *v14 != v3 )
__fastfail(3u);
*v2 = v3;
v2[1] = v14;
*v14 = (_PNP_DEPENDENCY_EDGE *)v2;
*((_QWORD *)v3 + 1) = v2;
}
LABEL_21:
if( !v5 )
v5 = (__int64)v2;
if( v5 )
PipMergeDependencyTypes(TargetEdge, *((unsigned int *)a2 + 4));
return v5;
}Referenced by:
PipAddDependencyEdgeBetweenNodes
PipCreateNewDependencyEdge
PipMergeDependencyEdgeList