Discussion:
HttpSendRequest problem with wininet.dll version 6.0.2800.1400 (21-1-2004)
(too old to reply)
Morten Pedersen
2004-03-04 13:35:49 UTC
Permalink
Hi,

I'm calling WinInet in the following sequence to retrieve data from an
client on a local network or the localhost:

InternetOpen->InternetConnect->HttpOpenRequest->HttpSendRequest.

Normally this works fine. But after I have updated my computer with the
lasest security update of IExplore (KB832894 - Q832894) it doesn't work any
more. The HttpSendRequest returns 0 = FAIL (before the update it returns 1 =
OK). But when i call GetLastError just after it also returns 0 (i think that
means no error?). So i have no idea of why the call isn't OK.

I have noticed that my version of wininet.dll has changed from 6.0.2800.1106
(31-3-2003) to 6.0.2800.1400 (21-1-2004). I have seached msdn and
microsoft.com for changes in the version change of the wininet.dll, but i
didn't get any usefull answers.

Is this call not posible any more? Is there any changes in the functionality
of this call? Cound it be some settings om my computer that is changed
during the update? Is there a solution to this problem?

I have tried to uninstall the IE update, and then my application works
again. But my application need to be independed of these security updates.

Morten Pedersen
EMonaco
2004-03-04 20:35:25 UTC
Permalink
Morten,

HttpSendRequest() is still a valid function. 6.0.2800.1400 from Q832894
has a couple of issues as I've recently discovered. Are you using a URL
that includes username / password for authentication? Because of security
issues- that is prohibited now. If not can you provide more details- URL?
Snippet of code having the problem? etc.

Erin.
Post by Morten Pedersen
Hi,
I'm calling WinInet in the following sequence to retrieve data from an
InternetOpen->InternetConnect->HttpOpenRequest->HttpSendRequest.
Normally this works fine. But after I have updated my computer with the
lasest security update of IExplore (KB832894 - Q832894) it doesn't work any
more. The HttpSendRequest returns 0 = FAIL (before the update it returns 1 =
OK). But when i call GetLastError just after it also returns 0 (i think that
means no error?). So i have no idea of why the call isn't OK.
I have noticed that my version of wininet.dll has changed from
6.0.2800.1106
Post by Morten Pedersen
(31-3-2003) to 6.0.2800.1400 (21-1-2004). I have seached msdn and
microsoft.com for changes in the version change of the wininet.dll, but i
didn't get any usefull answers.
Is this call not posible any more? Is there any changes in the
functionality
Post by Morten Pedersen
of this call? Cound it be some settings om my computer that is changed
during the update? Is there a solution to this problem?
I have tried to uninstall the IE update, and then my application works
again. But my application need to be independed of these security updates.
Morten Pedersen
Morten Pedersen
2004-03-05 09:08:37 UTC
Permalink
Hi Erin.

Thanks for your help. Here are some details about my communication. Im
calling the sequence with the folllowing parameters.

HINTERNET InternetOpenA(
LPCTSTR lpszAgent, "LabVIEW WinInet Driver"
DWORD dwAccessType, 0
LPCTSTR lpszProxyName, ""
LPCTSTR lpszProxyBypass, ""
DWORD dwFlags 0
);

HINTERNET InternetConnect(
HINTERNET hInternet, HINTERNET InternetOpenA
LPCTSTR lpszServerName, "localhost/application" or "server1/application"
INTERNET_PORT nServerPort, 80
LPCTSTR lpszUsername, ""
LPCTSTR lpszPassword, ""
DWORD dwService, HTTP
DWORD dwFlags, 0
DWORD_PTR dwContext 0
);

HINTERNET HttpOpenRequestA(
HINTERNET hConnect, HINTERNET InternetConnect
LPCTSTR lpszVerb, "POST"
LPCTSTR lpszObjectName, ""
LPCTSTR lpszVersion, ""
LPCTSTR lpszReferer, ""
LPCTSTR* lpszAcceptTypes, 0
DWORD dwFlags, 0
DWORD_PTR dwContext 0
);

BOOL HttpSendRequest(
HINTERNET hRequest, HINTERNET HttpOpenRequestA
LPCTSTR lpszHeaders, "blabla"
DWORD dwHeadersLength, 6
LPVOID lpOptional, "klaklak"
DWORD dwOptionalLength 7
);

Is the problem the empty username and password in InternetConnect?

I hope you can help me...

Best regards,

