Discussion:
InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED - Access Denied Exception
(too old to reply)
shallac
2007-07-16 21:06:55 UTC
Permalink
I'm noticing a problem recently when calling InternetSetOption with
INTERNET_OPTION_SETTINGS_CHANGED and/or INTERNET_OPTION_REFRESH, I
frequently get a First-chance exception in my debugger - 0x00000005:
Access is denied. On rare occasions, this will lead to a 0xC0000005
Access Violation crash in ntdll.dll, which is more worrisome. The
call stack for a crash is below:

Fault address: 7C918FEA 01:00017FEA C:\WINDOWS\system32\ntdll.dll

Registers:
EAX:00000000
EBX:00000000
ECX:000003D8
EDX:001BEED4
ESI:001BEEC4
EDI:00000000
CS:EIP:001B:7C918FEA
SS:ESP:0023:06DDF81C EBP:06DDF890
DS:0023 ES:0023 FS:003B GS:0000
Flags:00010246

Call stack: 0x000005E0
Address Frame
7C918FEA 06DDF890 RtlpWaitForCriticalSection +91 bytes (no line
info: 0x000001E7) [Decl: RtlpWaitForCriticalSection]
7C90104B 06DDF8AC RtlEnterCriticalSection +70 bytes (no line
info: 0x000001E7) [Decl: RtlEnterCriticalSection]
77E9C330 06DDF8D0 RpcBindingSetAuthInfoW +681 bytes (no line
info: 0x000001E7) [Decl: RpcBindingSetAuthInfoW]
77E76FCD 06DDF8EC I_RpcBCacheFree +2453 bytes (no line info:
0x000001E7) [Decl: I_RpcBCacheFree]
77E80762 06DDF90C NdrConformantStructUnmarshall +3609 bytes (no
line info: 0x000001E7) [Decl: NdrConformantStructUnmarshall]
77E84D7B 06DDF970 NdrNonEncapsulatedUnionMemorySize +3466 bytes
(no line info: 0x000001E7) [Decl:
NdrNonEncapsulatedUnionMemorySize]
77E800AC 06DDF9A0 NdrConformantStructUnmarshall +1891 bytes (no
line info: 0x000001E7) [Decl: NdrConformantStructUnmarshall]
77E78DC9 06DDF9B8 I_RpcGetBufferWithObject +72 bytes (no line
info: 0x000001E7) [Decl: I_RpcGetBufferWithObject]
77E78E00 06DDF9C8 I_RpcGetBuffer +15 bytes (no line info:
0x000001E7) [Decl: I_RpcGetBuffer]
77E7942D 06DDF9D8 NdrGetBuffer +40 bytes (no line info:
0x000001E7) [Decl: NdrGetBuffer]
77EF360B 06DDFDB8 NdrClientCall2 +315 bytes (no line info:
0x000001E7) [Decl: NdrClientCall2]
76E96F36 06DDFDCC RasRpcGetSystemDirectory +66 bytes (no line
info: 0x000001E7) [Decl: RasRpcGetSystemDirectory]
76E96400 06DDFE08 RasRpcDisconnect +148 bytes (no line info:
0x000001E7) [Decl: RasRpcDisconnect]
76E95D97 06DDFE20 RasDeviceSetInfo +523 bytes (no line info:
0x000001E7) [Decl: RasDeviceSetInfo]
76E970CB 06DDFE64 0001:000060CB C:\WINDOWS\system32\rasman.dll
76E948FC 06DDFE78 RasReferenceRasman +17 bytes (no line info:
0x000001E7) [Decl: RasReferenceRasman]
76E9598A 06DDFEBC RasInitialize +313 bytes (no line info:
0x000001E7) [Decl: RasInitialize]
76EFDD69 06DDFEC8 DwRasRefreshKerbScCreds +5359 bytes (no line
info: 0x000001E7) [Decl: DwRasRefreshKerbScCreds]
42C33AD9 06DDFEF8 Ordinal101 +440 bytes (no line info:
0x000001E7) [Decl: Ordinal101]
7C927545 06DDFF40 RtlUpcaseUnicodeString +345 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C927583 06DDFF60 RtlUpcaseUnicodeString +407 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C927645 06DDFF74 RtlUpcaseUnicodeString +601 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C92761C 06DDFFB4 RtlUpcaseUnicodeString +560 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C80B683 06DDFFEC GetModuleFileNameA +436 bytes (no line info:
0x000001E7) [Decl: GetModuleFileNameA]


