On Window XP, Is there a way I can use same NDIS IM driver to register both
WAN and LAN functions in DriverEntry? (so that same sys file will be used
for WAN and LAN IM driver). If possible, can anyone tell me the changes need
to be done in inf files and DriverEntry funtion and then how it will work.

Regards
Viral

Re: One IM driver for both LAN and WAN by Thomas

Thomas
Mon Oct 17 10:13:17 CDT 2005


"viral shah" <viral@xyz.com> wrote in message
news:eSf65iy0FHA.3780@TK2MSFTNGP12.phx.gbl...
> On Window XP, Is there a way I can use same NDIS IM driver to register
> both
> WAN and LAN functions in DriverEntry? (so that same sys file will be used
> for WAN and LAN IM driver). If possible, can anyone tell me the changes
> need
> to be done in inf files and DriverEntry funtion and then how it will work.
>
> Regards
> Viral
>
The DDK PassThru driver includes logic to allow the IM to bind to NDISWANIP.

In your IM's service INF file add "wan" to the FilterMediaTypes:

HKR, Ndi\Interfaces, FilterMediaTypes, , "ethernet, tokenring, fddi, wan"

In your ProtocolBindAdapter handler at the point where NdisOpenAdapter has
returned successfully you examine the returned MediumIndex to determine the
meduim of the adapter you are bound to. For WAN you make a small change,
that is already in the PassThru sample:

//
// Usually we export the medium type of the adapter below as our
// virtual miniport's medium type. However if the adapter below us
// is a WAN device, then we claim to be of medium type 802.3.
//
Medium = pAdapt->Medium;

if (Medium == NdisMediumWan)
{
Medium = NdisMedium802_3;
}

Understand that so far Microsoft has NOT designed a NDIS filtering mechanism
that filters over connection-oriented NDIS miniports. You can only filter
connectionless NDIS miniports (such as NDISWANIP) using Microsoft provided
NDIS IM filter technology.

Good luck,

Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com


Re: One IM driver for both LAN and WAN by viral

viral
Tue Oct 18 00:49:36 CDT 2005

Hi,

Thanks for the reply. Actually what I wanted to know is how can I use single
passthru that handles both PPP and ethernet packets. I need single passthru
whose wansendhandler should be called for PPP packets and LanSendHandler for
ethernet packets. Do I need to create different inf files for LAN and WAN.
How can I register both LAN and WAN handled functions in DriverEntry. How
can I call same driver's DriverEntry twice so that once it will register
LAN's function and other time for WAN. I think the question is clear now to
you

Thanks

Viral

"Thomas F. Divine [DDK MVP]" <tdivine@NOpcausaSPAM.com> wrote in message
news:O8a4W1y0FHA.3892@TK2MSFTNGP12.phx.gbl...
>
> "viral shah" <viral@xyz.com> wrote in message
> news:eSf65iy0FHA.3780@TK2MSFTNGP12.phx.gbl...
> > On Window XP, Is there a way I can use same NDIS IM driver to register
> > both
> > WAN and LAN functions in DriverEntry? (so that same sys file will be
used
> > for WAN and LAN IM driver). If possible, can anyone tell me the changes
> > need
> > to be done in inf files and DriverEntry funtion and then how it will
work.
> >
> > Regards
> > Viral
> >
> The DDK PassThru driver includes logic to allow the IM to bind to
NDISWANIP.
>
> In your IM's service INF file add "wan" to the FilterMediaTypes:
>
> HKR, Ndi\Interfaces, FilterMediaTypes, , "ethernet, tokenring, fddi,
wan"
>
> In your ProtocolBindAdapter handler at the point where NdisOpenAdapter has
> returned successfully you examine the returned MediumIndex to determine
the
> meduim of the adapter you are bound to. For WAN you make a small change,
> that is already in the PassThru sample:
>
> //
> // Usually we export the medium type of the adapter below as our
> // virtual miniport's medium type. However if the adapter below us
> // is a WAN device, then we claim to be of medium type 802.3.
> //
> Medium = pAdapt->Medium;
>
> if (Medium == NdisMediumWan)
> {
> Medium = NdisMedium802_3;
> }
>
> Understand that so far Microsoft has NOT designed a NDIS filtering
mechanism
> that filters over connection-oriented NDIS miniports. You can only filter
> connectionless NDIS miniports (such as NDISWANIP) using Microsoft provided
> NDIS IM filter technology.
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.pcausa.com
>



Re: One IM driver for both LAN and WAN by Maxim

Maxim
Tue Oct 18 19:36:14 CDT 2005

> Thanks for the reply. Actually what I wanted to know is how can I use single
> passthru that handles both PPP and ethernet packets. I need single passthru
> whose wansendhandler should be called for PPP packets and

No. Passthru can be used for PPP stack with minor patches, but it will see fake
Ethernet packets with some internal NDISWAN/WANARP stuff as MAC addresses.

This is above NDISWAN, decrypted and decompressed. This is just below WANARP
which handles the IP addressing stuff for PPP connections.

WanXxx routines are for the miniports below NDISWAN which see
crypted/compressed data.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com