NDIS

Hello,

I am developing the NDIS NIC driver on win 98.
I am getting an link error ndis.lib not found.
I have searched the win 98 DDK and system files but i couldn’t get
the ndis.lib file,

Please suggest me where can i find the ndis.lib file or any other
lib file used to develop ndis nic driver in win 98.

Thanks and Rgeds
siddappa


There is always a better job for you at Monsterindia.com.
Go now http://monsterindia.com/rediffin/

For Win98 you should develop a NDIS 5.0 driver. This is done using either the Windows 2000 DDK or the newer XP DDK (called Windows DDK now).

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of siddappa siddu
attur
Sent: Monday, July 01, 2002 8:46 AM
To: NT Developers Interest List
Subject: [ntdev] NDIS

Hello,

I am developing the NDIS NIC driver on win 98.
I am getting an link error ndis.lib not found.
I have searched the win 98 DDK and system files but i couldn’t get
the ndis.lib file,

Please suggest me where can i find the ndis.lib file or any other
lib file used to develop ndis nic driver in win 98.

Thanks and Rgeds
siddappa


There is always a better job for you at Monsterindia.com.
Go now http://monsterindia.com/rediffin/


You are currently subscribed to ntdev as: xxxxx@thesycon.de
To unsubscribe send a blank email to %%email.unsub%%

Siddappa,

There are samples of writing miniports in the Windows 98 DDK. However,
I would strongly recommend writing the driver from the Windows 2000/XP
DDK samples and build a .SYS driver. You would do so using the 2000 DDK
or the XP DDK with the 2000 build environment. To make such a driver
load in Windows 98, there are a few items to consider. I list several
of them below, for your reference.

Bryan S. Burgin
xxxxx@microsoft.com

This posting is provided “AS IS” with no warranties, and confers no
rights.


WHICH DDK

Use the Windows 2000 DDK.

Do not use the Windows 98 DDK for writing .SYS drivers. You will only
require the Windows 98 DDK for programmatic installation (IPNEW), custom
NDI procedures (MyNDI) and for the kernel debugger (WDEB98/RTERM).


UNSUPPORTED FUNCTIONS/CODE=2

Some NDIS/Operating System functions are not supported in Windows 9x/Me
and will prevent your driver from loading. The System Information will
report Code=2. To determine the function that is causing this failure,
load the debug version of VxDLDR.VxD to the Windows\System\Vmm32 folder.
It will emit debug spew to the kernel debug console with a message
similar to “PELDR: MyDriver.sys can’t find export in module
.” You will have to find alternatives for any functions that are
not supported.


NDIS VERSIONS


Be careful to properly match the NDIS version with the target operating
system. The NDIS version for each OS is as follows:

Windows 95: NDIS v 3.10
Windows 98 FE: NDIS v 4.0
Windows 98 SE: NDIS v 5.0
Windows ME: NDIS v 5.0
Windows 2000: NDIS 5.0
Windows XP: NDIS 5.1

Specify the required version number in your SOURCES file with an
appropriate -DNDISxx declare.

Also remember to set the proper version number in structures that
require versioning, like ProtocolCharacteristics. Page faults will most
likely occur if a higher version is passed in characteristic structures
than that which is defined in the SOURCES file.


BINARY_COMPATIBLE/FUNCTIONS v MACROS


Always define BINARY_COMPATIBLE when building drivers for Windows 9x/Me.
Many NDIS functions are implemented as macros in Windows 2000 and XP.
See the declaration of NdisSend and NdisRequest, both as a macro
declaration and as a function prototype.

Failure to do so will yield unpredictable results. But most likely, a
page fault will occur as your driver will jump to a random instruction
in memory.

Behind the scenes, the BindingHandle that NidsOpenAdapter returns
contains pointers directly to the miniport’s handlers, bypassing
intermediate calls into NDIS. This is not supported in Windows 9x/ME.


STRINGS/ANSI v UNICODE


Functions that use strings, like NdisOpenAdapter and a protocol’s
BindAdapterHandler will use UNICODE strings in Windows 2000/XP and ANSI
strings in Windows 9x/ME. The DDK will always assume UNICODE strings,
so actual manipulation of strings in 9x/Me will require special
handling.

A protocol’s BindAdapterHandler contains a pointer to the adapter’s
name, which it generally passes down to NdisOpenAdapter untouched. This
is acceptable in 9x/Me because the contents of the string is never
manipulated. However, in the NDISUIO XP DDK sample, the string is
stored as UNICODE for later use. In the 9x/ME version of NDISUIO,
either the copied string must be converted and stored in UNICODE or the
driver and corresponding console application must be modified to pass
ANSI strings throughout.


INF DIFFERENCES


Windows 2000/XP .INF files contain sections to install services, which
include entries for Start, Group, ErrorControl and Type. Services are
not used in Windows 9x/ME. Instead, DevLoader and DeviceVxDs entries
must be created.

Sample Windows 2000/XP INF section:

[Install.Service]
AddService=MyDriver,MYDRIVER_Service_Inst

[MYDRIVER_Service_Inst]
DisplayName = %MYDRIVER_Desc%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 2 ;SERVICE_AUTO_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\packet.sys
LoadOrderGroup = “PNP_TDI”
AddReg = AddReg_MYDRIVER_Service_Inst
Description = %MYDRIVER_Desc%