At this point, I'm clueless as to what the problem is. Below is a
simple test program that seems to repro the first-chance exception.
Usually I need to load some pages in IE7 and close/restart IE7 AND the
test program to get the exception to occur. The only thing I can
think of is my wininet.dll (version 7.0.6000.16473, dated 4/25/07) has
some new "feature" that is causing this. Any help is appreciated.


#include "stdafx.h"
#include <windows.h>
#include <wininet.h>


int _tmain(int argc, _TCHAR* argv[])
{

unsigned long nSize = sizeof(DWORD);
DWORD http1_0 = 4;
DWORD http1_1 = 2;


if(!InternetSetOption(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER,
&http1_0, nSize))
{
return -1;
}

if(!InternetSetOption(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER,
&http1_1, nSize))
{
return -1;
}


if(!InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL,
0))
{
return -1;
}

if(!InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL, 0))
{
return -1;
}

return 0;
}
Stefan M. Huber
2007-07-17 07:23:25 UTC
Permalink
Post by shallac
I'm noticing a problem recently when calling InternetSetOption with
INTERNET_OPTION_SETTINGS_CHANGED and/or INTERNET_OPTION_REFRESH, I
Access is denied. On rare occasions, this will lead to a 0xC0000005
Access Violation crash in ntdll.dll, which is more worrisome. The
Does it happen when you start your programme outside the development
environment? I had similar troubles with Delphi and the wininet API. They
appeared and disappeared randomly within the IDE.

Stefan
shallac
2007-07-17 12:11:15 UTC
Permalink
Post by Stefan M. Huber
Does it happen when you start your programme outside the development
environment? I had similar troubles with Delphi and the wininet API. They
appeared and disappeared randomly within the IDE.
Stefan
Yes, the access violation crash occurred in a release build, outside
the IDE (VS2003).
Scherbina Vladimir
2007-07-17 10:31:01 UTC
Permalink
Sounds like a buggy client stack.
--
Vladimir, Windows SDK MVP
http://msmvps.com/blogs/v_scherbina/
Post by shallac
I'm noticing a problem recently when calling InternetSetOption with
INTERNET_OPTION_SETTINGS_CHANGED and/or INTERNET_OPTION_REFRESH, I
Access is denied. On rare occasions, this will lead to a 0xC0000005
Access Violation crash in ntdll.dll, which is more worrisome. The
Fault address: 7C918FEA 01:00017FEA C:\WINDOWS\system32\ntdll.dll
EAX:00000000
EBX:00000000
ECX:000003D8
EDX:001BEED4
ESI:001BEEC4
EDI:00000000
CS:EIP:001B:7C918FEA
SS:ESP:0023:06DDF81C EBP:06DDF890
DS:0023 ES:0023 FS:003B GS:0000
Flags:00010246
Call stack: 0x000005E0
Address Frame
7C918FEA 06DDF890 RtlpWaitForCriticalSection +91 bytes (no line
info: 0x000001E7) [Decl: RtlpWaitForCriticalSection]
7C90104B 06DDF8AC RtlEnterCriticalSection +70 bytes (no line
info: 0x000001E7) [Decl: RtlEnterCriticalSection]
77E9C330 06DDF8D0 RpcBindingSetAuthInfoW +681 bytes (no line
info: 0x000001E7) [Decl: RpcBindingSetAuthInfoW]
0x000001E7) [Decl: I_RpcBCacheFree]
77E80762 06DDF90C NdrConformantStructUnmarshall +3609 bytes (no
line info: 0x000001E7) [Decl: NdrConformantStructUnmarshall]
77E84D7B 06DDF970 NdrNonEncapsulatedUnionMemorySize +3466 bytes
NdrNonEncapsulatedUnionMemorySize]
77E800AC 06DDF9A0 NdrConformantStructUnmarshall +1891 bytes (no
line info: 0x000001E7) [Decl: NdrConformantStructUnmarshall]
77E78DC9 06DDF9B8 I_RpcGetBufferWithObject +72 bytes (no line
info: 0x000001E7) [Decl: I_RpcGetBufferWithObject]
0x000001E7) [Decl: I_RpcGetBuffer]
0x000001E7) [Decl: NdrGetBuffer]
0x000001E7) [Decl: NdrClientCall2]
76E96F36 06DDFDCC RasRpcGetSystemDirectory +66 bytes (no line
info: 0x000001E7) [Decl: RasRpcGetSystemDirectory]
0x000001E7) [Decl: RasRpcDisconnect]
0x000001E7) [Decl: RasDeviceSetInfo]
76E970CB 06DDFE64 0001:000060CB C:\WINDOWS\system32\rasman.dll
0x000001E7) [Decl: RasReferenceRasman]
0x000001E7) [Decl: RasInitialize]
76EFDD69 06DDFEC8 DwRasRefreshKerbScCreds +5359 bytes (no line
info: 0x000001E7) [Decl: DwRasRefreshKerbScCreds]
0x000001E7) [Decl: Ordinal101]
7C927545 06DDFF40 RtlUpcaseUnicodeString +345 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C927583 06DDFF60 RtlUpcaseUnicodeString +407 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C927645 06DDFF74 RtlUpcaseUnicodeString +601 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
7C92761C 06DDFFB4 RtlUpcaseUnicodeString +560 bytes (no line
info: 0x000001E7) [Decl: RtlUpcaseUnicodeString]
0x000001E7) [Decl: GetModuleFileNameA]
At this point, I'm clueless as to what the problem is. Below is a
simple test program that seems to repro the first-chance exception.
Usually I need to load some pages in IE7 and close/restart IE7 AND the
test program to get the exception to occur. The only thing I can
think of is my wininet.dll (version 7.0.6000.16473, dated 4/25/07) has
some new "feature" that is causing this. Any help is appreciated.
#include "stdafx.h"
#include <windows.h>
#include <wininet.h>
int _tmain(int argc, _TCHAR* argv[])
{
unsigned long nSize = sizeof(DWORD);
DWORD http1_0 = 4;
DWORD http1_1 = 2;
if(!InternetSetOption(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER,
&http1_0, nSize))
{
return -1;
}
if(!InternetSetOption(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER,
&http1_1, nSize))
{
return -1;
}
if(!InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL,
0))
{
return -1;
}
if(!InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL, 0))
{
return -1;
}
return 0;
}
shallac
2007-07-17 12:12:46 UTC
Permalink
Post by Scherbina Vladimir
Sounds like a buggy client stack.
--
Vladimir, can you suggest any further troubleshooting steps?
Scherbina Vladimir
2007-07-17 20:02:30 UTC
Permalink
Let me try to repeat the problem on my side and if it really occures I will
contact the WNDP team. However, they're quite busy last time, some of my
issues sent to them a week ago are not still confirmed/resolved.
--
Vladimir, Windows SDK MVP
http://msmvps.com/blogs/v_scherbina/
Post by shallac
Post by Scherbina Vladimir
Sounds like a buggy client stack.
--
Vladimir, can you suggest any further troubleshooting steps?
jca
2007-10-05 11:58:00 UTC
Permalink
Hi there, I have the exact same problem. My application crashes randomly when
I call InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED. It happens
within the IDE or outside of it. I use VS 2005 SP1, under Windows XP.

