RtlGetProductInfo

BOOLEAN __stdcall RtlGetProductInfo(
        ULONG OSMajorVersion,
        ULONG OSMinorVersion,
        ULONG SpMajorVersion,
        ULONG SpMinorVersion,
        PULONG ReturnedProductType){
  ULONG v5; 
  BOOLEAN v6; 
  unsigned __int64 v8; 
  int v9; 
  unsigned __int64 v10; 
  __int64 v11; 
  UINT64 Type; 
  ULONG v13; 
  _DWORD v14[4]; 
  int v15[4]; 
  __int128 v16; 
  _DWORD Data_8[52]; 
  v5 = 0;
  v6 = 1;
  Type = 0i64;
  v13 = 0;
  v14[0] = OSMajorVersion;
  v14[1] = OSMinorVersion;
  v14[2] = SpMajorVersion;
  v14[3] = SpMinorVersion;
  if( !ReturnedProductType )
    return 0;
  *ReturnedProductType = 0;
  v15[0] = OSMajorVersion;
  v15[1] = OSMinorVersion;
  v16 = xmmword_140011510;
  v15[2] = SpMajorVersion;
  v15[3] = SpMinorVersion;
  if( (int)CompareVersions(v15, &v16) < 0 )
    return 0;
  if( ZwQueryLicenseValue((UNICODE_STRING *)&stru_140001F78, (UINT64 *)((char *)&Type + 4), &v13, 4ui64, &Type) < 0
    || Type != 0x400000004i64 )
  {
    *ReturnedProductType = -1412584499;
    return v6;
  }
  if( ZwQueryLicenseValue((UNICODE_STRING *)&stru_140001F68, (UINT64 *)((char *)&Type + 4), Data_8, 0xC8ui64, &Type) < 0 )
    goto LABEL_6;
  if( HIDWORD(Type) != 3 || (unsigned int)Type < 0x14 || (unsigned int)Type != 20 * ((unsigned int)Type / 0x14ui64) )
    return 0;
  if( (unsigned int)Type / 0x14ui64 )
  {
    v8 = 0i64;
    do
    {
      v16 = *(_OWORD *)&Data_8[5 * v8];
      if( (int)CompareVersions(v14, &v16) < 0 )
        v5 = Data_8[v11 + 4];
      v8 = (unsigned int)(v9 + 1);
    }
    while( v8 < v10 );
    if( v5 )
    {
      *ReturnedProductType = v5;
      return v6;
    }
  }
LABEL_6:
  *ReturnedProductType = v13;
  return v6;
}

Referenced by:

ExGetSuiteMask
ExpInitSystemPhase1