Windows Media Player may not connect while using proxy auto-configuration (PAC) scripts (838096)



The information in this article applies to:

  • Microsoft Windows Media Player 9 Series for Windows XP
  • Microsoft Windows Media Player 9 Series for Windows Server 2003
  • Microsoft Windows Media Player 9 Series for Windows 2000

This article discusses why Windows Media Player 9 Series may not use the expected proxy server as defined by a proxy auto-configuration script.

SYMPTOMS

When you use a proxy auto-configuration (.pac) script to automatically configure the proxy settings for Microsoft Windows Media Player, the player may not connect to a server, or may not correctly connect through the proxy server that you expect.

Note A .pac file is also known as an autoproxy configuration (APC) file.

This problem does not occur when you use the same APC file with Microsoft Internet Explorer or with Windows Media Player version 6.4.

CAUSE

This problem occurs because the WinHTTP DLL returns FALSE values for the following three functions:
  • isResolvable
  • dnsResolve
  • myIpAddress
Typically, the script does not have error checking for these functions. The lack of error checking causes the APC file to fail and to return an error in Windows Media Player.

This problem occurs on platforms where Windows Media Player uses WinHTTP for proxy auto-discovery to parse the .pac files.

This problem does not occur with Internet Explorer because Internet Explorer uses WinInet for the proxy auto-discovery functions.

For more information, see the "Resolution" section.

RESOLUTION

For additional information about the hotfix for WinHTTP that resolves this problem, click the following article number to view the article in the Microsoft Knowledge Base:

816941 Auto proxy functions: isResolvable, dnsResolve, and myIpAddress do not work as you expect

WORKAROUND

To work around this problem by using script, use the following method for the functions that are listed in the "Cause" section:
  • When a function is called, determine whether the value returned 'FALSE'.
The following code demonstrates how to determine whether the value returned 'FALSE'.
// Check whether the WinHTTP system has had the update installed.
if (myIpAddress() == "FALSE")
{
    // Cannot verify that Proxysrvr01 is resolvable; try to use it anyway.
    return "PROXY proxysrvr01:80";
} 
else 
{
    // This system is using WinInet or has had the update installed.
    if ( isResolvable("proxysrvr01") )
    {
        // Add additional logic.
    }
}

MORE INFORMATION

To reproduce the problem, use the following typical APC script:
function FindProxyForURL(url, host) 
{ 
       if (isResolvable("PROXYSVR01"))
       { 
              if ( isInNet(host, "10.0.0.0", "255.0.0.0"))
                     return "DIRECT";
              if (isPlainHostName(host))
                     return "DIRECT";
              if (isInNet(host, "127.0.0.1", "255.255.255.255"))
                     return "DIRECT";
              else 
                     return "PROXY proxysvr01:80"; 
       }
       else 
              return "PROXY DIRECT"; 
}

Modification Type:MajorLast Reviewed:3/24/2004
Keywords:kbprb KB838096 kbAudDeveloper kbAudITPRO