Helping module for NDIS in the kernel ??

Hi friends

I want to write one module (lets call it a module now ) which should

a) sit in the kernel.
b) interact with an NDIS miniport driver, meaning import & export some functions with the NDIS
Driver.
c) handle requests from application programs for configuration settings.
d) hold its data and
e) exist as an independent entity aiding NDIS Driver.

I have written the NDIS Miniport driver but don’t know how to implement the module !!
How should I implement this module ? Kernel - mode DLL or NDIS intermediate driver or any other ??

Please throw some light on this …

regards
Gopikrishna

Well, I’ve actually done this in 2 NDIS drivers. One method that works and
is easy to implement is to have your NDIS driver load your auxillary driver
(via ZwLoadDriver) and do a IoGetDeviceObjectPointer to get a pointer to
it’s device object. Then via a private IOCTL, your drivers can exchange
function pointers.

–Mark
Mark J. Cariddi
Consulting Associate
xxxxx@osr.com

OSR Open Systems Resources, Inc.
105 Route 101A, Suite 19
Amherst, New Hampshire 03031
603/595-6500
603/595-6503 Fax
http://www.osr.com http:</http:>

****************************************
The definitive book on writing Windows NT
device drivers, “Windows NT Device Driver
Development” by OSR consulting partners
Peter Viscarola and Tony Mason, is now
available for ordering.
****************************************

-----Original Message-----
From: Gopikrishna Prabhakar Yadappanavar
[mailto:xxxxx@wipro.com]
Sent: Monday, June 05, 2000 6:00 AM
To: NT Developers Interest List
Subject: [ntdev] Helping module for NDIS in the kernel ??

Hi friends

I want to write one module (lets call it a module now ) which should

a) sit in the kernel.
b) interact with an NDIS miniport driver, meaning import & export some
functions with the NDIS
Driver.
c) handle requests from application programs for configuration
settings.
d) hold its data and
e) exist as an independent entity aiding NDIS Driver.

I have written the NDIS Miniport driver but don’t know how to implement the
module !!
How should I implement this module ? Kernel - mode DLL or NDIS intermediate
driver or any other ??

Please throw some light on this …

regards
Gopikrishna

You could build an EXPORT_DRIVER (TARGETTYPE=EXPORT_DRIVER in your sources
file.) This will be a ‘kernel mode dll’ with a driver entry routine that
loads like a standard (NT4 legacy) driver. As a dll it can export functional
interfaces that your ndis driver can then import. If one of these interfaces
provides a method for your ndis driver to export its own back to your kernel
dll, then you have a bi-directional procedural interface between both
modules.

One has to ask: “why bother” as if you are writing both the ndis driver and
the kernel dll then whatever functionality you are assigning to the dll
could just as readily be assigned to the ndis driver. If this is just to
avoid ndis restrictions on what NT kernel APIs are available, I could be
wrong here, but aren’t there ways to build ndis drivers that allow one to be
non-portable and use any of the nt ddk api? The only major advantage such an
arrangement has is that the dll can persist over time while your ndis
drivers come and go, preserving state information that might otherwise be
more difficult to reconstruct.

-----Original Message-----
From: Gopikrishna Prabhakar Yadappanavar
[mailto:xxxxx@wipro.com]
Sent: Monday, June 05, 2000 6:00 AM
To: NT Developers Interest List
Subject: [ntdev] Helping module for NDIS in the kernel ??

Hi friends

I want to write one module (lets call it a module now ) which should

a) sit in the kernel.
b) interact with an NDIS miniport driver, meaning import & export some
functions with the NDIS
Driver.
c) handle requests from application programs for configuration
settings.
d) hold its data and
e) exist as an independent entity aiding NDIS Driver.

I have written the NDIS Miniport driver but don’t know how to implement the
module !!
How should I implement this module ? Kernel - mode DLL or NDIS intermediate
driver or any other ??

Please throw some light on this …

regards
Gopikrishna

> ----------

From: Roddy, Mark[SMTP:xxxxx@stratus.com]
Reply To: NT Developers Interest List
Sent: Monday, June 05, 2000 2:29 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Helping module for NDIS in the kernel ??

One has to ask: “why bother” as if you are writing both the ndis driver
and
the kernel dll then whatever functionality you are assigning to the dll
could just as readily be assigned to the ndis driver. If this is just to
avoid ndis restrictions on what NT kernel APIs are available, I could be
wrong here, but aren’t there ways to build ndis drivers that allow one to
be
non-portable and use any of the nt ddk api?

Indeed, but there are some problems. For example NDIS creates “invisible”
device for every adapter and sets own displatch handlers for every miniport
driver. If you want to use own device and dispatch handlers, you have to
consider it. w2k NdisMRegisterDevice() seems to solve this problem.

The only major advantage such an
arrangement has is that the dll can persist over time while your ndis
drivers come and go, preserving state information that might otherwise be
more difficult to reconstruct.

I used two drivers just for opposite case. Some NDIS IM drivers under NT4
cannot be unloaded and the second, unloadable driver containing the most of
functionality makes development easier and quicker. It saved me from many,
many reboots. The problem with unloading seems to be solved under w2k.

For original question: I’m using an NDIS driver + standard kernel driver
which opens NDIS one using IoGetDeviceObjectPointer and exchanges table of
function pointers using private IOCTL.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]