/* The function determines who owns the device by attempting to start a session with different credentials. If the SID PIN matches the MSID PIN, the no one owns the device. If the SID PIN matches the ourSidPin, then "Us" owns the device. Otherwise it is unknown. */
OPAL_OWNER_SHIP EFIAPI OpalUtilDetermineOwnership(OPAL_SESSION *Session, UINT8 *Msid, UINT32 MsidLength)
/* The function determines who owns the device by attempting to start a session with different credentials. If the SID PIN matches the MSID PIN, the no one owns the device. If the SID PIN matches the ourSidPin, then "Us" owns the device. Otherwise it is unknown. */
OPAL_OWNER_SHIP EFIAPI OpalUtilDetermineOwnership(OPAL_SESSION *Session, UINT8 *Msid, UINT32 MsidLength)
{
  UINT8            MethodStatus;
  TCG_RESULT       Ret;
  OPAL_OWNER_SHIP  Owner;
  if ((Session == NULL) || (Msid == NULL)) {
    return OpalOwnershipUnknown;
  }
  Owner = OpalOwnershipUnknown;
  Ret = OpalStartSession (
          Session,
          OPAL_UID_ADMIN_SP,
          TRUE,
          MsidLength,
          Msid,
          OPAL_ADMIN_SP_SID_AUTHORITY,
          &MethodStatus
          );
  if ((Ret == TcgResultSuccess) && (MethodStatus == TCG_METHOD_STATUS_CODE_SUCCESS)) {
    Owner = OpalOwnershipNobody;
    OpalEndSession (Session);
  }
  return Owner;
}