cont... Intermediate NDIS Driver

Hi,
Sorry to all, to post message without complition,
I wanted some change TCP/IP packet by this stuff before the packet sent out.
I’m sure i’ll be getting a very good break through from you GURUS by providing more clearification and letting you know title of the job.

– Sumit Pandya

----- Original Message -----
From: Sumit Pandya
To: xxxxx@lists.osr.com
Sent: Thu Jul 12 20:41:56 GMT+05:30 2001
Subject: Intermediate NDIS Driver

Hi GURUS,

I’m developing a solution, which requires a baseline like “IMSamp of Win-NT” and “passthrough of W2K”. This solution is suppose to be develop on all win32 platforms, i.e. Win9x, WinNT, and W2K. From the earlier messages on the list I knew porting the IMSamp is next impossible. Now I need a guideline to start in this direction and especially for Win95, which is the major headache for me or for any beginner in this driver development.
So, before I made all my practice waste I need a proper direction.

Accepting expert’s directive for this energy :slight_smile:

– Sumit Pandya


eLitecore Technologies Pvt. Ltd.


eLitecore Technologies Pvt. Ltd.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Sumit,

The best approach is to start with the Windows XP DDK sample PASSTHRU.
This is the Windows 2000 DDK sample PASSTHRU with some updated comments
etc. Use the Windows 2000 DDK. And I would target Windows 2000 first.
Most of the code will port to Windows 98/98SE/ME with some
modifications. Considerations for 9x/ME:

– Some functions are not supported and will cause your driver not to
load. There are several ways to determine this. I tend to load the
debug/checked version of VxDLDR.VxD in the Windows\System\VMM32 folder.
Any functions that are not resolved cause VxDLDR to emit debug spew to
the kernel debug console identifying the function. You will need to
find an alternative for any function not supported.

– Windows 98 First Edition does not support NDIS version 5, so you will
have to specify NDIS v 4.0 for 98 Gold.

– I have not tried any of this with Windows 95. OSR2 might have some
of the NTKERN support you need, but all bets are off.

– Many NDIS functions in Windows 2000 (and the Windows 2000 DDK) are
actually macros. See the declaration of NdisSend(), for example. For
all 9x/Me platforms, be sure to specify BINARY_COMPATIBLE in your
project (SOURCES). This will cause the ‘functions’ to revert from
macros back to true function calls down to the NDIS driver.

– The NDIS.VxD debug/checked binary as well as a few other debug
binaries are available in KB Q241517 – they were not distributed in the
Windows ME debugkit. Tips on debugging NDIS in Windows ME is documented
in KB Q279356. And, just for completeness, new debugging features in
the network class installer for Windows ME (NetDI.DLL) are documented in
KB Q282757.

– Never touch elements in the structure NDIS_BUFFER directly. Always
use the NDIS functions/macros to do this. NDIS_BUFFERS are defined
differently between the NT and 9x kernels (in NT they are MDLs). The OS
will always do the right thing if you call the functions. For example,
use NdisQueryBuffer() to get the address of the data.

– The biggest difference will be the installation. Below I have copied
my .INF file for PASSTHRU on Windows 9x/ME. You will have to manually
prune some of the bindings, specifically, the binding between TCPIP and
the original miniport. The Windows 2000/XP installation contains two
.infs; one for the miniport edge (NetServ for passthru/Net for Mux) and
one for the protocol edge (NetTrans). The Windows 9x/ME flavor is a
single .inf file and stamps both edges as NetTrans. The true edge of
the miniport is handled by the NDI entry RealClass=Net (in the .inf).
This has caused some problems with third party products (firewalls,etc.)
that only look for adapters by mining the registry looking for devices
with Class=Net.

I hope this information gives you a good staring point. I have seen
other members of this forum with good information, too.

Good luck.

Bryan S. Burgin
xxxxx@microsoft.com

;-----------------------------------------------------------------------
----;
;
;
; PASSTHRU.INF
;
;
;
; Windows 98 Installation for NDIS Intermediate Driver example
PASSTHRU.SYS ;
; Based largely on NETLANE.INF
;
;
;
; Copyright (c) 1993-2000, Microsoft Corporation
;
;
;
;-----------------------------------------------------------------------
----;

