Tech Support > Microsoft Windows > Drivers > Map user space interface to kernel space
Map user space interface to kernel space
Posted by on August 14th, 2003


Hi,

I have kernel module (NDIS IM driver) and user space library (wrapper for
IPHelper APIs).

I'm looking to something like:

miniport adapter <------------> Unique Id <---------------------> user space
library (based on IpHelper)

There several options for unique id:
1. IP address
2. MAC address
3. NetCfgInstanceId as unique id.

The best way (which is also boot resistant) is to use #3.

Does anyone know how this can be achieved?

Thanks,
Gana


Posted by Stephan Wolf on August 14th, 2003


I don't get the actual problem here. Sure, you can use the adapter's
'NetCfgInstanceId'. So what's missing?

Stephan
---
On Thu, 14 Aug 2003 19:24:44 +0200, <Gana> wrote:

Posted by Pavel A. on August 14th, 2003


<Gana> wrote in message news:uuG59DoYDHA.2032@TK2MSFTNGP10.phx.gbl...
Gadi... really... just do it!

--PA



Posted by on August 17th, 2003


If I pickup #3 as my strategy can anyone advise how should implement:

1. Use space -
How can I link NetCfgInstanceId to the adapters available through
IpHelper APIs?

I couldn't find a straight way for doing :
1. Should I use WMI (WIN32_NetworkAdapterConfiguration) ? I there a
faster OS infrastructure for acheiving it?

2. Kernel Space -

How can an IM driver obtain NetCfgInstanceId of adapters it binds to?

Thanks,
G.



Posted by Stephan Wolf on August 18th, 2003


I can only answer #2:

Don't know why you need the 'NetCfgInstanceId' itself but it is the
subkey in the registry path that is passed to ProtocolBindAdapter() as
the 'SystemSpecific1' parameter. See the description of
NdisOpenProtocolConfiguration() for details.

IIRC, the 'NetCfgInstanceId' is also part of the 'DeviceName'
parameter passed to ProtocolBindAdapter().

You can print both the 'DeviceName' and the 'SystemSpecific1' as
follows:

VOID ProtocolBindAdapter(
OUT PNDIS_STATUS Status,
IN NDIS_HANDLE BindContext,
IN PNDIS_STRING DeviceName,
IN PVOID SystemSpecific1,
IN PVOID SystemSpecific2)
{
DbgPrint("DeviceName='%ws', SystemSpecific1='%ws'\n",
DeviceName->Buffer, ((PNDIS_STRING) SystemSpecific1)->Buffer));
}

However, 'SystemSpecific1' should be treated as an opaque value. It is
best to just pass it to NdisOpenProtocolConfiguration() without
interpreting it in any way.

I guess you will be able to read all the information your IM requires
via NdisOpenProtocolConfiguration(). Your Notify Object or some
application just needs to create the required keys.

Stephan
---
On Sun, 17 Aug 2003 10:19:17 +0200, <Gana> wrote:


Similar Posts