prasad_ark

Hi,

I have a pluggable protocol dll that works when IE6 is installed, but does not when IE7 is installed. The protocol is used by an application that hosts the web browser control. It is used to redirect http requests to a specific machine's IIS. The protocol begins with "PWS://", but the pluggable protocol changes it to "http://<machine-name>" based on internal settings known about the configuration of a work group. The changed URL is then passed to an instance of the machines http handler.

The trouble is with the IInternetProtocol:Tongue Tiedtart method. In IE6, when the http version of the URL is passed to the http handler's Start implementation, everything proceeds okay. In IE7, the http handler's Start implementation returns 0x800401E4 (Invalid Syntax). Stepping through the assembly code of the http handler in WinDbg, it seems that the IE7 version of the http handler gets an 0x800C0002 (INET_E_INVALID_URL) error in its CUrl:Stick out tonguearseUrlEx method because it attempts to use the "maestro://" version of the URL from a class member variable even though the "http://<machine-name>" version was passed as the szUrl parameter.

Here is our IInternetProtocol:Tongue Tiedtart implementation in C++:

//IInternetProtocol
STDMETHODIMP CCMirrorHttpPP:Tongue Tiedtart(
LPCWSTR szUrl,
IInternetProtocolSink *pIProtSink,
IInternetBindInfo *pIBindInfo,
DWORD grfSTI,
DWORD dwReserved)
{
HRESULT hr = S_OK;

_TCHAR* szwBuff = NULL;

if (ChangeSUrlToHttp(szUrl, &szwBuff))
{
hr = m_pIInternetP->Start(szwBuff, pIProtSink, pIBindInfo, grfSTI, dwReserved);
free(szwBuff);
}
else hr = E_OUTOFMEMORY;

return hr;
}

The m_pIInternetP is the pointer to the machine's http handler COM object created by CoCreateInstance on the GUID contained in the registry's HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\PROTOCOLS\\Handler\\http key.

Thanks.




Re: Internet Explorer Extension Development IInternetProtocol Start Method working in IE6, does not in IE7

Stijn Sanders

Since IE7, Microsoft added an IInternetProtocolEx interface with a StartEx method, that has a pointer extra

http://msdn2.microsoft.com/en-us/library/aa767879.aspx