Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

winHTTP 5.1

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
US
I was reading the Microsoft KB on winHTTP5.1 They warn that if you reenter the process simultaneously, that it can corrupt the program.
Caution WinHTTP is not re-entrant except during asynchronous completion callback! This means that while a thread has a call pending to one of the WinHTTP functions such as WinHttpSendRequest, WinHttoReceiveResponse, WinHttpQueryDataAvailable, WinHttpSendData, or WinHttpWriteData, it must never call WinHTTP a second time until the first call has completed. One scenario under which a second call could occur is as follows: If an application queues an Asynchronous Procedure Call (APC) to the thread that's calling into WinHTTP, and if WinHTTP performs an alertable wait internally, the APC will get a chance to run. Now if the APC routine happens also to call WinHTTP, it re-enters the WinHTTP API, and the internal state of WinHTTP can be corrupted.

OK, I don't intend to do that, but just in case, is there a way to back up the program. Can I make a backup copies of winhttp.dll in my WINNT directory and simply replace them if I encounter any problems.

I am about to embark on some extensive testing of this program and don't want to mess anything up permanently.

Thanks

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top