Compartir a través de


IWMSInternalAdminNetSource::FindProxyForURL method (wmsinternaladminnetsource.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The FindProxyForURL method finds a proxy server name and port to use for the client.

Syntax

HRESULT FindProxyForURL(
  [in]      BSTR  bstrProtocol,
  [in]      BSTR  bstrHost,
  [out]     BOOL  *pfProxyEnabled,
  [out]     BSTR  *pbstrProxyServer,
  [out]     DWORD *pdwProxyPort,
  [in, out] DWORD *pdwProxyContext
);

Parameters

[in] bstrProtocol

String containing the protocol for which to find the proxy server. Typically, this is either "http" or "mms".

[in] bstrHost

String containing the DNS name or IP address of the server with which you want to communicate. Depending upon the server, the proxy might be different.

[out] pfProxyEnabled

Pointer to a Boolean value that is True if the user has enabled a proxy that applies to the specified protocol and host.

[out] pbstrProxyServer

Pointer to a string containing the proxy server DNS name.

[out] pdwProxyPort

Pointer to a DWORD containing the proxy port number.

[in, out] pdwProxyContext

DWORD representing the proxy server returned. You can make multiple calls to FindProxyForURL to find all configured proxy servers. On your first call, set the context to zero. When the call returns, the context is set to a value representing the proxy for which information was returned. On the next call, set the context to the context value retrieved on the first call. Continue this process until the call returns S_FALSE.

This method has internal algorithms that determine how it looks for proxy servers. You can override this and make it find the proxy server set by the client's Web browser, by setting the context to 3.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
S_FALSE
When calling this method multiple times to find all proxies configured, this value is returned when there are no more configured proxy servers.

Remarks

When you have finished making calls to FindProxyForURL, you must call IWMSInternalAdminNetSource::ShutdownProxyContext to free the internal resources used.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsinternaladminnetsource.h
Library Wmvcore.lib; WMStubDRM.lib (if you use DRM)

See also

IWMSInternalAdminNetSource Interface