﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="html" indent="yes"/>
    <xsl:variable name="debug" select="0" />
    <xsl:template match="REPORT">
        <html xmlns="http://www.w3.org/1999/xhtml" >
            <head>
                <title>Windows 7 Software Logo Toolkit Test Results</title>
                <style type="text/css">
                    BODY, TH, TD { font-family:tahoma; font-size:10pt;}
                    .titleLarge { font-size: 18pt; }
                    .titleItem { font-size: 14pt; font-weight: bold; color: #4F81BD; }
                    .appInfo { font-size: 12pt; font-weight: bold; color: #4F81BD; text-indent: 0.25in; } 
                    .overall { font-size: 16pt; font-weight: bold; text-indent: 0.25in; }
                    .ulMessages {
                    list-style-type: circle;
                    background-color: #cccccc;
                    border-color: black;
                    }
                </style>
                <script language='javascript' type='text/javascript'>
                    function ShowMessages(divName) {
                        obj = document.getElementById(divName);
                        var linkText = "LinkText_" + divName;
                        linkObj = document.getElementById(linkText);
                        if (obj.style.display == "none") {
                            obj.style.display = "block";
                            linkObj.innerHTML = "Hide extra messages...";
                        } else {
                            obj.style.display = "none";
                            linkObj.innerHTML = "Show more messages...";
                        }
                    }
                </script>
            </head>
            <body>
                <div class="titleLarge">Windows 7 Software Logo Toolkit Test Results</div>
                <hr/>
                <xsl:if test="count(APPLICATIONS/Installed_Programs/Program)=1">
                  <xsl:apply-templates select="APPLICATIONS/Installed_Programs/Program" />
                </xsl:if>
                <xsl:apply-templates select="@ReportGenerationTime" mode="TimeStamp" />
                <hr/>
                <xsl:apply-templates select="@OVERALL_RESULT" mode="OverallResult">
                    <xsl:with-param name="uimodePresent" select="count(@UIMODE)" />
                </xsl:apply-templates>
                <hr/>
                <div>
                    <xsl:apply-templates select="REQUIREMENTS/REQUIREMENT">
                    </xsl:apply-templates>
                </div>
                <div>
                    <xsl:apply-templates select="WAIVERS">
                    </xsl:apply-templates>
                </div>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="Program">
        <xsl:variable name="appName" select="@Name" />        
        <xsl:variable name="appVersion" select="@Version" />        
        <xsl:variable name="appVendor" select="@Publisher" />       
        <div xmlns="http://www.w3.org/1999/xhtml" class="appInfo">
        <xsl:choose>
          <xsl:when test="string-length($appName)=0">
              <xsl:text>Application Name: Not Available</xsl:text>
          </xsl:when>
          <xsl:otherwise>
              <xsl:text>Application Name: </xsl:text><xsl:value-of select="$appName" />
          </xsl:otherwise>
        </xsl:choose>
        </div>
        <div xmlns="http://www.w3.org/1999/xhtml" class="appInfo">
        <xsl:choose>
          <xsl:when test="string-length($appVersion)=0">
              <xsl:text>Application Version: Not Available</xsl:text>
          </xsl:when>
          <xsl:otherwise>
              <xsl:text>Application Version: </xsl:text><xsl:value-of select="$appVersion" />
          </xsl:otherwise>
        </xsl:choose>
        </div>
        <div xmlns="http://www.w3.org/1999/xhtml" class="appInfo">
        <xsl:choose>
          <xsl:when test="string-length($appVendor)=0">
              <xsl:text>Application Publisher: Not Available</xsl:text>
          </xsl:when>
          <xsl:otherwise>
              <xsl:text>Application Publisher: </xsl:text><xsl:value-of select="$appVendor" />
          </xsl:otherwise>
        </xsl:choose>
        </div>
    </xsl:template>

    <xsl:template match="@* | node()" mode="TimeStamp">
        <xsl:variable name="reportTimestamp" select="." />
        <div xmlns="http://www.w3.org/1999/xhtml" class="appInfo">
            <xsl:choose>
              <xsl:when test="string-length($reportTimestamp)=0">
                <xsl:text>Report Generation Time: Not Available</xsl:text>
              </xsl:when>
              <xsl:otherwise>
                <xsl:text>Report Generation Time: </xsl:text>
                <xsl:value-of select="$reportTimestamp" />
              </xsl:otherwise>         
            </xsl:choose>   
        </div>
    </xsl:template>

    <xsl:template match="@* | node()" mode="OverallResult">
        <xsl:param name="uimodePresent" />
        <xsl:variable name="curType" select="." />
        <div xmlns="http://www.w3.org/1999/xhtml" class="overall">
            <xsl:text>Summary: </xsl:text>
            <xsl:element name="span">
                <xsl:choose>
                    <xsl:when test="$uimodePresent=0">
                        <xsl:attribute name="style">color: blue;</xsl:attribute>
                        <xsl:text>Incomplete - This is an interim report; please continue with the Toolkit wizard to finalize the report.</xsl:text>
                    </xsl:when>
                    <xsl:when test="$curType='PASS'">
                        <xsl:attribute name="style">color: green;</xsl:attribute>
                        <xsl:text>Pass</xsl:text>
                    </xsl:when>
                    <xsl:when test="$curType='FAIL'">
                        <xsl:attribute name="style">color: red;</xsl:attribute>
                        <xsl:text>Fail</xsl:text>
                    </xsl:when>
                    <xsl:when test="$curType='WARNING'">
                        <xsl:attribute name="style">color: orange;</xsl:attribute>
                        <xsl:text>Pass With Warnings</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:attribute name="style">color: gray;</xsl:attribute>
                        <xsl:value-of select="$curType"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:element>
        </div>
    </xsl:template>

    <xsl:template match="REQUIREMENT">
        <xsl:variable name="reqIndex" select="@NUMBER" />
        <div xmlns="http://www.w3.org/1999/xhtml" class="titleItem">
            <xsl:element name="span">
                <xsl:value-of select="@NUMBER"/>
            </xsl:element>
            <xsl:text disable-output-escaping="yes">. </xsl:text>
            <xsl:element name="span">
                <xsl:value-of select="@TITLE"/>
            </xsl:element>
            <br /><br />
        </div>
        <div xmlns="http://www.w3.org/1999/xhtml">
            <xsl:apply-templates select="TEST">
                <xsl:with-param name="reqIndex" select="$reqIndex" />
            </xsl:apply-templates>
        </div>
    </xsl:template>

    <xsl:template match="TEST">
        <xsl:param name="reqIndex" />
        <xsl:variable name="testIndex" select="position()" />
        <div xmlns="http://www.w3.org/1999/xhtml">
            <xsl:choose>
                <xsl:when test="RESULT='PASS'">                    
                    <b style="text-indent: 10px;">Test case: </b>
                    <xsl:value-of select="@NAME" />
                    <xsl:text disable-output-escaping="yes">: </xsl:text>
                    <b style="color:green;">PASS</b>
                </xsl:when>
                <xsl:when test="RESULT='WARNING'">
                    <b style="text-indent: 10px;">Test case: </b>
                    <xsl:value-of select="@NAME" />
                    <xsl:text disable-output-escaping="yes">: </xsl:text>
                    <b style="color:orange;">PASS WITH WARNINGS</b>
                </xsl:when>
                <xsl:when test="RESULT='FAIL'">
                    <b style="text-indent: 10px;">Test case: </b>
                    <xsl:value-of select="@NAME" />
                    <xsl:text disable-output-escaping="yes">: </xsl:text>
                    <b style="color:red;">FAIL</b>
                </xsl:when>
                <xsl:otherwise>
                    <b style="color:#51BD8D;">
                        <xsl:value-of select="RESULT"/>
                    </b>
                    <xsl:text disable-output-escaping="yes">: </xsl:text>
                    <xsl:value-of select="@NAME" />
                </xsl:otherwise>
            </xsl:choose>
            <br/>
            <xsl:choose>
                <xsl:when test="RESULT='PASS'"></xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="uniqueTestId">
                        <xsl:value-of select="$reqIndex" />
                        <xsl:text>_</xsl:text>
                        <xsl:value-of select="$testIndex" />                                       
                    </xsl:variable>
                    <xsl:call-template name="testError">
                        <xsl:with-param name="reqNdx" select="$reqIndex" />
                        <xsl:with-param name="tstNdx" select="$testIndex" />
                        <xsl:with-param name="tstRslt" select="RESULT" />
                        <xsl:with-param name="uniqueTstId" select="$uniqueTestId" />
                    </xsl:call-template>
                </xsl:otherwise>
            </xsl:choose>
        </div>
        <br xmlns="http://www.w3.org/1999/xhtml"/>
    </xsl:template>

    <xsl:template name="testError">
        <xsl:param name="reqNdx" />
        <xsl:param name="tstNdx" />
        <xsl:param name="tstRslt" />
        <xsl:param name="uniqueTstId" />
        <!-- one-off exceptions to the normal flow of the document (that need something before the list item). -->
        <xsl:if test="$reqNdx='3' and $tstNdx='1'">
            <div xmlns="http://www.w3.org/1999/xhtml" style="text-indent: 10px;">The toolkit reports all unsigned files of the following extensions: EXEs, DLLs, SYS, DRV, OCX, SCR, and CPL.</div>
        </xsl:if>
        <ul xmlns="http://www.w3.org/1999/xhtml" style="list-style-type: disc;">
            <xsl:choose>
                <xsl:when test="$reqNdx='1'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                   <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                   <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                    Applications are expected to create these registry entries DisplayName, InstallLocation,
                                    Publisher, UninstallString, VersionMajor*, and VersionMinor*. <br/>
                                    This application did not create the following registry entries:
                                </div>
                                <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                                </ul>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>A user might remove an application not only to free up disk space, but also to return
                                        the computer to its state prior to the application being installed. Failure to restore the machine to its original
                                        state is a poor user experience. Also applications that do not create the above registry entries will not be found
                                        by enterprise inventory tools, and may experience issues in OS migrations and or upgrades scenarios. Windows telemetry
                                        tools may not accurately report information about your application.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX:</b> You can supply all of the information needed to configure Add/Remove Programs in Control Panel by 
                                        setting the values of certain installer properties in your application's Windows Installer package. Setting these 
                                        properties automatically writes the corresponding values into the registry. The latest information and best practices
                                         that illustrate how to do this can be found at these links <a href="http://go.microsoft.com/?linkid=9672222">1</a> and 
                                        <a href="http://msdn.microsoft.com/en-us/library/aa372105.aspx?ppud=4">2</a>.                                        
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:when test="$tstNdx='2'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        This application’s install has forced an immediate reboot without providing the user with an option to
                                        restart the computer at a later time.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Forcing an immediate reboot during install can impact users in a variety of negative ways,
                                        and could cause data loss.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>A reboot should never be the only option at the end of an install or update. Users should have the
                                        opportunity to restart later.  Guidance on how to handle the need for a reboot is available
                                        <a href="http://go.microsoft.com/?linkid=9647506">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:when test="$tstNdx='3'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        This application’s uninstall has forced an immediate reboot without providing the user with an option to
                                        restart the computer at a later time.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Forcing an immediate reboot during uninstall can impact users in a variety of negative ways,
                                        and could cause data loss.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>A reboot should never be the only option when uninstalling an application. Users should have the
                                        opportunity to restart later.  Guidance on how to handle the need for a reboot is available
                                        <a href="http://go.microsoft.com/?linkid=9647506">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:when test="$tstNdx='4'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        <xsl:if test="count(MESSAGES/MESSAGE) = 0">
                                        WSLK didn't detect any changes to the file inventory collected during the "Pre-Install" phase. This could be due to a unsuccessful 
                                        or incomplete uninstall. Please uninstall your application and run this step once you are done.
                                        </xsl:if>
                                        <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                        This application failed to remove the following files during uninstall:
                                        </xsl:if>
                                    </span>
                                    <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                    <ul class="ulMessages">
                                        <xsl:apply-templates select="MESSAGES">
                                           <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                        </xsl:apply-templates>
                                    </ul>
                                    </xsl:if>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Leaving unnecessary files behind wastes disk space and might cause application conflicts later.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Ensure that all files and Add/Remove Program entries are properly removed.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='2'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        This application wrote the following files to %SystemDrive%, and or %WinDir% folders:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Avoid storing application’s data to %SystemDrive%, and or %WinDir% folders. The ACLs on 
                                        certain Windows directories have been changed to enable data sharing and collaboration in data directories and outside 
                                        of a user's protected directories. File virtualization addresses the situation where an application relies on the 
                                        ability to store a file, such as a configuration file, in a system location typically writeable only by administrators. 
                                        Running programs as a standard user in this situation might result in program failures due to insufficient levels 
                                        of access. Also there are privacy and system integrity concerns when applications do not store files in the correct 
                                        folders.  Using the Known Folder APIs ensures that you are always able to get to your data. Please note: 
                                        <i>“Virtualization is implemented to improve application compatibility problems for applications running as a standard 
                                        user on Windows 7. Developers must not rely on virtualization being present in subsequent versions of Windows”</i>
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Guidelines and API calls have been provided to help the application to know where to install and store
                                        system and data files.  More information and guidance can be found at these links <a href="http://go.microsoft.com/?linkid=9659846">1</a>,
                                        <a href="http://go.microsoft.com/?linkid=9659848">2</a>, and <a href="http://go.microsoft.com/?linkid=9659847">3</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:when test="$tstNdx='2'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        This application wrote the following files to a location other than %ProgramFiles%:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Install applications to %ProgramFiles% for native 32-bit and 64-bit applications,
                                        and %ProgramFiles(x86)% for 32-bit applications running on x64. The ACLs on
                                        certain Windows directories have been changed to enable data sharing and collaboration in data directories and outside
                                        of a user's protected directories. File virtualization addresses the situation where an application relies on the
                                        ability to store a file, such as a configuration file, in a system location typically writeable only by administrators.
                                        Running programs as a standard user in this situation might result in program failures due to insufficient levels
                                        of access. Also there are privacy and system integrity concerns when applications do not store files in the correct
                                        folders.  Using the Known Folder APIs ensures that you are always able to get to your data. Please note: 
                                        <i>
                                            “Virtualization is implemented to improve application compatibility problems for applications running as a standard
                                            user on Windows 7. Developers must not rely on virtualization being present in subsequent versions of Windows”
                                        </i>
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Guidelines and API calls have been provided to help the application to know where to install and store
                                        system and data files.  More information and guidance can be found at these links <a href="http://go.microsoft.com/?linkid=9659846">1</a>,
                                        <a href="http://go.microsoft.com/?linkid=9659848">2</a>, and <a href="http://go.microsoft.com/?linkid=9659847">3</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='3'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        The application installed the following unsigned files:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                    <span>
                                        If any of the above files are DLLs, OCX, SCR, CPL or EXEs that are not one of the application’s main
                                        executables (has a shortcut on start menu or desktop), they can safely be ignored.  All others need to
                                        be signed to meet the Windows 7 Software Logo requirements.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Having digitally signed files allows users to know that software is genuine. It
                                        also allows detection if a file has been tampered with, by a virus or Trojan for example. Windows 7 will
                                        have the ability to prevent any unsigned application from launching with a full administrator access token.
                                        If you want your application to operate correctly in locked-down environments, while displaying a more user
                                        friendly user interface, it should be signed with an Authenticode signature.
                                    </span>
                                </div>
                                <div>
                                    <i>
                                        “The elevation prompt displays contextual information about the executable requesting elevation and the context
                                        is different depending on whether the application is Authenticode signed. The elevation prompt is seen in two
                                        variations: the consent prompt and the credential prompt.”
                                    </i>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>To sign the application, you can either generate a certificate from makecert.exe or obtain a
                                        code-signing key from one of the commercial certification authorities (CAs), such as VeriSign, Thawte,
                                        or a Microsoft CA. information and guidance on how to sign your drivers and files is available
                                        <a href="http://go.microsoft.com/?linkid=9659849">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='4'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        When this test was started a switch was set indicating that either a 32bit or 64bit application
                                        is being tested.  The application installed the following files that do not match the specified platform
                                        architecture:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                    <span>
                                        If any of the above files are drivers, or 16-bit your application FAILED this test, otherwise you can safely ignore.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>32-bit processes cannot load 64-bit DLLs, and 64-bit processes cannot load 32-bit DLLs.
                                        64-bit Windows does not support running 16-bit Windows-based applications. The primary reason is that handles have
                                        32 significant bits on 64-bit Windows. Therefore, handles cannot be truncated and passed to 16-bit applications
                                        without loss of data. Attempts to launch 16-bit applications fail. 32-bit drivers cannot run on 64-bit Windows
                                        and must be ported. For user-mode applications, 64-bit Windows includes WOW64, which enables 32-bit Windows
                                        applications to execute (with some loss of performance) on systems running 64-bit Windows. No equivalent translation
                                        layer exists for drivers.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Install only files and drivers for the corresponding processor architecture.  More information
                                        and guidance on programming for compatibility with 64bit operating systems is available
                                        <a href="http://go.microsoft.com/?linkid=9647503">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='5'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        Application failed to install under a higher Windows version.
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Customers are artificially blocked from 
                                        installing their applications when there are no technical limitations.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Applications must not perform version checks for 
                                        equality (== 5.1). If you need a specific feature, check whether the 
                                        feature itself is available. If you need Windows XP, check for Windows XP 
                                        or later (>= 5.1), this way, your detection code will continue to work on 
                                        future versions of Windows. Driver installers and uninstall modules should 
                                        never check the OS version.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:when test="$tstNdx='2'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        Application failed to run under a higher Windows version.
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Customers are artificially blocked from 
                                        running their applications when there are no technical limitations.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Application installations must not perform version checks for 
                                        equality (== 5.1). If you need a specific feature, check whether the 
                                        feature itself is available. If you need Windows XP, check for Windows XP 
                                        or later (>= 5.1), this way, your detection code will continue to work on 
                                        future versions of Windows. Driver installers and uninstall modules should 
                                        never check the OS version.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='6'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        following files have requested an elevated run level, or are not manifested:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                    <span>
                                        The toolkit reports all files with a shortcut (desktop or start menu) that request a run level higher than “asInvoker”.
                                        <ul style="list-style-type: circle;">
                                            <li>If any of the above files are used for install or uninstall, they can be ignored.</li>
                                            <li>If any of the above files are not an application’s main executable, they can be ignored.</li>
                                            <li>
                                                If any of the above files are requesting uiAccess, a waiver with business justification
                                                explaining the needed permission is required to pass this requirement.
                                            </li>
                                        </ul>
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>If an application only operates or installs when the user is an administrator, users are
                                        being forced to run applications with unnecessary elevated access. The fundamental problem is that, when users are
                                        always forced to run applications using elevated access tokens, deceptive or malicious code can easily modify the
                                        operating system, or worse, affect other users. It is nearly impossible to control a user that has a full
                                        administrator access token. Administrators can install applications and run any application or script that they
                                        wish. IT managers are always seeking ways to create "standard desktops" where users log on as standard users.
                                        Standard desktops greatly reduce help desk costs and reduce IT overhead. The difficulty and experience depends on
                                        how the file is manifested, and the permission level requested.  The user experience is best for applications that
                                        follow UAC guidelines.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Manifest files with the proper permissions needed.  Adhere to the following UAC guidelines
                                        and best practices which are located <a href="http://go.microsoft.com/?linkid=9647504">HERE</a>.  A checklist
                                        for following UAC can be found <a href="http://go.microsoft.com/?linkid=9647505">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='7'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        <xsl:if test="count(MESSAGES/MESSAGE) = 0">
                                        The application did not install any shortcuts.
                                        </xsl:if>
                                        <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                        The following files did not respond to system restart requests:
                                        </xsl:if>
                                    </span>
                                    <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                    </xsl:if>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        Some applications as part of their first launch display EULAs or auto update prompts, registration forms,
                                        etc.  If your application performs in this way, it could be falsely reported as non-compliant with the
                                        restart requirement.
                                    </span>
                                    <ul style="list-style-type: circle;">
                                        <li>
                                            If any of the above files are reported for this reason, you should restart testing from a clean
                                            state (clean OS).  This time around, before running the /postinstall phase, execute any run-once
                                            functionality in the application PRIOR to running the /postinstall phase of the toolkit.
                                        </li>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>By failing to shutdown gracefully, customers could lose data when the
                                        OS finally forces a shutdown.  It also slows the shutdown/reboot process, impacting performance
                                        perceptions.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>In a critical shutdown, applications that return FALSE to WM_QUERYENDSESSION will be
                                        sent WM_ENDSESSION and closed, while those that time out in response to WM_QUERYENDSESSION, will be
                                        terminated. By following these guidelines, you can ensure that your application will handle critical
                                        shutdowns gracefully:
                                    </span>
                                    <ul style="list-style-type: circle;">
                                        <li>
                                            WM_QUERYENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): GUI 19 applications must respond
                                            (TRUE) immediately in preparation for a restart
                                        </li>
                                        <li>
                                            WM_ENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): Applications must return a 0 value
                                            within 30 seconds and shut down. At a minimum, applications should prepare by saving any user
                                            data and state information that is needed after a restart
                                        </li>
                                        <li>
                                            Console applications that receive CTRL_C_EVENT notification should shut down immediately.
                                            Drivers must not veto a system shutdown event
                                        </li>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        More information and guidance on requesting and responding to system shutdowns and the RestartManager is available
                                        <a href="http://go.microsoft.com/?linkid=9647506">HERE</a>.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='8'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        The following files have been scheduled to start with the OS when it is started in Safe Mode:
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>Safe mode allows users to diagnose and troubleshoot Windows. Unless needed
                                        for basic operations of the system (for example, storage device drivers) or for diagnostic and recovery
                                        purposes (for example, anti-virus scanners), drivers and services must not be set to load in safe mode.
                                        They could make it more difficult to troubleshoot the OS.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>Remove your entries from the following registry keys:
                                    </span>
                                    <ul style="list-style-type: circle;">
                                        <li>
                                            HKLM/System/CurrentControlSet/Control/SafeBoot/Minimal
                                        </li>
                                        <li>
                                            HKLM/System/CurrentControlSet/Control/SafeBoot/Network
                                        </li>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        Any application writing to these keys will require a waiver with business justification to pass this requirement.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                        <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:when test="$reqNdx='9'">
                    <xsl:choose>
                        <xsl:when test="$tstNdx='1'">
                            <li>
                                <div>
                                    <span>
                                       <xsl:if test="$tstRslt='WARNING'"><b>WARNING: </b> </xsl:if>
                                       <xsl:if test="$tstRslt='FAIL'"><b>ERROR: </b> </xsl:if>
                                        Application did not pass multiuser session compliance check.
                                    </span>
                                    <ul class="ulMessages">
                                      <xsl:apply-templates select="MESSAGES">
                                         <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                      </xsl:apply-templates>
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>IMPACT IF NOT FIXED: </b>The application’s installation might not be accessible or usable by multiple users.
                                    </span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span>
                                        <b>HOW TO FIX: </b>: Application installation should not store data files or settings to user specific data stores (User Profile, HKCU etc.). This would result in those settings and files being available only for the installing user. Installation should take care of machine-wide configuration and data files. Per-user files and settings should be created post-installation (either at user-login or first-run of the application) to ensure that files as well as settings are available to all users.
                                    </span>
                                </div>
                            </li>
                        </xsl:when>
                      <xsl:when test="$tstNdx='2'">
                        <li>
                          <div>
                            <span>
                              <xsl:if test="$tstRslt='WARNING'">
                                <b>WARNING: </b>
                              </xsl:if>
                              <xsl:if test="$tstRslt='FAIL'">
                                <b>ERROR: </b>
                              </xsl:if>
                              Application did not pass multiuser session compliance check.
                            </span>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>IMPACT IF NOT FIXED: </b>The application’s installation might not be accessible or usable by multiple users.
                            </span>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>HOW TO FIX: </b>: Application installation should not store data files or settings to user specific data stores (User Profile, HKCU etc.). This would result in those settings and files being available only for the installing user. Installation should take care of machine-wide configuration and data files. Per-user files and settings should be created post-installation (either at user-login or first-run of the application) to ensure that files as well as settings are available to all users.
                            </span>
                          </div>
                        </li>
                      </xsl:when>
                      <xsl:when test="$tstNdx='3'">
                        <li>
                          <div>
                            <span>
                              <xsl:if test="$tstRslt='WARNING'">
                                <b>WARNING: </b>
                              </xsl:if>
                              <xsl:if test="$tstRslt='FAIL'">
                                <b>ERROR: </b>
                              </xsl:if>
                              <xsl:if test="count(MESSAGES/MESSAGE) = 0">
                                  The application did not install any shortcuts.
                              </xsl:if>
                              <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                  Application invocation in multiple sessions did not pass.
                              </xsl:if>
                            </span>
                            <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">
                                <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                                </ul>
                            </xsl:if>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>IMPACT IF NOT FIXED: </b>Multiple windows users might not be able to launch the application seamlessly in concurrent sessions.
                            </span>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>HOW TO FIX: </b>: The application must not block launching multiple instances of the application across concurrent sessions both locally or remotely. Applications must not depend on global mutexes or other named-objects to check or block multiple instances. If multiple instances per user need to be blocked, then per-user or per-session namespaces must be used for mutexes or other named-objects.
                            </span>
                          </div>
                        </li>
                      </xsl:when>
                      <xsl:when test="$tstNdx='4'">
                        <li>
                          <div>
                            <span>
                              <xsl:if test="$tstRslt='WARNING'">
                                <b>WARNING: </b>
                              </xsl:if>
                              <xsl:if test="$tstRslt='FAIL'">
                                <b>ERROR: </b>
                              </xsl:if>
                              <xsl:if test="count(MESSAGES/MESSAGE) = 0">
                                  The application did not install any shortcuts.
                              </xsl:if>
                              <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                  Application did not pass multiuser session compliance check.
                              </xsl:if>
                            </span>
                            <xsl:if test="count(MESSAGES/MESSAGE) &gt; 0">                                       
                                <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                                </ul>
                            </xsl:if>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>IMPACT IF NOT FIXED: </b>Windows users might not be able to run the application seamlessly in concurrent sessions.
                            </span>
                          </div>
                        </li>
                        <li>
                          <div>
                            <span>
                              <b>HOW TO FIX: </b>: The application must support running multiple instances of the application across concurrent sessions both locally or remotely. The application should not require administrative privileges during runtime. Moreover, data and settings must not be shared across users or stored at a location that is shared across users. User data must be isolated to the users profile.
                            </span>
                          </div>
                        </li>
                      </xsl:when>                      
                      <xsl:otherwise>
                            <div>
                                <b>No additional information for </b>
                                <xsl:text> Requirement: </xsl:text>
                                <xsl:value-of select="$reqNdx"/>
                                <xsl:text> Test: </xsl:text>
                                <xsl:value-of select="$tstNdx"/>
                            </div>
                            <ul class="ulMessages">
                                    <xsl:apply-templates select="MESSAGES">
                                       <xsl:with-param name="testIndex" select="$uniqueTstId" />
                                    </xsl:apply-templates>
                            </ul>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                    <div>
                        <b>No additional information for </b>
                        <xsl:text> Requirement: </xsl:text>
                        <xsl:value-of select="$reqNdx"/>
                        <xsl:text> Test: </xsl:text>
                        <xsl:value-of select="$tstNdx"/>
                    </div>
                    <ul class="ulMessages">
                        <xsl:apply-templates select="MESSAGES">
                            <xsl:with-param name="testIndex" select="$uniqueTstId" />
                        </xsl:apply-templates>
                    </ul>
                </xsl:otherwise>
            </xsl:choose>
        </ul>
    </xsl:template>

    <xsl:template match="MESSAGES">
        <xsl:param name="testIndex" />
            <xsl:for-each select="MESSAGE">
                <xsl:choose>           
                    <xsl:when test="position() &lt;= 5">
                        <li xmlns="http://www.w3.org/1999/xhtml">
                            <xsl:value-of select="@TEXT" />
                        </li>
                    </xsl:when>    
                    <xsl:otherwise></xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
            <xsl:if test="count(MESSAGE) &gt; 5">
              <xsl:element name="span">
                <xsl:attribute name="style">
                  <xsl:text>display: none;</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="id">
                  <xsl:value-of select="$testIndex" />
                </xsl:attribute>
                <xsl:for-each select="MESSAGE">
                    <xsl:choose>           
                        <xsl:when test="position() &gt; 5">
                            <li xmlns="http://www.w3.org/1999/xhtml">
                              <xsl:value-of select="@TEXT" />
                            </li>
                        </xsl:when>
                    <xsl:otherwise></xsl:otherwise>
                  </xsl:choose>
                </xsl:for-each>
              </xsl:element>
              <li xmlns="http://www.w3.org/1999/xhtml">             
                  <xsl:element name="a">
                      <xsl:attribute name="id">
                        <xsl:text>LinkText_</xsl:text>
                        <xsl:value-of select="$testIndex" />
                      </xsl:attribute>         
                      <xsl:attribute name="href">
                            <xsl:text>javascript:ShowMessages('</xsl:text>
                            <xsl:value-of select="$testIndex" />
                            <xsl:text>')</xsl:text>
                      </xsl:attribute>                      
                      <xsl:text>Show More messages...</xsl:text>
                  </xsl:element>
               </li>
            </xsl:if>
    </xsl:template>

    <xsl:template match="WAIVERS">
        <div xmlns="http://www.w3.org/1999/xhtml" class="titleItem">
            <xsl:text>Waivers</xsl:text>
            <br />
        </div>
        <div xmlns="http://www.w3.org/1999/xhtml">
          <ul xmlns="http://www.w3.org/1999/xhtml" style="list-style-type: disc;">
            <xsl:apply-templates select="WAIVER">
            </xsl:apply-templates>
          </ul>
        </div>
    </xsl:template>

    <xsl:template match="WAIVER">
        <li>
            <div>
              <span>
                <b><xsl:value-of select="@REQUIREMENT" /></b>
                <xsl:text disable-output-escaping="yes">: </xsl:text>
                <xsl:value-of select="@INFORMATION" /><br />               
              </span>
            </div>
        </li>
    </xsl:template>
</xsl:stylesheet>