EmpParseCallbacks

INT64 __fastcall EmpParseCallbacks(VOID *ParsedInfHandle){
  unsigned int v2; 
  NTSTATUS GuidFromName; 
  unsigned int SectionLineCount; 
  CHAR *KeyName; 
  unsigned int SectionLineIndexValueCount; 
  unsigned int v7; 
  GUID *PoolWithTag; 
  GUID *v9; 
  GUID *v10; 
  CHAR *SectionLineIndex; 
  CHAR *v12; 
  unsigned int v13; 
  CHAR *v15; 
  SINGLE_LIST_ENTRY *v16; 
  __int64 v17; 
  GUID NameGuid; 
  NameGuid = 0i64;
  v2 = 0;
  GuidFromName = 0;
  SectionLineCount = EmpInfParseGetSectionLineCount(ParsedInfHandle, (PSTR)"CallbackDef");
  if( SectionLineCount )
  {
    while( 1 )
    {
      KeyName = CmpGetKeyName(ParsedInfHandle, (CHAR *)"CallbackDef", v2);
      if( !KeyName )
        return 0;
      SectionLineIndexValueCount = CmpGetSectionLineIndexValueCount(ParsedInfHandle, (CHAR *)"CallbackDef", v2);
      v7 = SectionLineIndexValueCount;
      if( SectionLineIndexValueCount < 2 )
        goto LABEL_20;
      PoolWithTag = (GUID *)ExAllocatePoolWithTag(PagedPool, (int)(8 * SectionLineIndexValueCount + 56), 0x74694D45ui64);
      v9 = PoolWithTag;
      if( !PoolWithTag )
        return(unsigned int)-1073741670;
      GuidFromName = EmpInfParseGetGuidFromName(ParsedInfHandle, (PSTR)"CallbackGuidDef", KeyName, PoolWithTag);
      v10 = v9;
      if( GuidFromName < 0 || EmpSearchCallbackDatabase(v9) )
        goto LABEL_19;
      v9[4].Data1 = v7 - 2;
      SectionLineIndex = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"CallbackDef", v2, 0i64);
      if( !SectionLineIndex )
        goto LABEL_18;
      *(_DWORD *)v9[3].Data4 = strtoul(SectionLineIndex, 0i64, 10i64);
      v12 = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"CallbackDef", v2, 1ui64);
      if( !v12 )
        goto LABEL_18;
      v13 = 2;
      *(_DWORD *)&v9[3].Data4[4] = strtoul(v12, 0i64, 10i64);
      if( v7 > 2 )
        break;
LABEL_10:
      if( GuidFromName < 0 )
        goto LABEL_18;
      *(_QWORD *)&v9[3].Data1 = 0i64;
      *(_QWORD *)&v9[1].Data1 = 0i64;
      *(_DWORD *)v9[1].Data4 = 0;
      *(_QWORD *)&v9[2].Data1 = 0i64;
      ++EmpNumberOfCallbacks;
      *(_QWORD *)v9[2].Data4 = EmpCallbackListHead;
      EmpCallbackListHead = (__int64)v9[2].Data4;
LABEL_12:
      if( ++v2 >= SectionLineCount )
        return(unsigned int)GuidFromName;
    }
    while( 1 )
    {
      v15 = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"CallbackDef", v2, v13);
      GuidFromName = EmpInfParseGetGuidFromName(ParsedInfHandle, (PSTR)"EntryTypeGuidDef", v15, &NameGuid);
      if( GuidFromName < 0 )
        break;
      v16 = EmpSearchEntryDatabase(&NameGuid);
      if( !v16 )
      {
        GuidFromName = -1073741275;
        goto LABEL_10;
      }
      v17 = v13 - 2;
      ++v13;
      *(_QWORD *)&v9[4].Data4[8 * v17] = v16;
      if( v13 >= v7 )
        goto LABEL_10;
    }
LABEL_18:
    v10 = v9;
LABEL_19:
    ExFreePoolWithTag(v10, 0x74694D45u);
LABEL_20:
    GuidFromName = 0;
    goto LABEL_12;
  }
  return(unsigned int)GuidFromName;
}

Referenced by:

EmpParseInfDatabase