SdbGetIndex

__int64 __fastcall SdbGetIndex(PVOID Parameter, __int16 a2, __int16 a3, _DWORD *a4){
  unsigned int v7; 
  NTSTATUS v8; 
  int v9; 
  __int64 v10; 
  _WORD *i; 
  __int64 v12; 
  NTSTATUS v14; 
  PVOID Context; 
  Context = 0i64;
  v7 = 0;
  if( a4 )
    *a4 = 0;
  v8 = RtlRunOnceExecuteOnce(
         (PRTL_RUN_ONCE)Parameter + 167,
         (PRTL_RUN_ONCE_INIT_FN)InitOnceScanIndexes,
         Parameter,
         &Context);
  if( v8 < 0 )
  {
    v14 = v8;
    AslLogCallPrintf(1ui64, "SdbGetIndex", 0x427ui64, "RtlRunOnceExecuteOnce failed for InitOnceScanIndexes [%x]", v14);
  }
  else
  {
    v9 = 0;
    v10 = 0i64;
    for( i = (char *)Context + 4; *i; i += 20 )
    {
      if( *i == a2 && i[1] == a3 )
      {
        v12 = 5i64 * v9;
        v7 = *((_DWORD *)Context + 2 * v12);
        if( a4 )
          *a4 = *((_DWORD *)Context + 2 * v12 + 8);
        return v7;
      }
      ++v9;
      if( ++v10 >= 32 )
        return v7;
    }
  }
  return v7;
}

Referenced by:

SdbFindFirstStringIndexedTag
SdbpFindFirstIndexedWildCardTag
SdbpSearchDB