PiDmListInitEnumCallback

__int64 __fastcall PiDmListInitEnumCallback(ULONG_PTR a1, __int64 a2, _BYTE *a3){
  ULONG v3; 
  __int64 v6; 
  __int64 v7; 
  __int64 v8; 
  int ObjectProperty; 
  __int16 *v10; 
  int v11; 
  CHAR *v12; 
  WCHAR **v13; 
  void *v15; 
  VOID *PoolWithTag; 
  ULONG v17; 
  int v18; 
  PVOID P; 
  __int16 v20[40]; 
  v18 = 0;
  P = 0i64;
  v3 = 1024;
  v17 = 1024;
  *a3 = 0;
  while( 1 )
  {
    if( v3 > *(_DWORD *)(a2 + 8) )
    {
      v15 = *(void **)a2;
      *(_DWORD *)(a2 + 8) = v3;
      if( v15 )
        ExFreePoolWithTag(v15, 0x5A706E50u);
      PoolWithTag = ExAllocatePoolWithTag(PagedPool, *(unsigned int *)(a2 + 8), 0x5A706E50ui64);
      *(_QWORD *)a2 = PoolWithTag;
      if( !PoolWithTag )
        break;
    }
    v6 = *(int *)(a2 + 12);
    v7 = *(unsigned int *)(a1 + 28);
    v8 = *(_QWORD *)(a1 + 16);
    v17 = 0;
    ObjectProperty = PnpGetObjectProperty(
                       PiPnpRtlCtx,
                       v8,
                       v7,
                       0i64,
                       0i64,
                       PiDmListDefs[5 * v6 + 4],
                       &v18,
                       *(_QWORD *)a2,
                       *(_DWORD *)(a2 + 8),
                       &v17,
                       0);
    if( ObjectProperty != -1073741789 )
      goto LABEL_4;
    v3 = v17;
  }
  ObjectProperty = -1073741670;
LABEL_4:
  if( ObjectProperty == -1073741275 )
  {
    return 0;
  }
  else if( ObjectProperty >= 0 )
  {
    if( v18 == 13 )
    {
      PnpStringFromGuid(*(int **)a2, (wchar_t *)v20);
      v10 = v20;
    }
    else
    {
      if( v18 != 18 )
        return(unsigned int)ObjectProperty;
      v10 = *(__int16 **)a2;
    }
    v11 = PiDmAddCacheReferenceForObject(LODWORD(PiDmListDefs[5 * *(int *)(a2 + 12)]), (WCHAR *)v10, (CHAR **)&P);
    v13 = (WCHAR **)P;
    ObjectProperty = v11;
    if( v11 >= 0 )
      PiDmListAddObject(*(_DWORD *)(a2 + 12), (UINT64)P, a1, 0i64);
    if( v13 )
    {
      PiDmRemoveCacheReferenceForObject(*((unsigned int *)v13 + 7), v13[2], v12);
      PiDmObjectRelease((CHAR *)v13);
    }
  }
  return(unsigned int)ObjectProperty;
}

Referenced by:

No references.