Interesting fact: The exact same application compiled with VS2003 is working
fine.

Did anyone find a solution to this?

Thanks
JCA
Post by Scherbina Vladimir
Let me try to repeat the problem on my side and if it really occures I will
contact the WNDP team. However, they're quite busy last time, some of my
issues sent to them a week ago are not still confirmed/resolved.
--
Vladimir, Windows SDK MVP
http://msmvps.com/blogs/v_scherbina/
Post by shallac
Post by Scherbina Vladimir
Sounds like a buggy client stack.
--
Vladimir, can you suggest any further troubleshooting steps?
Vladimir Scherbina
2007-10-22 08:11:22 UTC
Permalink
Most likely, this is a problem of your program. Since, the API is the same
for both applications; So if it is working fine in one, but does not in
another, it means you have a buggy code.
Post by jca
Hi there, I have the exact same problem. My application crashes randomly when
I call InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED. It happens
within the IDE or outside of it. I use VS 2005 SP1, under Windows XP.
Interesting fact: The exact same application compiled with VS2003 is working
fine.
Did anyone find a solution to this?
Thanks
JCA
Post by Scherbina Vladimir
Let me try to repeat the problem on my side and if it really occures I will
contact the WNDP team. However, they're quite busy last time, some of my
issues sent to them a week ago are not still confirmed/resolved.
--
Vladimir, Windows SDK MVP
http://msmvps.com/blogs/v_scherbina/
Post by shallac
Post by Scherbina Vladimir
Sounds like a buggy client stack.
--
Vladimir, can you suggest any further troubleshooting steps?
Loading...