[version]
signature=“$CHICAGO$”
Class=NetTrans
ClassGUID={4d36e975-e325-11ce-bfc1-08002be10318}
provider=%V_MS%
DriverVer=08/24/2000

[Manufacturer]
%V_MS%=MS

[MS]
%PASSTHRU.DeviceDesc%= PASSTHRU.ndi, PASSTHRU
%PASSMINI.DeviceDesc%= PASSMINI.ndi, PASSMINI

[ControlFlags]
ExcludeFromSelect=PASSMINI

[SourceDiskNames]
1=,

[SourceDiskFiles]
Passthru.sys=1,
Passthru.inf=1,

;-----------------------------------------------------------------------
----;
; PASSTHRU – Protocol edge
;
;-----------------------------------------------------------------------
----;

[PASSTHRU.ndi]
CopyFiles=PASSTHRU.Inf.CopyFiles
AddReg=PASSTHRU.ndi.reg
DeviceID=PASSTHRU
MaxInstance=4
DriverVer=06/08/2000

[PASSTHRU.ndi.reg]
HKR,Ndi,DeviceID,PASSTHRU
HKR,Ndi,MaxInstance,8
HKR,Ndi,NetType,1
HKR,NDIS,LogDriverName,PASSTHRU
HKR,NDIS,MiniportLogDriverName,PASSMINI
HKR,NDIS,MajorNdisVersion,1,03
HKR,NDIS,MinorNdisVersion,1,0A
HKR,Ndi\Interfaces,DefUpper,“PASSTHRU”
HKR,Ndi\Interfaces,DefLower,“ndis3,ndis4,ndis5”
HKR,Ndi\Interfaces,UpperRange,“PASSTHRU”
HKR,Ndi\Interfaces,LowerRange,“ndis3,ndis4,ndis5”
HKR,Ndi\InstallInf,“PassThru.inf”
HKR,Ndi\Install,“PASSTHRU.Install”
HKR,Ndi\Remove,“PASSTHRU.Remove”
HKR,Ndi,HelpText,%PASSTHRU_HELP%
HKR,Ndi\Compatibility,RequireAll,“PASSMINI”

[PASSTHRU.Install]
AddReg=PASSTHRU.AddReg, PASSTHRU.IMDevNode.AddReg
CopyFiles=PASSTHRU.CopyFiles

[PASSTHRU.AddReg]
HKR,DevLoader,*ndis
HKR,DeviceVxDs,passthru.sys
HKR,IntermediateProtocol,1

[PASSTHRU.IMDevNode.AddReg]
HKLM,System\CurrentControlSet\Services\Class\Ndis
HKLM,System\CurrentControlSet\Services\Class\Ndis,“Network
intermediate drivers”
HKLM,System\CurrentControlSet\Services\Class\Ndis,Icon,“-6”
HKLM,System\CurrentControlSet\Services\Class\Ndis,NoUseClass,“1”
HKLM,System\CurrentControlSet\Services\Class\Ndis,DevLoader,“*ndis”
HKLM,Enum\Root\NDIS\PASSTHRU
HKLM,Enum\Root\NDIS\PASSTHRU,DeviceDesc,“PASSTHRU Protocol driver”
HKLM,Enum\Root\NDIS\PASSTHRU,Class,“Ndis”
HKLM,Enum\Root\NDIS\PASSTHRU,ConfigFlags,1,10,00,00,00
HKLM,Enum\Root\NDIS\PASSTHRU,Driver,“Ndis”

[PASSTHRU.IMDevNode.DelReg]
HKLM,Enum\Root\NDIS\PASSTHRU

[PASSTHRU.CopyFiles]
Passthru.sys,2

[PASSTHRU.Inf.CopyFiles]
Passthru.inf,2

[PASSTHRU.Remove]
DelReg=PASSTHRU.IMDevNode.DelReg

;-----------------------------------------------------------------------
----;
; PASSMINI – Miniport edge
;
;-----------------------------------------------------------------------
----;