Morten Pedersen
Post by EMonaco
Morten,
HttpSendRequest() is still a valid function. 6.0.2800.1400 from Q832894
has a couple of issues as I've recently discovered. Are you using a URL
that includes username / password for authentication? Because of security
issues- that is prohibited now. If not can you provide more details- URL?
Snippet of code having the problem? etc.
Erin.
Post by Morten Pedersen
Hi,
I'm calling WinInet in the following sequence to retrieve data from an
InternetOpen->InternetConnect->HttpOpenRequest->HttpSendRequest.
Normally this works fine. But after I have updated my computer with the
lasest security update of IExplore (KB832894 - Q832894) it doesn't work
any
Post by Morten Pedersen
more. The HttpSendRequest returns 0 = FAIL (before the update it returns
1
Post by EMonaco
=
Post by Morten Pedersen
OK). But when i call GetLastError just after it also returns 0 (i think
that
Post by Morten Pedersen
means no error?). So i have no idea of why the call isn't OK.
I have noticed that my version of wininet.dll has changed from
6.0.2800.1106
Post by Morten Pedersen
(31-3-2003) to 6.0.2800.1400 (21-1-2004). I have seached msdn and
microsoft.com for changes in the version change of the wininet.dll, but i
didn't get any usefull answers.
Is this call not posible any more? Is there any changes in the
functionality
Post by Morten Pedersen
of this call? Cound it be some settings om my computer that is changed
during the update? Is there a solution to this problem?
I have tried to uninstall the IE update, and then my application works
again. But my application need to be independed of these security updates.
Morten Pedersen
EMonaco
2004-03-05 14:29:19 UTC
Permalink
Morten,
Post by Morten Pedersen
Is the problem the empty username and password in InternetConnect?
No, that works in code I've run under 6.0.2800.1400. Also it appears that
you are not passing username/password as part of the URL which as of
6.0.2800.1400 is NOT allowed. So thats not your issue.
Post by Morten Pedersen
HINTERNET InternetConnect(
HINTERNET hInternet, HINTERNET InternetOpenA
LPCTSTR lpszServerName, "localhost/application" or
"server1/application"
Post by Morten Pedersen
INTERNET_PORT nServerPort, 80
LPCTSTR lpszUsername, ""
LPCTSTR lpszPassword, ""
DWORD dwService, HTTP
DWORD dwFlags, 0
DWORD_PTR dwContext 0
);
Your ServerName looks odd. typically this would just be localhost or
www.server1.com (.net or .whatever).
Looks like your putting the resource path (ie; /application) where I'd
recommend you put it in the HTTPOpenRequest()
Post by Morten Pedersen
HINTERNET HttpOpenRequestA(
HINTERNET hConnect, HINTERNET InternetConnect
LPCTSTR lpszVerb, "POST"
LPCTSTR lpszObjectName, ""
LPCTSTR lpszVersion, ""
LPCTSTR lpszReferer, ""
LPCTSTR* lpszAcceptTypes, 0
DWORD dwFlags, 0
DWORD_PTR dwContext 0
ObjectName should be the path to the resource (ie;
"/application/updatestuff.php"), etc.
Is 7 bytes really the size of your post content? I vaguely recall a
documented issue with posting small amounts of data (80 bytes or less or
somesuch) potentially causing problems...

Other than that I'm not sure what the issue is, I've had an issue where a
function failed and I logged the error, only to discover that it
"apparently" returned ERROR_SUCCESS. Turns out what it was is that the
logging code was making API calls and the real error was being lost. I
change my code so the logging function is passed in the error code. That
way, when a call fails, I immediately call my log function as follows:
LogPrintf( LogFileName, "The following error %d has occurred!",
GetLastError()); Thus ensuring that no API calls in the logging routine,
etc. (on this thread) could "reset" the error code back to zero. I mention
this only because I've never seen HttpSendRequest() return FAILED, with an
error of ERROR_SUCCESS. Even on 1400.

Erin.
Stephen Sulzer
2004-03-04 20:41:36 UTC
Permalink
Hello,

It seems that the patch for 832894 has broken WinInet.dll in some scenarios.
There is a patch to fix these problems; it updates the WinInet.dll to
version 6.0.2800.1405. See KB article Q831167:

http://support.microsoft.com/default.aspx?kbid=831167


Stephen
Post by Morten Pedersen
Hi,
I'm calling WinInet in the following sequence to retrieve data from an
InternetOpen->InternetConnect->HttpOpenRequest->HttpSendRequest.
Normally this works fine. But after I have updated my computer with the
lasest security update of IExplore (KB832894 - Q832894) it doesn't work any
more. The HttpSendRequest returns 0 = FAIL (before the update it returns 1 =
OK). But when i call GetLastError just after it also returns 0 (i think that
means no error?). So i have no idea of why the call isn't OK.
I have noticed that my version of wininet.dll has changed from
6.0.2800.1106
Post by Morten Pedersen
(31-3-2003) to 6.0.2800.1400 (21-1-2004). I have seached msdn and
microsoft.com for changes in the version change of the wininet.dll, but i
didn't get any usefull answers.
Is this call not posible any more? Is there any changes in the
functionality
Post by Morten Pedersen
of this call? Cound it be some settings om my computer that is changed
during the update? Is there a solution to this problem?
I have tried to uninstall the IE update, and then my application works
again. But my application need to be independed of these security updates.
Morten Pedersen
Morten Pedersen
2004-04-14 09:56:53 UTC
Permalink
Hi Stephen,

This update dosn't solve the problem. The only way was to use an old version
of wininet.dll.

Morten Pedersen
Post by Stephen Sulzer
Hello,
It seems that the patch for 832894 has broken WinInet.dll in some scenarios.
There is a patch to fix these problems; it updates the WinInet.dll to
http://support.microsoft.com/default.aspx?kbid=831167
Stephen
Post by Morten Pedersen
Hi,
I'm calling WinInet in the following sequence to retrieve data from an
InternetOpen->InternetConnect->HttpOpenRequest->HttpSendRequest.
Normally this works fine. But after I have updated my computer with the
lasest security update of IExplore (KB832894 - Q832894) it doesn't work
any
Post by Morten Pedersen
more. The HttpSendRequest returns 0 = FAIL (before the update it returns
1
Post by Stephen Sulzer
=
Post by Morten Pedersen
OK). But when i call GetLastError just after it also returns 0 (i think
that
Post by Morten Pedersen
means no error?). So i have no idea of why the call isn't OK.
I have noticed that my version of wininet.dll has changed from
6.0.2800.1106
Post by Morten Pedersen
(31-3-2003) to 6.0.2800.1400 (21-1-2004). I have seached msdn and
microsoft.com for changes in the version change of the wininet.dll, but i
didn't get any usefull answers.
Is this call not posible any more? Is there any changes in the
functionality
Post by Morten Pedersen
of this call? Cound it be some settings om my computer that is changed
during the update? Is there a solution to this problem?
I have tried to uninstall the IE update, and then my application works
again. But my application need to be independed of these security updates.
Morten Pedersen
Loading...