Map user space interface to kernel space

Discussion in 'Windows Vista Drivers' started by Guest, Aug 14, 2003.

  1. Guest

    Guest Guest


    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?

    Guest, Aug 14, 2003
    1. Advertisements

  2. Guest

    Stephan Wolf Guest

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

    Stephan Wolf, Aug 14, 2003
    1. Advertisements

  3. Guest

    Pavel A. Guest

    Gadi... really... just do it!

    Pavel A., Aug 14, 2003
  4. Guest

    Guest Guest

    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?

    Guest, Aug 17, 2003
  5. Guest

    Stephan Wolf Guest

    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

    VOID ProtocolBindAdapter(
    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 Wolf, Aug 18, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.