Microsoft KB Archive/838096

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

Article ID: 838096

Article Last Modified on 11/17/2006

-

APPLIES TO


 * Microsoft Windows Media Player 9 Series
 * Microsoft Windows Media Player 9 Series
 * Microsoft Windows Media Player 9 Series

-





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 &quot;Resolution&quot; 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 &quot;Cause&quot; 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 == &quot;FALSE&quot;) {   // Cannot verify that Proxysrvr01 is resolvable; try to use it anyway. return &quot;PROXY proxysrvr01:80&quot;; } else {   // This system is using WinInet or has had the update installed. if ( isResolvable(&quot;proxysrvr01&quot;) ) {       // Add additional logic. } }



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

Additional query words: WMP proxy PAC WinHTTP auto-proxy APC

Keywords: kbprb KB838096

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.