BiBindEfiEntryToBcdObject

INT64 __fastcall BiBindEfiEntryToBcdObject(VOID *a1, GUID *a2){
  unsigned int Data1; 
  int KeyName; 
  WCHAR v5; 
  GUID v6; 
  PCWSTR SourceString; 
  VOID *KeyHandle; 
  int v10[2]; 
  struct _UNICODE_STRING DestinationString; 
  GUID Guid; 
  SourceString = 0i64;
  KeyHandle = 0i64;
  Data1 = a2[3].Data1;
  Guid = 0i64;
  DestinationString = 0i64;
  if( (Data1 & 4) != 0 )
  {
    return 0;
  }
  else
  {
    v10[1] = 270532607;
    v10[0] = 1;
    KeyName = BiCreateObject((__int64)a1, 0i64, v10, 1i64, &KeyHandle);
    if( KeyName >= 0 )
    {
      KeyName = BiGetKeyName(KeyHandle, (WCHAR **)&SourceString);
      if( KeyName >= 0 )
      {
        RtlInitUnicodeString(&DestinationString, SourceString, v5);
        KeyName = RtlGUIDFromString(&DestinationString, &Guid);
        if( KeyName >= 0 )
        {
          v6 = Guid;
          a2[3].Data1 |= 4u;
          a2[1] = v6;
        }
      }
      if( SourceString )
        ExFreePoolWithTag((PVOID)SourceString, 0x4B444342u);
    }
    if( KeyHandle )
      BcdCloseObject(KeyHandle);
  }
  return(unsigned int)KeyName;
}

Referenced by:

BiBindEfiEntries