IM driver problem

Hi all,
I have got an IM driver for Win XP/2K, When i try to access class section
of the registry using the handle got in MiniportInitialize() in PnP
handler for Reconfigure i get an exception error of c0000005 (Bug check
7e). I would like to know the reason why this happens when i try to access
class section but not when i access the services part of the registry.

Thanks/Regards,
Shashi

How exactly are your trying to access the registry? Which functions
are you using?

Stephan

On Fri, 15 Mar 2002 08:46:10 -0500, xxxxx@wipro.com
wrote:

Hi all,
I have got an IM driver for Win XP/2K, When i try to access class section
of the registry using the handle got in MiniportInitialize() in PnP
handler for Reconfigure i get an exception error of c0000005 (Bug check
7e). I would like to know the reason why this happens when i try to access
class section but not when i access the services part of the registry.

Thanks/Regards,
Shashi

Hi,
I am using standard NDIS calls to access the registry infact the call to
NdisOpenConfigurationKeyByName() succeds but only when i try to read the
registry using the call NdisReadConfiguration() then the assertion happens
indicating access violation indicating following in the debugger:
Access violation - code c0000005 (!!! second chance !!!)
nt!IopDeviceObjectToDeviceInstance+20:
805b3c57 8b80b0000000 mov eax,[eax+0xb0]
Any suggestions what may be the cause since the same code works when
called from MiniportInitialize() routine.
Regards,
Shashi

Make sure you *close* all registry handles after using them. Also make
sure you re-open the registry key before passing it to
NdisOpenConfigurationKeyByName(). Carefully check *all* ‘Status’
return codes.

When and where do you get the ‘ConfigurationHandle’ from that you
input to NdisOpenConfigurationKeyByName()?

NdisOpenConfigurationKeyByName() is a new function, which probably
only very few people have used yet (I haven’t). Maybe there’s some bug
in NDIS but unlikely.

Stephan

On Sun, 17 Mar 2002 23:35:44 -0500, “Shashidhar”
wrote:

>
>Hi,
>I am using standard NDIS calls to access the registry infact the call to
>NdisOpenConfigurationKeyByName() succeds but only when i try to read the
>registry using the call NdisReadConfiguration() then the assertion happens
>indicating access violation indicating following in the debugger:
>Access violation - code c0000005 (!!! second chance !!!)
>nt!IopDeviceObjectToDeviceInstance+20:
>805b3c57 8b80b0000000 mov eax,[eax+0xb0]
>Any suggestions what may be the cause since the same code works when
>called from MiniportInitialize() routine.
>Regards,
>Shashi

Hi Stephan,
I checked by going through the code and stepping through it and saw that
all the keys are properly closed. And the configuration key i got during
the MiniportInitialize using the function NdisOpenConfiguration() using
WrapperConfigurationContext parameter passed to MiniportInitialize entry
point. Also i could not re-open the key since the
WrapperConfigurationContext is having the life time limited to
MiniportInitialize entry point. Any suggestions are welcome.
Thanks/Regards,
Shashi

I think you already know the answer because you said it yourself:
“Also i could not re-open the key since the
WrapperConfigurationContext is having the life time limited to
MiniportInitialize entry point.”

Exactly! So what this means is you cannot “re-open” the miniport’s
configuration after MiniportInitialize() has returned.

The PnP reconfiguration handler you mentioned is ProtocolPnPEvent()
with the ‘NetPnPEvent’ being ‘NetEventReconfigure’. This is a
*protocol* function, not a miniport one.

Thus, if you need to re-read the miniport configuration, either:

  1. stop and re-start the miniport instance using
    NdisIMDeInitializeDeviceInstance() and
    NdisIMInitializeDeviceInstanceEx.

  2. or use NdisOpenProtocolConfiguration(). Note, however, that you
    need to know the registry path to pass as ‘ProtocolSection’. By
    default, NdisOpenProtocolConfiguration() opens a subpath below
    “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services”. Specify an
    absolute path if you need to access any different location.

Stephan

On Tue, 19 Mar 2002 23:04:34 -0500, “Shashidhar”
wrote:

>
>Hi Stephan,
>I checked by going through the code and stepping through it and saw that
>all the keys are properly closed. And the configuration key i got during
>the MiniportInitialize using the function NdisOpenConfiguration() using
>WrapperConfigurationContext parameter passed to MiniportInitialize entry
>point. Also i could not re-open the key since the
>WrapperConfigurationContext is having the life time limited to
>MiniportInitialize entry point. Any suggestions are welcome.
>Thanks/Regards,
>Shashi