Home » Windows OS

InternetOpenUrl hangs once in a while (WinInet: 6.00.3790.3959)


We have an aplication (windows service) which uses InternetOpenUrl to download a file from a webserver. Once in a while, and only on Windows 2003 SP2 the function hangs. After performing some debugging it seems that one of the functions in its call stack is waiting on a mutex with INFINITE as a timeout.

Here is the stack trace from WinDbg

0824ed78 7c827d0b 77e61d1e 00000a10 00000000 ntdll!KiFastSystemCallRet

0824ed7c 77e61d1e 00000a10 00000000 00000000 ntdll!NtWaitForSingleObject+0xc

0824edec 77e61c8d 00000a10 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0xac

0824ee00 772149e5 00000a10 ffffffff 00000001 kernel32!WaitForSingleObject+0x12

0824ee18 77214949 0824ee38 00000001 00000000 WININET!URL_CONTAINER::LockContainer+0x27

0824ee54 77216dab 00000000 0824ee74 0824ee78 WININET!URL_CONTAINER::GetHeaderData+0x22

0824ee64 77216d60 0824ee74 00000000 00000000 WININET!GetCurrentSettingsVersion+0x2d

0824ee78 7722d1fa 00000000 00000000 76e44fd3 WININET!InternetSettingsChanged+0x12

0824efcc 7722d567 00000000 00000000 00000001 WININET!FixProxySettings+0x46

0824efec 77234713 00000000 011df078 01201310 WININET!FixProxySettingsForCurrentConnection+0x70

0824f01c 772383fb 011dc9b0 00000000 011df078 WININET!InternetAutodialIfNotLocalHost+0xe6

0824f090 77238318 00000000 0824f0b4 77229745 WININET!ParseUrlForHttp_Fsm+0x135

0824f09c 77229745 01201310 011df078 00000000 WININET!CFsm_ParseUrlForHttp::RunSM+0x2b

0824f0b4 772296fa 011df078 00000000 00000000 WININET!CFsm::Run+0x39

0824f0cc 7723812e 01201310 0824f5b8 030c8140 WININET!DoFsm+0x25

0824f118 013893c8 00cc0004 030c8140 00000000 WININET!InternetOpenUrlA+0x1dd

This is the information avaliable on the handle:

0:051> !handle 00000a10 f

Handle a10

 Type   	Mutant

 Attributes 	0

 GrantedAccess	0x100000:



 HandleCount 	3

 PointerCount 	8

 Name   	\BaseNamedObjects\c:!documents and settings!default user!local settings!temporary internet files!content.ie5!

 Object Specific Information

 Handle does not have required access to query basic mutant information


Any ideas what could be causing this? Is this a known bug, or perhaps I'm doing something wrong


- Kostya


1 Answer Found


Answer 1

Wininet api cannot be invoked from a service application as these api's might have some ui popup which is not supported in service. You need to use the winhttp api to perform http operation within a service application.


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure