SiIsWinPeHardDiskZeroUfdBoot

CHAR __fastcall SiIsWinPeHardDiskZeroUfdBoot(WCHAR *a1, INT64 a2, INT64 a3, UINT64 *a4){
  CHAR v4; 
  CHAR result; 
  INT64 v6; 
  UINT64 *v7; 
  wchar_t *v8; 
  __int64 v9; 
  PVOID v10; 
  UINT64 v11; 
  NTSTATUS v12; 
  bool v13; 
  int v14; 
  int v15; 
  int v16; 
  wchar_t *Src; 
  WCHAR *ResultName; 
  __int64 OutputBuffer; 
  int v20; 
  __int128 v21; 
  __int128 v22; 
  __int64 v23; 
  v4 = 0;
  Src = 0i64;
  ResultName = 0i64;
  v21 = 0i64;
  v23 = 0i64;
  v22 = 0i64;
  v15 = 0;
  v14 = 0;
  OutputBuffer = 0i64;
  v20 = 0;
  v16 = 0;
  result = SiIsWinPEBoot();
  if( result )
  {
    if( (int)SiGetBootDeviceNameFromRegistry((PWCHAR)L"FirmwareBootDevice", (INT64)&Src, v6, v7) >= 0 )
    {
      v8 = Src;
      v9 = -1i64;
      do
        ++v9;
      while( Src[v9] );
      if( snwscanf_s(Src, v9 + 1, L"multi(%d)disk(%d)rdisk(%d)", &v14, &v15, &v16) == 3
        && !v14
        && !v15
        && !v16
        && (int)SiTranslateSymbolicLink(L"\\ArcName\\multi(0)disk(0)rdisk(0)", &ResultName) >= 0 )
      {
        ExFreePoolWithTag(v8, 0);
        v20 = 0;
        v12 = SiIssueSynchronousIoctl(ResultName, v10, &OutputBuffer, v11);
        if( v12 >= 0 )
          v13 = HIDWORD(v22) == 7;
        else
          v13 = v12 == -1073741766;
        if( v13 )
          return 1;
      }
    }
    return v4;
  }
  return result;
}

Referenced by:

SiGetBiosSystemDisk