EmpParseCallbacks
NTSTATUS __stdcall EmpParseCallbacks(VOID *ParsedInfHandle){
unsigned int v2;
int GuidFromName;
unsigned int SectionLineCount;
char *KeyName;
unsigned int SectionLineIndexValueCount;
unsigned int v7;
VOID **PoolWithTag;
VOID **v9;
VOID **v10;
INT8 *SectionLineIndex;
INT8 *v12;
unsigned int v13;
char *v15;
_SINGLE_LIST_ENTRY *v16;
__int64 v17;
_GUID NameGuid;
NameGuid = 0i64;
v2 = 0;
GuidFromName = 0;
SectionLineCount = EmpInfParseGetSectionLineCount(ParsedInfHandle, (INT8 *)"CallbackDef");
if( SectionLineCount )
{
while( 1 )
{
KeyName = CmpGetKeyName(ParsedInfHandle, (PSTR)"CallbackDef", v2);
if( !KeyName )
return 0;
SectionLineIndexValueCount = CmpGetSectionLineIndexValueCount(ParsedInfHandle, (PSTR)"CallbackDef", v2);
v7 = SectionLineIndexValueCount;
if( SectionLineIndexValueCount < 2 )
goto LABEL_20;
PoolWithTag = ExAllocatePoolWithTag(1ui64, (int)(8 * SectionLineIndexValueCount + 56), 1953058117i64);
v9 = PoolWithTag;
if( !PoolWithTag )
return -1073741670;
GuidFromName = EmpInfParseGetGuidFromName(ParsedInfHandle, (PSTR)"CallbackGuidDef", KeyName, (_GUID *)PoolWithTag);
v10 = v9;
if( GuidFromName < 0 || EmpSearchCallbackDatabase((const _GUID *)v9) )
goto LABEL_19;
*((_DWORD *)v9 + 16) = v7 - 2;
SectionLineIndex = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"CallbackDef", v2, 0i64);
if( !SectionLineIndex )
goto LABEL_18;
*((_DWORD *)v9 + 14) = strtoul(SectionLineIndex, 0i64, 10i64);
v12 = CmpGetSectionLineIndex(ParsedInfHandle, (PSTR)"CallbackDef", v2, 1ui64);
if( !v12 )
goto LABEL_18;
v13 = 2;
*((_DWORD *)v9 + 15) = strtoul(v12, 0i64, 10i64);
if( v7 > 2 )
break;
LABEL_10:
if( GuidFromName < 0 )
goto LABEL_18;
v9[6] = 0i64;
v9[2] = 0i64;
*((_DWORD *)v9 + 6) = 0;
v9[4] = 0i64;
++dword_140C50894;
v9[5] = (VOID *)EmpCallbackListHead;
EmpCallbackListHead = (__int64)(v9 + 5);
LABEL_12:
if( ++v2 >= SectionLineCount )
return 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;
v9[v17 + 9] = v16;
if( v13 >= v7 )
goto LABEL_10;
}
LABEL_18:
v10 = v9;
LABEL_19:
ExFreePoolWithTag(v10, 0x74694D45u);
LABEL_20:
GuidFromName = 0;
goto LABEL_12;
}
return GuidFromName;
}Referenced by:
EmpParseInfDatabase