WinInet hangs when connecting to web page at InitInstance of OCX

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello all. I have a small problem. The problem might be small, but I have
alot of background information that I have found so far.

Basics:
I have an Active X Control (Plot.ocx) that has troubles connecting to a web
server through WinInet. During the InitInstance of the OCX, I am verifying a
specific setting on a web page (POST to ASP page) before allowing Plot.ocx to
initialize. If the resulting page from the POST returns an improper value or
it turned off I do not allow the control to properly load or be used. If it
is set, or the connection could not be made, I allow it to be loaded with
limited functionality.

A little more advanced:
When this problem offically came across my desk, I was dumbfounded. This
problem only happens if the Internet Explorer setting "Automatically Detect
Settings" is selected (IE -> Tools -> Internet Options -> Connections(tab)
-> LAN Settings (button)) . If it isn't selected, everything works like it
should.

If it is selected, it hangs on the function call HTTPSendRequest function
call. We are currently latebinding to that call and all other WinInet calls,
for ease of management for each internet connection. (It doesn't hang when
the Automatically Detect Settings is turned off.)

Advanced as I know how:
I decided to create a debug situation where I can use Windbg to attach to
the process to see what was actually happening. Me not being to
knowledgeable about windbg, I just created a quick compile with a MessageBox
before any of the WinInet calls. This allowed me to attach to the process
"regsvr32.exe" and see what was going on. This is what I got:

[snip]
ModLoad: 01000000 01005000 C:\WINDOWS\system32\regsvr32.exe
ModLoad: 7c900000 7c9b0000 C:\WINDOWS\system32\ntdll.dll
ModLoad: 7c800000 7c8f4000 C:\WINDOWS\system32\kernel32.dll
ModLoad: 77c10000 77c68000 C:\WINDOWS\system32\msvcrt.dll
ModLoad: 77dd0000 77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
ModLoad: 77e70000 77f01000 C:\WINDOWS\system32\RPCRT4.dll
ModLoad: 77d40000 77dd0000 C:\WINDOWS\system32\USER32.dll
ModLoad: 77f10000 77f57000 C:\WINDOWS\system32\GDI32.dll
ModLoad: 774e0000 7761d000 C:\WINDOWS\system32\ole32.dll
ModLoad: 5cb70000 5cb96000 C:\WINDOWS\system32\ShimEng.dll
ModLoad: 6f880000 6fa4a000 C:\WINDOWS\AppPatch\AcGenral.DLL
ModLoad: 76b40000 76b6d000 C:\WINDOWS\system32\WINMM.dll
ModLoad: 77120000 771ac000 C:\WINDOWS\system32\OLEAUT32.dll
ModLoad: 77be0000 77bf5000 C:\WINDOWS\system32\MSACM32.dll
ModLoad: 77c00000 77c08000 C:\WINDOWS\system32\VERSION.dll
ModLoad: 7c9c0000 7d1d5000 C:\WINDOWS\system32\SHELL32.dll
ModLoad: 77f60000 77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
ModLoad: 769c0000 76a73000 C:\WINDOWS\system32\USERENV.dll
ModLoad: 5ad70000 5ada8000 C:\WINDOWS\system32\UxTheme.dll
ModLoad: 20000000 2000c000 C:\WINDOWS\system32\MARX_DEV.DLL
ModLoad: 773d0000 774d2000
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
ModLoad: 5d090000 5d127000 C:\WINDOWS\system32\comctl32.dll
ModLoad: 10000000 10167000 C:\WINDOWS\system32\nview.dll
ModLoad: 76bf0000 76bfb000 C:\WINDOWS\system32\PSAPI.DLL
ModLoad: 77690000 776b1000 C:\WINDOWS\system32\NTMARTA.DLL
ModLoad: 76f60000 76f8c000 C:\WINDOWS\system32\WLDAP32.dll
ModLoad: 71bf0000 71c03000 C:\WINDOWS\system32\SAMLIB.dll
ModLoad: 00940000 00963000 C:\Documents and
Settings\MyProfile\Desktop\Plot\Plot\DebugU\Plot.ocx
ModLoad: 25da0000 25dd2000 C:\WINDOWS\system32\SKCA32.dll
ModLoad: 71ad0000 71ad9000 C:\WINDOWS\system32\WSOCK32.dll
ModLoad: 71ab0000 71ac7000 C:\WINDOWS\system32\WS2_32.dll
ModLoad: 71aa0000 71aa8000 C:\WINDOWS\system32\WS2HELP.dll
ModLoad: 76d60000 76d79000 C:\WINDOWS\system32\iphlpapi.dll
ModLoad: 5f800000 5f8f0000 C:\WINDOWS\system32\MFC42uD.DLL
ModLoad: 10200000 1026c000 C:\WINDOWS\system32\MSVCRTD.dll
ModLoad: 5f500000 5f5cd000 C:\WINDOWS\system32\MFCO42uD.DLL
ModLoad: 00a20000 00a35000 C:\WINDOWS\system32\nvwddi.dll
ModLoad: 61210000 6121f000 C:\Program Files\Microsoft
Hardware\Mouse\POINT32.dll
ModLoad: 61220000 61232000 C:\Program Files\Microsoft
Hardware\Mouse\MSH_ZWF.dll
Break-in sent, waiting 30 seconds...
ModLoad: 16000000 16028000 C:\Program Files\Trillian\events.dll
ModLoad: 763b0000 763f9000 C:\WINDOWS\system32\comdlg32.dll
ModLoad: 7c340000 7c396000 C:\Program Files\Trillian\MSVCR71.dll
ModLoad: 771b0000 77256000 C:\WINDOWS\system32\WinInet.DLL
ModLoad: 77a80000 77b14000 C:\WINDOWS\system32\CRYPT32.dll
ModLoad: 77b20000 77b32000 C:\WINDOWS\system32\MSASN1.dll
ModLoad: 77fe0000 77ff1000 C:\WINDOWS\system32\Secur32.dll
ModLoad: 77260000 772ff000 C:\WINDOWS\system32\urlmon.dll
ModLoad: 76ee0000 76f1c000 C:\WINDOWS\system32\RASAPI32.DLL
ModLoad: 76e90000 76ea2000 C:\WINDOWS\system32\rasman.dll
ModLoad: 5b860000 5b8b4000 C:\WINDOWS\system32\NETAPI32.dll
ModLoad: 76eb0000 76edf000 C:\WINDOWS\system32\TAPI32.dll
ModLoad: 76e80000 76e8e000 C:\WINDOWS\system32\rtutils.dll
ModLoad: 77c70000 77c93000 C:\WINDOWS\system32\msv1_0.dll
ModLoad: 722b0000 722b5000 C:\WINDOWS\system32\sensapi.dll
WARNING: Break-in timed out, suspending.
This is usually caused by another thread holding the loader lock
(2278.2274): Wake debugger - code 80000007 (first chance)
eax=0007cfa8 ebx=0007ce00 ecx=000afa78 edx=7723973c esi=00000000 edi=7ffdf000
eip=7c90eb94 esp=0007cdd8 ebp=0007ce74 iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\ntdll.dll -
ntdll!KiFastSystemCallRet:
7c90eb94 c3 ret
[/snip]

Any thoughts? Looking into this, I see "WARNING: Break-in timed out,
suspending. This is usually caused by another thread holding the loader
lock", which might be caused by the fact that I am currently locking
something by actually registering the component with Regsvr32.exe and it is
trying to lock it again when loading settings required by the "Automatically
Detect Settings" option.

I'm totally lost on this one. Help please.

-Brian





.


Quantcast