ExpQueryPortableWorkspaceEfiLauncherInformation

NTSTATUS __stdcall ExpQueryPortableWorkspaceEfiLauncherInformation(
        PVOID LauncherInformation,
        UINT64 LauncherInformationLength,
        UINT64 *ReturnedLength){
  unsigned int *v5; 
  UINT64 *v6; 
  int v7; 
  NTSTATUS v9; 
  bool v10; 
  unsigned int *PoolWithQuotaTag; 
  NTSTATUS v12; 
  UINT64 *v13; 
  unsigned int *v14; 
  unsigned int *i; 
  __int64 v16; 
  __int64 v17; 
  UINT64 Count; 
  INT64 v19; 
  INT64 v20; 
  UINT64 BufferLength; 

  LODWORD(BufferLength) = 0;
  LODWORD(Count) = 0;
  v5 = 0i64;
  v19 = 0i64;
  v6 = 0i64;
  v20 = 0i64;
  if( *(&ExBootDevicesRemovedEvent + 276) != 2 )
  {
    v7 = -1073741821;
    goto LABEL_3;
  }
  if( (_DWORD)LauncherInformationLength != 1 )
  {
    *(_DWORD *)ReturnedLength = 1;
    v7 = -1073741820;
    goto LABEL_3;
  }
  v9 = ZwEnumerateBootEntries(0i64, &BufferLength);
  v7 = v9;
  if( v9 < 0 )
  {
    if( v9 != -1073741789 )
      goto LABEL_3;
    PoolWithQuotaTag = (unsigned int *)ExAllocatePoolWithQuotaTag(
                                         (POOL_TYPE)9,
                                         (unsigned int)BufferLength,
                                         0x6F666E49ui64);
    v5 = PoolWithQuotaTag;
    v19 = (INT64)PoolWithQuotaTag;
    if( !PoolWithQuotaTag )
      goto LABEL_14;
    v7 = ZwEnumerateBootEntries(PoolWithQuotaTag, &BufferLength);
    if( v7 < 0 )
      goto LABEL_3;
    v12 = ZwQueryBootEntryOrder(0i64, &Count);
    v7 = v12;
    if( v12 >= 0 )
      goto LABEL_11;
    if( v12 != -1073741789 )
      goto LABEL_3;
    v13 = (UINT64 *)ExAllocatePoolWithQuotaTag((POOL_TYPE)9, 4i64 * (unsigned int)Count, 0x6F666E49ui64);
    v6 = v13;
    v20 = (INT64)v13;
    if( !v13 )
    {
LABEL_14:
      v7 = -1073741670;
      goto LABEL_3;
    }
    v7 = ZwQueryBootEntryOrder(v13, &Count);
    if( v7 < 0 )
      goto LABEL_3;
    v14 = 0i64;
    for( i = v5; ; i = (unsigned int *)((char *)i + v17) )
    {
      if( i[7] == 16 )
      {
        v16 = *((_QWORD *)i + 4) - PORTABLE_WORKSPACE_LAUNCHER_EFI_ENTRY_ID;
        if( !v16 )
          v16 = *((_QWORD *)i + 5) - 0x1536958043F38A81i64;
        if( !v16 )
          break;
      }
      v17 = *i;
      if( !(_DWORD)v17 )
        goto LABEL_27;
    }
    v14 = i + 1;
LABEL_27:
    if( v14 )
    {
      v10 = v14[2] == *(_DWORD *)v6;
      goto LABEL_29;
    }
  }
LABEL_11:
  v10 = 0;
LABEL_29:
  *(_BYTE *)LauncherInformation = v10;
  *(_DWORD *)ReturnedLength = 1;
  v7 = 0;
LABEL_3:
  if( v5 )
    ExFreePoolWithTag(v5, 0x6F666E49u);
  if( v6 )
    ExFreePoolWithTag(v6, 0x6F666E49u);
  return v7;
}

Referenced by:

ExpQuerySystemInformation