Hello All,
We are facing an exception while calling Install method as
below. The exception
says:

"An Exception occurred while trying to run "Shell32.dll,
Control_RunDLL "C:\Program
Files\XFrame\Protocol\xconfig.cpl"" Later it crashes with message
"The instruction at
... referenced memory at ..., Memory could not be read. Click OK to
terminate the
program".

While debugging the following error messages are printed in the Output
window while executing the Install method:
First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
Access violation reading location 0xfdfdfdfd.
AtlThrow: hr = 0x8007000e
First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
exception: CMemoryException at memory location 0x0007d47c..
'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
loaded.
'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
loaded.
'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
loaded.
'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
First-chance exception at 0x77e4bee7 in rundll32.exe: 0x000006BA: The
RPC server is unavailable.
First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
Access violation reading location 0xfdfdfdfd.
First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
exception: SE_Exception at memory location 0x0007d058..


This worked fine in VS 2003. We have upgraded the projects to VS 2005
after which this
error started occurring.

Can anyone help in solving this problem? Any clues will be
appreciated.

INetCfg * m_pnc;
INetCfgClass *pncNetClass = NULL;
INetCfgClassSetup *pncNetClassSetup = NULL;
INetCfgComponent *pnccMiniport = NULL;
.....

HRESULT hr;
hr = m_pnc->QueryNetCfgClass(&GUID_DEVCLASS_NET,
IID_INetCfgClass,

reinterpret_cast<PPVOID>(&pncNetClass));
if (S_OK == hr)
{
hr = pncNetClass->QueryInterface(IID_INetCfgClassSetup,

reinterpret_cast<PPVOID>(&pncNetClassSetup));
if (S_OK == hr)
{
::CoFreeUnusedLibraries();
PTCHAR ptMiniPortName = Util::GetMiniportName();
hr = pncNetClassSetup->Install(ptMiniPortName,
NULL,
NSF_POSTSYSINSTALL,
0,
NULL,
NULL,
&pnccMiniport );
}
}

With regards,
Phaniram.

Re: Error calling method INetCfgClassSetup::Install after upgrading to VS 2005 by Rohit

Rohit
Mon Jul 16 15:37:33 CDT 2007

1 - Try linking agains DDK Libraries. I usually use Server 2003 DDK with VS
for Include/Link and it has worked for me.
2 - You should not use INetCfg interfaces to install devices of
GUID_DEVCLASS_NET. Switch to SetupDi APIs instead (unless it is a part of an
IM driver, where you Install protocol edge, which then triggers install of
network edge).

--
Thanks,
Rohit Raina
This posting is provided "AS IS" with no warranties, and confers no rights.



<d.phaniram@gmail.com> wrote in message
news:1184574637.159162.157840@m3g2000hsh.googlegroups.com...
> Hello All,
> We are facing an exception while calling Install method as
> below. The exception
> says:
>
> "An Exception occurred while trying to run "Shell32.dll,
> Control_RunDLL "C:\Program
> Files\XFrame\Protocol\xconfig.cpl"" Later it crashes with message
> "The instruction at
> ... referenced memory at ..., Memory could not be read. Click OK to
> terminate the
> program".
>
> While debugging the following error messages are printed in the Output
> window while executing the Install method:
> First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
> Access violation reading location 0xfdfdfdfd.
> AtlThrow: hr = 0x8007000e
> First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
> exception: CMemoryException at memory location 0x0007d47c..
> 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> loaded.
> 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> loaded.
> 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> loaded.
> 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> First-chance exception at 0x77e4bee7 in rundll32.exe: 0x000006BA: The
> RPC server is unavailable.
> First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
> Access violation reading location 0xfdfdfdfd.
> First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
> exception: SE_Exception at memory location 0x0007d058..
>
>
> This worked fine in VS 2003. We have upgraded the projects to VS 2005
> after which this
> error started occurring.
>
> Can anyone help in solving this problem? Any clues will be
> appreciated.
>
> INetCfg * m_pnc;
> INetCfgClass *pncNetClass = NULL;
> INetCfgClassSetup *pncNetClassSetup = NULL;
> INetCfgComponent *pnccMiniport = NULL;
> .....
>
> HRESULT hr;
> hr = m_pnc->QueryNetCfgClass(&GUID_DEVCLASS_NET,
> IID_INetCfgClass,
>
> reinterpret_cast<PPVOID>(&pncNetClass));
> if (S_OK == hr)
> {
> hr = pncNetClass->QueryInterface(IID_INetCfgClassSetup,
>
> reinterpret_cast<PPVOID>(&pncNetClassSetup));
> if (S_OK == hr)
> {
> ::CoFreeUnusedLibraries();
> PTCHAR ptMiniPortName = Util::GetMiniportName();
> hr = pncNetClassSetup->Install(ptMiniPortName,
> NULL,
> NSF_POSTSYSINSTALL,
> 0,
> NULL,
> NULL,
> &pnccMiniport );
> }
> }
>
> With regards,
> Phaniram.
>



