Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2006 Sep : CInternetSession Fails to create under IE7RC1, Beta3,2 and 1

www.cryer.info
Managed Newsgroup Archive

CInternetSession Fails to create under IE7RC1, Beta3,2 and 1

Subject:CInternetSession Fails to create under IE7RC1, Beta3,2 and 1
Posted by:"Jase" (jasebroo..@hotmail.com)
Date:Sat, 2 Sep 2006 09:46:07

Hi,

I understand this is a common issue, I have raised cases under the Microsoft
Connect Bugs database (192358, 176476, 176476, 67139, 71152, 75086), yet
they seem keen to close the cases off without fixing them.  This should be a
simple issue to resolve.  However I am asking for help from the news group
to either vote for the issue to nudge MS along to fix the API, or can anyone
advise a way I can achieve the same with IE7.

Details are:-

Reproduction Steps

     Call is set up as follows :-

     class CMyInternetSession : public CInternetSession
     {
     public:
     CMyInternetSession(LPCTSTR pstrAgent = NULL,
     DWORD dwContext = 1,
     DWORD dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG,
     LPCTSTR pstrProxyName = NULL,
     LPCTSTR pstrProxyBypass = NULL,
     DWORD dwFlags = INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD) :
CInternetSession(pstrAgent, dwContext,
     dwAccessType,
     pstrProxyName,
     pstrProxyBypass,
     dwFlags) {}
     virtual void OnStatusCallback(DWORD dwContext, DWORD dwInternetStatus,
     LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
     private:
     void SetStatusText(char *mess);
     };

    Now
     CMyInternetSession session(NULL,
     1,
     INTERNET_OPEN_TYPE_PROXY|INTERNET_OPEN_TYPE_PRECONFIG,
     ProxyServer,
     NULL,INTERNET_FLAG_DONT_CACHE);
     //session.EnableStatusCallback(TRUE); // Enable Status Callbacks for
Async Operation
     CHttpConnection*
pConnection=session.GetHttpConnection(m_Server,m_Port,m_Username,m_Password);
     CHttpFile* pFile=pConnection->OpenRequest(1,m_Object);


Expected Results

    A Handle is returned for the CInternetSession, however an exception is
thrown, the call fails, debug details below
    Expected Results


     An Internet Handle is achieved.
     Having run through the API call using a debugger I found the following
     00636DA5 8B 4D 1C mov ecx,dword ptr [dwFlags]
     00636DA8 51 push ecx
     00636DA9 8B 55 18 mov edx,dword ptr [pstrProxyBypass]
     00636DAC 52 push edx
     00636DAD 8B 45 14 mov eax,dword ptr [pstrProxyName]
     00636DB0 50 push eax
     00636DB1 8B 4D 10 mov ecx,dword ptr [dwAccessType]
     00636DB4 51 push ecx
     00636DB5 8B 55 08 mov edx,dword ptr [pstrAgent]
     00636DB8 52 push edx
     00636DB9 FF 15 24 64 72 00 call dword ptr [__imp__InternetOpenA@20
(726424h)]
     00636DBF 8B 4D F0 mov ecx,dword ptr [this]
     00636DC2 89 41 08 mov dword ptr [ecx+8],eax
     00636DC5 8B 55 F0 mov edx,dword ptr [this]
     00636DC8 83 7A 08 00 cmp dword ptr [edx+8],0
     00636DCC 75 10 jne CInternetSession::CInternetSession+0B9h (636DDEh)
     00636DCE 6A 00 push 0
     00636DD0 8B 45 F0 mov eax,dword ptr [this]
     00636DD3 8B 48 04 mov ecx,dword ptr [eax+4]
     00636DD6 51 push ecx
     00636DD7 E8 C1 A5 E9 FF call AfxThrowInternetException (4D139Dh)


     The CInternetSession fails to create an instance which throws the
CInternetException 87 I have tried the compilation in both Visual Studio
.Net 2002 and Visual Studio 6.0 both the same condition.


     I conclude this is a bug and is the route cause of the following bugs
raised
     176476
     67139
     71152
     75086

Replies:

www.cryer.info
Managed Newsgroup Archive