Sample Windows 9x/ME INF section:

AddReg=MYDRIVER.AddReg

[MYDRIVER.AddReg]
HKR,DevLoader,“*ndis,*ntkern”
HKR,DeviceVxDs,“MYDRIVER.sys”

Mine the Windows\Inf folder for sample .INF files.


DEBUGING/WIN98


The kernel debugger for Windows 98 and Windows 98 SE is contained in the
Windows 98 DDK. On the target system, copy the program WDEB98.EXE to
the Windows\System folder. In that system’s AUTOEXEC.BAT, add:

CD \WINDOWS\SYSTEM
WDEB98 /b /c:1 /r=9600 …\WIN.COM

/b will cause the system to break when VMM32 starts, this gives a good
opportunity to load other symbols (NDIS) and set break points

/c and /r select the com port and its rate.

…\WIN.COM causes Windows to be executed

On the debug console, run RTERM98. In Settings|Options, be sure to set
an appropriate symbol search path and communications setting.

When the debugger is at a break point (i.e., VMM32 breaks due to /b,
above), use ‘?’ for additional help.

Documentation can be found in the Windows 98 DDK in the Help folder.
Launch Other.Chm and expand Related Driver Documentation\Windows 95
Documentation\Programmer’s Guide\WDEB386 System Debugger (WDEB98/RTERM98
was known as WDEB386/RTERM386 in the 95 documentation).


DEBUGING/WINME


Obtain the Windows ME Debug Kit at
http://www.microsoft.com/ddk/debugging. Download the Microsoft
Debugging Tools for Windows Me. Copy the executable to the target
machine, launch, and follow the on screen instructions. Copy the binary
RTERM.EXE to the debug console.


DEBUG BINARIES/SYMBOLS/WIN9X


The checked binaries for Windows 98 and Windows 98 SE can be found on
the MSDN CD labeled “Windows 98 Other Versions.”


DEBUG BINARIES/SYMBOLS/WINME


Debug/checked NDIS binaries were not distributed. They can be
downloaded via Knowledgebase article Q241517. Also view Knowledgebase
article Q279356 for tips on using the debug version of NDIS.VxD.


SYSTEM FILE PROTECTION (SFP)/WINME


Follow the instructions in Q279356 (NDIS Debugging Tips for Windows ME)
carefully. You must disable SFP before replacing any system files in
Windows ME, including NDIS.VxD. Either boot up in safe mode (use F5
when starting Windows) or boot off of a Windows ME startup disk.

Also be aware that anytime you exit Network Neighborhood properties, the
original “free” version of NDIS.VxD may be re-installed. The checked
version will be over 300K.


NDIS_BUFFER


Never touch the elements of NDIS_BUFFER directly. This structure is
vastly different between Windows 98/ME and Windows 2000/XP (where it’s a
MDL). Use the NDIS functions to access NDIS_BUFFER elements and treat
that structure as completely opaque. Use NdisQueryBuffer, for example,
to obtain a pointer to the buffer’s data.


RESOURCES


Q248413 [Win2K]
INFO: NDIS Debug Tracing and Kernel Debugger Extensions

Q266403 [Win2K]
HOWTO: Enable and Use NDIS Verifier

Q232515 [Win9x]
INFO: NDIS Level and Component Debugging Flags

Q279356 [WinME]
HOWTO: NDIS Debugging Tips for Windows ME

Q198582 [Win2K/Win9x/WinME]
INFO: NDIS Binary-Compatibility on Windows 98 and Windows 2K

Q224784 [Win2K/Win9x/WinME]
HOWTO: Writing WDM/NDIS Miniports for Windows

Q241517 [WinME]
SAMPLE: Ndis.exe Windows ME NDIS Debug Binaries

Q280063 [WinME]
DOC: MillinniumPreferred Directive Added to Net Class INF

Q282757 [WinME]
HOWTO: Use Network Setup Debug Extensions to NetDI for WinME

Q282778 [WinME]
INFO: Setting LowerRange for NDIS Protocol Drivers in WinME

Visual C v 1.52c:
MSDN Platform Archive package, Disk 3, “16-bit DDKs”

-----Original Message-----
From: siddappa siddu attur [mailto:xxxxx@rediffmail.com]
Sent: Sunday, June 30, 2002 11:46 PM
To: NT Developers Interest List
Subject: [ntdev] NDIS

Hello,

I am developing the NDIS NIC driver on win 98.
I am getting an link error ndis.lib not found.
I have searched the win 98 DDK and system files but i couldn’t get
the ndis.lib file,

Please suggest me where can i find the ndis.lib file or any other
lib file used to develop ndis nic driver in win 98.

Thanks and Rgeds
siddappa

_________________________________________________________
There is always a better job for you at Monsterindia.com.
Go now http://monsterindia.com/rediffin/


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

I stumbled upon another difference between W9x and NT using
NdisReadConfiguration.

If you try to read NdisParameterHexInteger with NdisReadConfiguration
then the value itself has to be stored as a REG_SZ in the registry of
W9x systems. On NT systems you can read REG_DWORDS.

@Bryan: Can you please confirm?


| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann E+V GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“He is truly wise who gains wisdom from another’s mishap.”