SdbpFindMatchingName

__int64 __fastcall SdbpFindMatchingName(void *a1, unsigned int a2, __int64 a3){
  unsigned int NextIndexedRecord; 
  unsigned int FirstTag; 
  int v7; 
  const wchar_t *StringTagPtr; 
  bool v9; 
  int v11; 
  NextIndexedRecord = a2;
  if( !a2 )
    return NextIndexedRecord;
  while( 1 )
  {
    FirstTag = SdbFindFirstTag((INT64)a1, NextIndexedRecord, *(_WORD *)(a3 + 12));
    v7 = FirstTag;
    if( !FirstTag )
      break;
    StringTagPtr = (const wchar_t *)SdbGetStringTagPtr((RTL_RUN_ONCE *)a1, FirstTag);
    if( !StringTagPtr )
    {
      AslLogCallPrintf(1ui64, "SdbpFindMatchingName", 0x10Aui64, "Can't get the name string for tagid 0x%x", v7);
      return 0i64;
    }
    if( (*(_DWORD *)(a3 + 20) & 1) != 0 )
    {
      v11 = wcsicmp(*(const wchar_t **)(a3 + 32), StringTagPtr);
      v9 = v11 == 0;
      if( v11 < 0 )
        return 0i64;
    }
    else
    {
      v9 = wcsicmp(StringTagPtr, *(const wchar_t **)(a3 + 32)) == 0;
    }
    if( !v9 )
    {
      NextIndexedRecord = SdbpGetNextIndexedRecord((__int64)a1, *(unsigned int *)a3, (_DWORD *)a3);
      if( NextIndexedRecord )
        continue;
    }
    return NextIndexedRecord;
  }
  AslLogCallPrintf(
    1ui64,
    "SdbpFindMatchingName",
    0x100ui64,
    "The tag 0x%x was not found under tag 0x%x",
    NextIndexedRecord,
    *(unsigned __int16 *)(a3 + 12));
  return 0i64;
}

Referenced by:

SdbFindFirstStringIndexedTag
SdbFindNextStringIndexedTag