Re: Error calling method INetCfgClassSetup::Install after upgrading to VS 2005 by d

d
Tue Jul 17 06:54:36 CDT 2007

Hi Rohit,
Thanks very much for your response. 'Linking again' means just
removing the ddk folders from include and lib sections? and again
adding it and compiling? Even doing that didn't solve the problem.
We also have another problem. INetCfg:: Initialize is failing with
E_FAIL sometimes. Therefore the subsequent call
hr = m_pnc->EnumComponents( &GUID_DEVCLASS_NET, &pencc );
is returning 0x8007002 - The system cannot find the file specified.

Failing code:
INetCfg * m_pnc;
hr = m_pnc->Initialize(NULL);
hr = m_pnc->EnumComponents( &GUID_DEVCLASS_NET, &pencc );

What could be the reason for this behavior?

Regards,
Phaniram.


Rohit Raina [MSFT] wrote:
> 1 - Try linking agains DDK Libraries. I usually use Server 2003 DDK with VS
> for Include/Link and it has worked for me.
> 2 - You should not use INetCfg interfaces to install devices of
> GUID_DEVCLASS_NET. Switch to SetupDi APIs instead (unless it is a part of an
> IM driver, where you Install protocol edge, which then triggers install of
> network edge).
>
> --
> Thanks,
> Rohit Raina
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> <d.phaniram@gmail.com> wrote in message
> news:1184574637.159162.157840@m3g2000hsh.googlegroups.com...
> > Hello All,
> > We are facing an exception while calling Install method as
> > below. The exception
> > says:
> >
> > "An Exception occurred while trying to run "Shell32.dll,
> > Control_RunDLL "C:\Program
> > Files\XFrame\Protocol\xconfig.cpl"" Later it crashes with message
> > "The instruction at
> > ... referenced memory at ..., Memory could not be read. Click OK to
> > terminate the
> > program".
> >
> > While debugging the following error messages are printed in the Output
> > window while executing the Install method:
> > First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
> > Access violation reading location 0xfdfdfdfd.
> > AtlThrow: hr = 0x8007000e
> > First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
> > exception: CMemoryException at memory location 0x0007d47c..
> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> > loaded.
> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> > loaded.
> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
> > loaded.
> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
> > First-chance exception at 0x77e4bee7 in rundll32.exe: 0x000006BA: The
> > RPC server is unavailable.
> > First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
> > Access violation reading location 0xfdfdfdfd.
> > First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
> > exception: SE_Exception at memory location 0x0007d058..
> >
> >
> > This worked fine in VS 2003. We have upgraded the projects to VS 2005
> > after which this
> > error started occurring.
> >
> > Can anyone help in solving this problem? Any clues will be
> > appreciated.
> >
> > INetCfg * m_pnc;
> > INetCfgClass *pncNetClass = NULL;
> > INetCfgClassSetup *pncNetClassSetup = NULL;
> > INetCfgComponent *pnccMiniport = NULL;
> > .....
> >
> > HRESULT hr;
> > hr = m_pnc->QueryNetCfgClass(&GUID_DEVCLASS_NET,
> > IID_INetCfgClass,
> >
> > reinterpret_cast<PPVOID>(&pncNetClass));
> > if (S_OK == hr)
> > {
> > hr = pncNetClass->QueryInterface(IID_INetCfgClassSetup,
> >
> > reinterpret_cast<PPVOID>(&pncNetClassSetup));
> > if (S_OK == hr)
> > {
> > ::CoFreeUnusedLibraries();
> > PTCHAR ptMiniPortName = Util::GetMiniportName();
> > hr = pncNetClassSetup->Install(ptMiniPortName,
> > NULL,
> > NSF_POSTSYSINSTALL,
> > 0,
> > NULL,
> > NULL,
> > &pnccMiniport );
> > }
> > }
> >
> > With regards,
> > Phaniram.
> >


Re: Error calling method INetCfgClassSetup::Install after upgrading to VS 2005 by Rohit

Rohit
Tue Jul 17 11:54:22 CDT 2007

sorry for the typo -- I meant 'Linking against'.
I point VS to DDK Include and Lib directories and remove any references to
VS original include/lib directories.
if this did not resolve the problem, i think you should try in VS/Compiler
related forums. Sorry!

INetCfg:: Initialize usually fails because COM has not been initialized --
see if thats is being done.

