RtlVerifyVersionInfo

NTSTATUS __stdcall RtlVerifyVersionInfo(PRTL_OSVERSIONINFOEXW VersionInfo, UINT64 TypeMask, ULONGLONG ConditionMask){
  char v4; 
  char v6; 
  NTSTATUS result; 
  char v8; 
  unsigned int v9; 
  unsigned int v10; 
  int wSuiteMask; 
  int v12; 
  int v13; 
  int v14; 
  char v15; 
  bool v16; 
  unsigned int v17; 
  char v18; 
  char v19; 
  unsigned int v20; 
  char v21; 
  char v22; 
  char v23; 
  unsigned int v24; 
  char v25; 
  UINT64 *BiosInitTimeMs; 
  UINT64 ResumeHiberFileTimeMs[2]; 
  _DWORD VersionInformation[72]; 

  v4 = TypeMask;
  v6 = 0;
  if( !(_DWORD)TypeMask )
    return -1073741811;
  memset(&VersionInformation[1], 0i64, 0x118u);
  VersionInformation[0] = 284;
  result = RtlGetVersion((_OSVERSIONINFOW *)VersionInformation);
  if( !result )
  {
    if( (v4 & 0x40) != 0 && VersionInfo->wSuiteMask )
    {
      v10 = 0;
      wSuiteMask = VersionInfo->wSuiteMask;
      do
      {
        v12 = 1 << v10;
        if( (wSuiteMask & (1 << v10)) != 0 )
        {
          if( (ConditionMask & 0x8000000000000000ui64) == 0i64 )
            v13 = 0;
          else
            v13 = RtlpVerGetConditionMask(ConditionMask, 0x40ui64);
          v14 = v13 - 6;
          if( v14 )
          {
            if( v14 != 1 )
              return -1073741811;
            if( (VersionInformation[70] & (unsigned __int16)v12) != 0 )
              v6 = 1;
          }
          else if( (VersionInformation[70] & (unsigned __int16)v12) == 0 )
          {
            return -1073741735;
          }
        }
        ++v10;
      }
      while( v10 < 0x10 );
      if( (unsigned int)RtlpVerGetConditionMask(ConditionMask, 0x40ui64) == 7 && !v6 )
        return -1073741735;
    }
    v8 = 1;
    LOBYTE(ResumeHiberFileTimeMs[0]) = 1;
    v9 = 1;
    if( (v4 & 2) != 0 )
    {
      if( (ConditionMask & 0x8000000000000000ui64) == 0i64 )
        v9 = (unsigned __int8)(ConditionMask >> 4);
      else
        v9 = RtlpVerGetConditionMask(ConditionMask, 2ui64);
      LODWORD(BiosInitTimeMs) = 0;
      RtlpVerCompare(
        (UINT64 *)v9,
        (UINT64 *)VersionInfo->dwMajorVersion,
        (UINT64 *)VersionInformation[1],
        ResumeHiberFileTimeMs,
        BiosInitTimeMs);
      v16 = v15 == 0;
      v8 = ResumeHiberFileTimeMs[0];
      if( v16 )
      {
        if( !LOBYTE(ResumeHiberFileTimeMs[0]) )
          return -1073741735;
      }
      else if( !LOBYTE(ResumeHiberFileTimeMs[0]) )
      {
        goto LABEL_10;
      }
    }
    if( (v4 & 1) == 0 )
      goto LABEL_6;
    if( v9 == 1 )
    {
      if( (ConditionMask & 0x8000000000000000ui64) != 0i64 )
        v9 = RtlpVerGetConditionMask(ConditionMask, 1ui64);
      else
        v9 = (unsigned __int8)(ConditionMask >> 2);
    }
    LODWORD(BiosInitTimeMs) = 1;
    RtlpVerCompare(
      (UINT64 *)v9,
      (UINT64 *)VersionInfo->dwMinorVersion,
      (UINT64 *)VersionInformation[2],
      ResumeHiberFileTimeMs,
      BiosInitTimeMs);
    v16 = v19 == 0;
    v8 = ResumeHiberFileTimeMs[0];
    if( v16 )
    {
      if( !LOBYTE(ResumeHiberFileTimeMs[0]) )
        return -1073741735;
    }
    else
    {
LABEL_6:
      if( !v8 )
        goto LABEL_10;
    }
    if( (v4 & 0x20) != 0 )
    {
      if( v9 == 1 )
      {
        if( (ConditionMask & 0x8000000000000000ui64) != 0i64 )
          v9 = RtlpVerGetConditionMask(ConditionMask, 0x20ui64);
        else
          v9 = 0;
      }
      LODWORD(BiosInitTimeMs) = 0;
      RtlpVerCompare(
        (UINT64 *)v9,
        (UINT64 *)VersionInfo->wServicePackMajor,
        (UINT64 *)LOWORD(VersionInformation[69]),
        ResumeHiberFileTimeMs,
        BiosInitTimeMs);
      if( !v22 )
      {
        if( !LOBYTE(ResumeHiberFileTimeMs[0]) )
          return -1073741735;
        goto LABEL_9;
      }
      v8 = ResumeHiberFileTimeMs[0];
    }
    if( v8 )
    {
LABEL_9:
      if( (v4 & 0x10) != 0 )
      {
        if( v9 == 1 )
        {
          if( (ConditionMask & 0x8000000000000000ui64) != 0i64 )
            v9 = RtlpVerGetConditionMask(ConditionMask, 0x10ui64);
          else
            v9 = 0;
        }
        LODWORD(BiosInitTimeMs) = 1;
        RtlpVerCompare(
          (UINT64 *)v9,
          (UINT64 *)VersionInfo->wServicePackMinor,
          (UINT64 *)HIWORD(VersionInformation[69]),
          ResumeHiberFileTimeMs,
          BiosInitTimeMs);
        if( !v23 )
          return -1073741735;
      }
    }
LABEL_10:
    if( (v4 & 4) != 0 )
    {
      v20 = (ConditionMask & 0x8000000000000000ui64) == 0i64 ? BYTE2(ConditionMask) : RtlpVerGetConditionMask(
                                                                                        ConditionMask,
                                                                                        4ui64);
      LODWORD(BiosInitTimeMs) = 0;
      RtlpVerCompare(
        (UINT64 *)v20,
        (UINT64 *)VersionInfo->dwBuildNumber,
        (UINT64 *)VersionInformation[3],
        ResumeHiberFileTimeMs,
        BiosInitTimeMs);
      if( !v21 )
        return -1073741735;
    }
    if( (v4 & 8) != 0 )
    {
      v24 = (ConditionMask & 0x8000000000000000ui64) != 0i64 ? RtlpVerGetConditionMask(ConditionMask, 8ui64) : 0;
      LODWORD(BiosInitTimeMs) = 0;
      RtlpVerCompare(
        (UINT64 *)v24,
        (UINT64 *)VersionInfo->dwPlatformId,
        (UINT64 *)VersionInformation[4],
        ResumeHiberFileTimeMs,
        BiosInitTimeMs);
      if( !v25 )
        return -1073741735;
    }
    if( v4 < 0 )
    {
      v17 = (ConditionMask & 0x8000000000000000ui64) == 0i64 ? 0 : RtlpVerGetConditionMask(ConditionMask, 0x80ui64);
      LODWORD(BiosInitTimeMs) = 0;
      RtlpVerCompare(
        (UINT64 *)v17,
        (UINT64 *)VersionInfo->wProductType,
        (UINT64 *)BYTE2(VersionInformation[70]),
        ResumeHiberFileTimeMs,
        BiosInitTimeMs);
      if( !v18 )
        return -1073741735;
    }
    return 0;
  }
  return result;
}

Referenced by:

AslpFileGetVersionBlock
WdipSemLoadScenarioTable