PiSwDeviceMakeCompatibleIds
INT64 __fastcall PiSwDeviceMakeCompatibleIds(INT64 a1, CHAR **a2){
const wchar_t *v2;
unsigned int v3;
__int64 v6;
__int64 v7;
__int64 v8;
__int64 v9;
CHAR *PoolWithTag;
CHAR *v11;
UINT8 *v12;
CHAR *v13;
__int64 v14;
__int64 v15;
INT64 result;
v2 = *(const wchar_t **)(a1 + 32);
v3 = 0;
v6 = 0i64;
if( v2 )
{
while( *v2 )
{
v7 = -1i64;
do
++v7;
while( v2[v7] );
v8 = v7 + 1;
if( wcsicmp(v2, L"SWD\\GenericRaw") && wcsicmp(v2, L"SWD\\Generic") )
v6 += 2 * v8;
v2 += v8;
}
}
v9 = v6 + 30;
if( (*(_DWORD *)(a1 + 64) & 8) != 0 )
v9 = v6;
PoolWithTag = (CHAR *)ExAllocatePoolWithTag(PagedPool, v9 + 26, 0x57706E50ui64);
v11 = PoolWithTag;
if( PoolWithTag )
{
v12 = *(UINT8 **)(a1 + 32);
v13 = PoolWithTag;
if( v12 )
{
while( *(_WORD *)v12 )
{
v14 = -1i64;
do
++v14;
while( *(_WORD *)&v12[2 * v14] );
v15 = v14 + 1;
if( wcsicmp((const wchar_t *)v12, L"SWD\\GenericRaw") && wcsicmp((const wchar_t *)v12, L"SWD\\Generic") )
{
memmove((UINT8 *)v13, v12, 2 * v15);
v13 += 2 * v15;
}
v12 += 2 * v15;
}
}
if( (*(_DWORD *)(a1 + 64) & 8) == 0 )
{
*(_OWORD *)v13 = *(_OWORD *)L"SWD\\GenericRaw";
*((_QWORD *)v13 + 2) = *(_QWORD *)L"ricRaw";
*((_DWORD *)v13 + 6) = *(_DWORD *)L"aw";
*((_WORD *)v13 + 14) = PiSwGenericRawCompatibleId[14];
v13 += 30;
}
*(_OWORD *)v13 = *(_OWORD *)L"SWD\\Generic";
*((_QWORD *)v13 + 2) = *(_QWORD *)L"ric";
*((_WORD *)v13 + 12) = 0;
}
else
{
v3 = -1073741670;
}
result = v3;
*a2 = v11;
return result;
}Referenced by:
PiSwPdoPnPDispatch