Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2007 Jul : InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED - Access Denied Exceptio

www.cryer.info
Managed Newsgroup Archive

InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED - Access Denied Exceptio

Subject:InternetSetOption with INTERNET_OPTION_SETTINGS_CHANGED - Access Denied Exceptio
Posted by:"shallac" (shalla..@yahoo.com)
Date:Mon, 16 Jul 2007 14:06:55

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
tdll.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;
}

Replies:

www.cryer.info
Managed Newsgroup Archive