I guess, I know why WinHTTP does import WinInet functions directly.
Imagine an application which is sending http requests over Wininet AND
WinHTTP. Assume, that WinHTTP.dll imports functions of WinInet.dll. In this
case, the global wininet data (variables) will be common, because both
wininet.dll and winhttp.dll are loaded into the same process, and they share
the same address space. It means, that theoretically, an application will be
able to set-up request using WinInet functions (InternetOpen,
InternetConnect, HttpOpenRequest, HttpSendRequest) but process it using
WinHTTP functions (calling WinHTTPReadData with handle returned from WinInet
HttpOpenRequest). This behaviour will be incorrect wrong, and confusing.
This probably one of the reasons they decided to separate things.
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Volodymyr M. Shcherbyna" <***@online.mvps.org> wrote in message news:***@TK2MSFTNGP03.phx.gbl...
Don't hesitate to weakup this topic again. MSFT made an real puzzle :)
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Paul Baker [MVP, Windows - SDK]" <***@community.nospam>
wrote in message news:OuR32%***@TK2MSFTNGP05.phx.gbl...
Oooh. This is what you want me to read. Okay, I have to do some research
myself. Thanks,
Paul
"Volodymyr M. Shcherbyna" <***@online.mvps.org> wrote in message news:***@TK2MSFTNGP05.phx.gbl...
I did more research.
1. WinHttpOpen maps into WinInet function InternetOpenA - there is no
dependency to wininet.dll, probably, because of project settings, the
function is "included" into winhttp.dll. I can tell for sure, because I see
in disassembly of winhttp.dll that the code is originally the wininet
version.
2. WinHttpQueryOption maps internally into ***@16 :
.text:4D4FEB89 push eax ; lpBuffer
.text:4D4FEB8A push 26h ; dwOption
.text:4D4FEB8C push [ebp+hInternet] ; hInternet
.text:4D4FEB92 call ***@16 ;
InternetQueryOptionA(x,x,x,x)
.text:4D4FEB97 mov [ebp+var_424], eax
.text:4D4FEB9D test eax, eax
Which is an absolute equivalent to wininet version.
3. WinHttpConnect - converts paramters from unicode to ansi and
delegates the call to InternetConnectA.
The function is an included but original version of WinInet
InternetConnectA:
.text:4D4F98F6 push ebx ; lpszUserName
.text:4D4F98F7 push dword ptr [ebp+nServerPort] ;
nServerPort
.text:4D4F98FA push [ebp+lpszServerName] ;
lpszServerName
.text:4D4F98FD push [ebp+hInternet] ; hInternet
.text:4D4F9900 call ***@20 ;
InternetConnectA(x,x,x,x,x)
.text:4D4F9905 mov edi, eax
And so on. So, the short answer: wininet and winhttp has the common core
functions sets. However, WinHTTP includes the Wininet functions without
referencing wininet.dll in it's import table.
Paul, you can check this by checking the implementation of "internal"
wininet functions which are called by WinHTTP wrappers: they are the same as
wininet equivalents.I suppose, this was done in order to save time to
develop WinHTTP from scratch.
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights."Paul Baker [MVP, Windows - SDK]"
<***@community.nospam> wrote in message news:***@TK2MSFTNGP06.phx.gbl...
Hmmm.
I see a lot of similarly named functions in the source code, it's
tricky to see which one is the exported one and what you're really looking
at.
So.. for those who are reading... WinHTTP does not use WinInet.
Right??
Paul
"Volodymyr M. Shcherbyna" <***@online.mvps.org> wrote in
message news:***@TK2MSFTNGP04.phx.gbl...
I take my words back. WinHTTP does not delegate into WinInet
functions, I was confused by the internal names of WinHTTP functions, they
are WinInet like. I look at imports of winhttp.dll, and found my mistake: no
imports from wininet.dll. Sorry.
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights."Paul Baker [MVP, Windows - SDK]"
<***@community.nospam> wrote in message news:***@TK2MSFTNGP04.phx.gbl...
Volodymyr,
Oh really? I am disillusioned now. Sorry for doubting you. This
really should be clearer in the documentation.
Is it calling internal variations of WinInet requests that
bypassing or adjusting some client type stuff like (off the top of my head)
authentication, cookies, HTTP redirection (especially to FTP), connection
limit, MIMe type handling, dialogs and UI stuff, etc.? Or just calling
"real" WinInet?
Even in Vista?
Paul
"Volodymyr M. Shcherbyna" <***@online.mvps.org> wrote in
message news:***@TK2MSFTNGP05.phx.gbl...
Hello Paul,
Use your MVP benefit, and access codepremium center. Take a look
at the implementation of the following functions,
a) WinHttpOpen - converts parameters from ansi to unicode and
delegates call to InternetOpenA
b) WinHttpQueryOption - converts parameters from ansi to
unicode, and delegates call to InternetQueryOptionA
c) WinHttpConnect - converts paramters from unicode to ansi and
delegates the call to InternetConnectA
d) WinHttpOpenRequest - converts paramters from unicode to ansi
and delegates call to HttpOpenRequestA
e) WinHttpSendRequest - converts params to ansi :), and
delegates call to HttpWrapSendRequest, which, internally calls quite a big
amount of wininet functions
f) WinHttpCloseHandle - delegates call to InternetCloseHandle
This list may be continued.
--
V.
This posting is provided "AS IS" with no warranties, and confers
no
rights.
"Paul Baker [MVP, Windows - SDK]"
<***@community.nospam> wrote in message news:%***@TK2MSFTNGP02.phx.gbl...
With all due respect, I don't think that is true. WinHTTP is
billed as a server-side HTTP implementation to replace the client-oriented
WinInet. It could not do some of the things it does if it used WinInet.
http://msdn2.microsoft.com/en-us/library/aa382925.aspx
Paul
"Volodymyr M. Shcherbyna" <***@online.mvps.org>
wrote in message news:***@TK2MSFTNGP02.phx.gbl...
FYI: WinHTTP is based on WinInet. Quite a big amount of
WinHTTP code simply delegates execution into WinInet equivalented functions.
--
V.
This posting is provided "AS IS" with no warranties, and
confers no
rights.
"mike" <***@m.com> wrote in message news:***@TK2MSFTNGP02.phx.gbl...
I ported toWinHTTP and am no longer able to replicate the
problem.
It was very easy and works very well, I like it.
"mike" <***@m.com> wrote in message news:***@TK2MSFTNGP04.phx.gbl...
Hello,
I am having trouble with an intermittent error. We're
using WinInet in an ocx on a web page.
When the rather busy web page is building and the ocx
additionally makes its (blocking) HttpOpenRequest to "GET" some additional
data for the UI, the HttpSendRequest is sometimes failing with "operation
timed out."
I've not been able to recover from this while in the
ocx's current thread.
That is to say after timing out, I've tried to
gracefully break down all the connection handles and reestablish all new
ones but still end up timing out on HttpSendRequest. I have tried the sample
code from earlier versions of IE that makes a new thread, to no avail. And
have tried a Sleep() to perhaps let the web page get some of it's work out
of the way.
Iv'e looked at it the traffic and nothing eminates from
the client on the HttpSendRequest.
Nothing seems to work, if it timesout once, that is it?
Any info would surely be appreciated, Thnx
- Mike