Again, try using Devcon utility to install your NET class driver.

--
Thanks,
Rohit Raina
This posting is provided "AS IS" with no warranties, and confers no rights.



<d.phaniram@gmail.com> wrote in message
news:1184673276.913749.11210@j4g2000prf.googlegroups.com...
> Hi Rohit,
> Thanks very much for your response. 'Linking again' means just
> removing the ddk folders from include and lib sections? and again
> adding it and compiling? Even doing that didn't solve the problem.
> We also have another problem. INetCfg:: Initialize is failing with
> E_FAIL sometimes. Therefore the subsequent call
> hr = m_pnc->EnumComponents( &GUID_DEVCLASS_NET, &pencc );
> is returning 0x8007002 - The system cannot find the file specified.
>
> Failing code:
> INetCfg * m_pnc;
> hr = m_pnc->Initialize(NULL);
> hr = m_pnc->EnumComponents( &GUID_DEVCLASS_NET, &pencc );
>
> What could be the reason for this behavior?
>
> Regards,
> Phaniram.
>
>
> Rohit Raina [MSFT] wrote:
>> 1 - Try linking agains DDK Libraries. I usually use Server 2003 DDK with
>> VS
>> for Include/Link and it has worked for me.
>> 2 - You should not use INetCfg interfaces to install devices of
>> GUID_DEVCLASS_NET. Switch to SetupDi APIs instead (unless it is a part of
>> an
>> IM driver, where you Install protocol edge, which then triggers install
>> of
>> network edge).
>>
>> --
>> Thanks,
>> Rohit Raina
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>>
>> <d.phaniram@gmail.com> wrote in message
>> news:1184574637.159162.157840@m3g2000hsh.googlegroups.com...
>> > Hello All,
>> > We are facing an exception while calling Install method as
>> > below. The exception
>> > says:
>> >
>> > "An Exception occurred while trying to run "Shell32.dll,
>> > Control_RunDLL "C:\Program
>> > Files\XFrame\Protocol\xconfig.cpl"" Later it crashes with message
>> > "The instruction at
>> > ... referenced memory at ..., Memory could not be read. Click OK to
>> > terminate the
>> > program".
>> >
>> > While debugging the following error messages are printed in the Output
>> > window while executing the Install method:
>> > First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
>> > Access violation reading location 0xfdfdfdfd.
>> > AtlThrow: hr = 0x8007000e
>> > First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
>> > exception: CMemoryException at memory location 0x0007d47c..
>> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
>> > loaded.
>> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
>> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
>> > loaded.
>> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
>> > 'rundll32.exe': Loaded 'C:\WINDOWS\system32\wshnetbs.dll', No symbols
>> > loaded.
>> > 'rundll32.exe': Unloaded 'C:\WINDOWS\system32\wshnetbs.dll'
>> > First-chance exception at 0x77e4bee7 in rundll32.exe: 0x000006BA: The
>> > RPC server is unavailable.
>> > First-chance exception at 0x7c82a36b in rundll32.exe: 0xC0000005:
>> > Access violation reading location 0xfdfdfdfd.
>> > First-chance exception at 0x77e4bee7 in rundll32.exe: Microsoft C++
>> > exception: SE_Exception at memory location 0x0007d058..
>> >
>> >
>> > This worked fine in VS 2003. We have upgraded the projects to VS 2005
>> > after which this
>> > error started occurring.
>> >
>> > Can anyone help in solving this problem? Any clues will be
>> > appreciated.
>> >
>> > INetCfg * m_pnc;
>> > INetCfgClass *pncNetClass = NULL;
>> > INetCfgClassSetup *pncNetClassSetup = NULL;
>> > INetCfgComponent *pnccMiniport = NULL;
>> > .....
>> >
>> > HRESULT hr;
>> > hr = m_pnc->QueryNetCfgClass(&GUID_DEVCLASS_NET,
>> > IID_INetCfgClass,
>> >
>> > reinterpret_cast<PPVOID>(&pncNetClass));
>> > if (S_OK == hr)
>> > {
>> > hr = pncNetClass->QueryInterface(IID_INetCfgClassSetup,
>> >
>> > reinterpret_cast<PPVOID>(&pncNetClassSetup));
>> > if (S_OK == hr)
>> > {
>> > ::CoFreeUnusedLibraries();
>> > PTCHAR ptMiniPortName = Util::GetMiniportName();
>> > hr = pncNetClassSetup->Install(ptMiniPortName,
>> > NULL,
>> > NSF_POSTSYSINSTALL,
>> > 0,
>> > NULL,
>> > NULL,
>> > &pnccMiniport );
>> > }
>> > }
>> >
>> > With regards,
>> > Phaniram.
>> >
>