[PASSMINI.ndi]
AddReg=PASSMINI.ndi.reg
DeviceID=PASSMINI
MaxInstance=8
DriverVer=06/08/2000

[PASSMINI.ndi.reg]
HKR,Ndi,DeviceID,PASSMINI
HKR,Ndi,MaxInstance,8
HKR,NDIS,LogDriverName,PASSMINI
HKR,NDIS,MajorNdisVersion,1,03
HKR,NDIS,MinorNdisVersion,1,0A
HKR,Ndi\Interfaces,DefUpper,“ndis3,ndis4,ndis5”
HKR,Ndi\Interfaces,DefLower,“PASSTHRU”
HKR,Ndi\Interfaces,UpperRange,“ndis3,ndis4,ndis5”
HKR,Ndi\Interfaces,LowerRange,“PASSTHRU”
HKR,Ndi\Install,“PASSMINI.Install”
HKR,Ndi\Remove,“PASSMINI.Remove”
HKR,Ndi,HelpText,%PASSMINI_HELP%
HKR,Ndi\Compatibility,RequireAll,“PASSTHRU”

[PASSMINI.Install]
AddReg=PASSMINI.AddReg
CopyFiles=PASSMINI.CopyFiles

[PASSMINI.AddReg]
HKR,DevLoader,*ndis
HKR,DeviceVxDs,passthru.sys
HKR,RealClass,Net

[PASSMINI.CopyFiles]

[PASSMINI.Remove]
AddReg=PASSMINI.Rmv.AddReg

[PASSMINI.Rmv.AddReg]

;-----------------------------------------------------------------------
----;
; DIRECTORIES and STRINGS
;
;-----------------------------------------------------------------------
----;

[DestinationDirs]
DefaultDestDir = 11
PASSTHRU.CopyFiles = 11
PASSTHRU.Inf.CopyFiles = 17
PASSMINI.CopyFiles = 11

[strings]
V_MS=“Microsoft”
V_CLASSNAME=“Network Protocol”
PASSTHRU.DeviceDesc=“PASSTHRU Protocol”
PASSTHRU_HELP=“This implements the protocol edge of the PASSTHRU NDIS
Intermedate Driver example.”
PASSMINI.DeviceDesc=“PASSTHRU Miniport”
PASSMINI_HELP=“This creates the miniport edge of the PASSTHRU NDIS
Intermedate Driver example.”

-----Original Message-----
From: Sumit Pandya [mailto:xxxxx@elitecore.com]
Sent: Thursday, July 12, 2001 8:20 AM
To: NT Developers Interest List
Subject: [ntdev] cont… Intermediate NDIS Driver

Hi,
Sorry to all, to post message without complition,
I wanted some change TCP/IP packet by this stuff before the packet
sent out.
I’m sure i’ll be getting a very good break through from you GURUS by
providing more clearification and letting you know title of the job.

– Sumit Pandya

----- Original Message -----
From: Sumit Pandya
To: xxxxx@lists.osr.com
Sent: Thu Jul 12 20:41:56 GMT+05:30 2001
Subject: Intermediate NDIS Driver

Hi GURUS,

I’m developing a solution, which requires a baseline like
“IMSamp of Win-NT” and “passthrough of W2K”. This solution is suppose to
be develop on all win32 platforms, i.e. Win9x, WinNT, and W2K. From the
earlier messages on the list I knew porting the IMSamp is next
impossible. Now I need a guideline to start in this direction and
especially for Win95, which is the major headache for me or for any
beginner in this driver development.
So, before I made all my practice waste I need a proper
direction.

Accepting expert’s directive for this energy :slight_smile:

– Sumit Pandya


eLitecore Technologies Pvt. Ltd.


eLitecore Technologies Pvt. Ltd.


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi, you have said that porting IMSamp to Win2k was next to impossible. May
I know why? Or can somebody tell me why?

Am I right to say that only the packet management is different. IMSamp uses
a series of SLists, eg. PacketSList, ResidualSList, LookaheadBufferSList.
Are they important? Coz passthru is doing fine without these stuff.

Still don’t understand… :frowning:

Zelin


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com