PiPnpRtlServiceFilterCallback
CHAR __fastcall PiPnpRtlServiceFilterCallback(INT64 a1, WCHAR *a2, UINT64 a3, INT64 a4){
CHAR v7;
UNICODE_STRING *v8;
VOID *i;
int DeviceRegProp;
unsigned int v11;
__int64 *v12;
__int64 v13;
WCHAR *v14;
int ObjectProperty;
unsigned int v17;
WCHAR *v18;
__int64 v19;
void *v20;
VOID *PoolWithTag;
void *v22;
int v23;
__int64(__fastcall *v24)(INT64, WCHAR *, _QWORD, _QWORD);
int v25;
char v26[4];
SIZE_T NumberOfBytes;
SIZE_T v28;
unsigned int v29;
struct _UNICODE_STRING DestinationString;
_WORD result[38];
__int16 v32;
v29 = a3;
memset((INT64)result, 0i64);
v7 = 0;
DestinationString = 0i64;
v26[0] = 0;
NumberOfBytes = 0i64;
v28 = 0i64;
if( !*(_BYTE *)(a4 + 8) || (int)CmIsDevicePresent(a1, a2, v26) >= 0 && v26[0] )
{
v8 = *(UNICODE_STRING **)a4;
if( *(_QWORD *)a4 && v8->Length >= 2u && *v8->Buffer )
{
for( i = *(VOID **)(a4 + 16); ; *(_QWORD *)(a4 + 16) = i )
{
LODWORD(NumberOfBytes) = *(_DWORD *)(a4 + 24);
DeviceRegProp = CmGetDeviceRegProp(
a1,
a2,
0i64,
5,
(__int64)&NumberOfBytes + 4,
(__int64)i,
(__int64)&NumberOfBytes,
0);
if( !DeviceRegProp && (unsigned int)NumberOfBytes < 2 )
break;
if( DeviceRegProp != -1073741789 )
goto LABEL_9;
if( (unsigned int)NumberOfBytes < 2 )
break;
i = ExAllocatePoolWithTag(PagedPool, (unsigned int)NumberOfBytes, 0x47706E50ui64);
if( !i )
{
DeviceRegProp = -1073741670;
LABEL_9:
if( !DeviceRegProp )
{
*(_WORD *)(*(_QWORD *)(a4 + 16) + 2 * ((unsigned __int64)*(unsigned int *)(a4 + 24) >> 1) - 2) = 0;
if( (int)RtlInitUnicodeStringEx(&DestinationString, *(WCHAR **)(a4 + 16)) >= 0 )
{
if( RtlEqualUnicodeString(*(UNICODE_STRING **)a4, &DestinationString, 1u) )
{
v7 = 1;
goto LABEL_53;
}
}
}
break;
}
v20 = *(void **)(a4 + 16);
if( v20 )
ExFreePoolWithTag(v20, 0);
*(_DWORD *)(a4 + 24) = NumberOfBytes;
}
v11 = 0;
v12 = &qword_140007AB8;
while( 2 )
{
if( *(_DWORD *)v12 != 2 || result[0] )
{
while( 1 )
{
LABEL_19:
v13 = *(unsigned int *)v12;
v14 = result;
v25 = *(_DWORD *)(a4 + 24);
if( (_DWORD)v13 == 1 )
v14 = a2;
LODWORD(NumberOfBytes) = *(_DWORD *)(a4 + 24);
ObjectProperty = PnpGetObjectProperty(
a1,
(__int64)v14,
v13,
0i64,
0i64,
*(v12 - 1),
(int *)&v28 + 1,
*(_QWORD *)(a4 + 16),
v25,
(ULONG *)&v28,
0);
LODWORD(NumberOfBytes) = v28;
if( !ObjectProperty && (unsigned int)v28 < 2 )
break;
if( ObjectProperty != -1073741789 )
goto LABEL_23;
if( (unsigned int)v28 < 2 )
break;
PoolWithTag = ExAllocatePoolWithTag(PagedPool, (unsigned int)v28, 0x47706E50ui64);
if( !PoolWithTag )
{
ObjectProperty = -1073741670;
LABEL_23:
if( ObjectProperty >= 0 && HIDWORD(v28) == 8210 )
{
v17 = *(_DWORD *)(a4 + 24);
if( v17 > 2 )
{
*(_WORD *)(*(_QWORD *)(a4 + 16) + 2 * ((unsigned __int64)v17 >> 1) - 2) = 0;
v17 = *(_DWORD *)(a4 + 24);
}
if( v17 > 4 )
*(_WORD *)(*(_QWORD *)(a4 + 16) + 2 * ((unsigned __int64)v17 >> 1) - 4) = 0;
v18 = *(WCHAR **)(a4 + 16);
if( *v18 )
{
while( (int)RtlInitUnicodeStringEx(&DestinationString, v18) < 0
|| !RtlEqualUnicodeString(*(UNICODE_STRING **)a4, &DestinationString, 1u) )
{
v19 = -1i64;
do
++v19;
while( v18[v19] );
v18 += v19 + 1;
if( !*v18 )
goto LABEL_38;
}
v7 = 1;
}
LABEL_38:
if( v7 )
goto LABEL_53;
}
break;
}
v22 = *(void **)(a4 + 16);
if( v22 )
ExFreePoolWithTag(v22, 0);
v23 = NumberOfBytes;
*(_QWORD *)(a4 + 16) = PoolWithTag;
*(_DWORD *)(a4 + 24) = v23;
}
++v11;
v12 += 2;
if( v11 < 4 )
continue;
}
else
{
LODWORD(NumberOfBytes) = 78;
if( (int)CmGetDeviceRegProp(
a1,
a2,
0i64,
9,
(__int64)&NumberOfBytes + 4,
(__int64)result,
(__int64)&NumberOfBytes,
0) >= 0
&& HIDWORD(NumberOfBytes) == 1
&& (unsigned int)NumberOfBytes >= 2 )
{
v32 = 0;
goto LABEL_19;
}
}
break;
}
}
else
{
v7 = 1;
}
if( v7 )
{
LABEL_53:
v24 = *(__int64(__fastcall **)(INT64, WCHAR *, _QWORD, _QWORD))(a4 + 32);
if( v24 )
return v24(a1, a2, v29, *(_QWORD *)(a4 + 40));
}
}
return v7;
}Referenced by:
No references.