bburgin
Sun Sep 07 13:27:17 CDT 2003
------=_NextPart_0001_DFA29F7C
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Tom,
1) Below, I copied the INF that I use. It needed several modifications to
work on 9x/me do declare the DevLoader and DeviceVxDs. Also, for Windows
ME, you MUST declare all three flavors of NDIS: "ndis3,ndis4,ndis5". See
KB 282778 (
http://support.microsoft.com/default.aspx?scid=kb;[LN];282778).
2) Keep in mind that the driver and console app are built in the NT-based
world (2K/XP/etc) and it expects that its strings are Unicode. However,
when the 9x/me operating system calls your Bind Adapter handler, it calls
it with an ASCII adapter name. This is fine -- whatever name you receive,
just pass to NdisOpenAdapter unaltered. However, NDISUIO also caches a
copy of each adapter to binds to so that it can report these names when
your console app asks to enumerate the list. When you make this copy, I
found it best to convert the cached copy to Unicode. The adapter names in
9x/ME are usually "0000" or "0001", etc. Passing this ASCII string ("0000"
being 0x3030303000) to a console application that is expecting Unicode
(0x00300030003000300000) will make the string look like garbage.
3) The last problem I can remember is that the CreateFile in the colsole
application tries to open "\\\\.\\\\ndisuio", which, notwithstanding the
extra backslashes, works on 2K fails in 9x/ME. It should be
"\\\\.\\ndisuio".
As always, make sure that your device name in the INF matches the name you
pass to NdisRegisterProtocol, and by tradition, I always have that match my
binary name.
Bryan S. Burgin
bburgin@microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
; NDISUIO.INF
;
; NDISUIO Transport
;
; Copyright 2001, Microsoft Corporation
[version]
signature="$CHICAGO$"
Class=NetTrans
provider=%V_MS%
[Manufacturer]
%V_MS%=MS
[MS]
%NDISUIO.DeviceDesc%= NDISUIO.ndi, NDISUIO
;***************************************************************************
*
; NDISUIO
;***************************************************************************
*
[NDISUIO.ndi]
CopyFiles=NDISUIO.CopyFiles
AddReg=NDISUIO.ndi.reg
DeviceID=NDISUIO
MaxInstance=8
[NDISUIO.ndi.reg]
HKR,Ndi,DeviceID,,NDISUIO
HKR,Ndi,MaxInstance,,8
;;;HKR,Ndi,NdiInstaller,,"MyNdi.dll,MyNdiProc"
; NDIS info
HKR,NDIS,LogDriverName,,"NDISUIO"
HKR,NDIS,MajorNdisVersion,1,05
HKR,NDIS,MinorNdisVersion,1,00
; Interfaces
HKR,Ndi\Interfaces,DefUpper,,""
HKR,Ndi\Interfaces,DefLower,,"ndis3,ndis4,ndis5"
HKR,Ndi\Interfaces,UpperRange,,""
HKR,Ndi\Interfaces,LowerRange,,"ndis3,ndis4,ndis5"
; Install-Remove Sections
HKR,Ndi\Install,,,"NDISUIO.Install"
HKR,Ndi\Remove,,,"NDISUIO.Remove"
; Context help
HKR,Ndi,HelpText,,%NDISUIO_HELP%
[NDISUIO.Install]
AddReg=NDISUIO.AddReg
DelReg=NDISUIO.Ins.DelReg
CopyFiles=NDISUIO.CopyFiles
[NDISUIO.AddReg]
HKR,,DevLoader,,*ndis,*ntkern
HKR,,DeviceVxDs,,"ndisuio.sys"
[NDISUIO.CopyFiles]
ndisuio.sys
[NDISUIO.Remove]
DelReg=NDISUIO.Rmv.DelReg
DelFiles=NDISUIO.CopyFiles
[NDISUIO.Rmv.DelReg]
;***************************************************************************
*
; Destination Directories
;***************************************************************************
*
[DestinationDirs]
NDISUIO.CopyFiles = 11 ; LDID_SYS
[SourceDisksNames]
[SourceDisksFiles]
;***************************************************************************
*
; Localizable Strings
;***************************************************************************
*
[strings]
V_MS="Microsoft"
V_CLASSNAME="Network Protocol"
; Devices
NDISUIO.DeviceDesc="Sample NDISUIO Protocol Driver"
; Parameters
PARAM_YES="Yes"
PARAM_NO="No"
PARAM_OFF="Off"
PARAM_NONE="None"
; Context help
NDISUIO_HELP="Sample Protocol Driver"
------=_NextPart_0001_DFA29F7C
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20
\par Tom,
\par
\par 1) Below, I copied the INF that I use. It needed several modifications to work on 9x/me do declare the DevLoader and DeviceVxDs. Also, for Windows ME, you MUST declare all three flavors of NDIS: "ndis3,ndis4,ndis5". See KB 282778 (
http://support.microsoft.com/default.aspx?scid=kb;[LN];282778).
\par
\par 2) Keep in mind that the driver and console app are built in the NT-based world (2K/XP/etc) and it expects that its strings are Unicode. However, when the 9x/me operating system calls your Bind Adapter handler, it calls it with an ASCII adapter name. This is fine -- whatever name you receive, just pass to NdisOpenAdapter unaltered. However, NDISUIO also caches a copy of each adapter to binds to so that it can report these names when your console app asks to enumerate the list. When you make this copy, I found it best to convert the cached copy to Unicode. The adapter names in 9x/ME are usually "0000" or "0001", etc. Passing this ASCII string ("0000" being 0x3030303000) to a console application that is expecting Unicode (0x00300030003000300000) will make the string look like garbage.
\par
\par 3) The last problem I can remember is that the CreateFile in the colsole application tries to open "\\\\\\\\.\\\\\\\\ndisuio", which, notwithstanding the extra backslashes, works on 2K fails in 9x/ME. It should be "\\\\\\\\.\\\\ndisuio".
\par
\par As always, make sure that your device name in the INF matches the name you pass to NdisRegisterProtocol, and by tradition, I always have that match my binary name.
\par
\par
\par Bryan S. Burgin
\par bburgin@microsoft.com
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par ; NDISUIO.INF
\par ;
\par ; NDISUIO Transport
\par ;
\par ; Copyright 2001, Microsoft Corporation
\par
\par [version]
\par signature="$CHICAGO$"
\par Class=NetTrans
\par provider=%V_MS%
\par
\par [Manufacturer]
\par %V_MS%=MS
\par
\par [MS]
\par %NDISUIO.DeviceDesc%= NDISUIO.ndi, NDISUIO
\par
\par
\par ;****************************************************************************
\par ; NDISUIO
\par ;****************************************************************************
\par [NDISUIO.ndi]
\par CopyFiles=NDISUIO.CopyFiles
\par AddReg=NDISUIO.ndi.reg
\par DeviceID=NDISUIO
\par MaxInstance=8
\par
\par [NDISUIO.ndi.reg]
\par HKR,Ndi,DeviceID,,NDISUIO
\par HKR,Ndi,MaxInstance,,8
\par ;;;HKR,Ndi,NdiInstaller,,"MyNdi.dll,MyNdiProc"
\par
\par ; NDIS info
\par HKR,NDIS,LogDriverName,,"NDISUIO"
\par HKR,NDIS,MajorNdisVersion,1,05
\par HKR,NDIS,MinorNdisVersion,1,00
\par
\par ; Interfaces
\par HKR,Ndi\\Interfaces,DefUpper,,""
\par HKR,Ndi\\Interfaces,DefLower,,"ndis3,ndis4,ndis5"
\par HKR,Ndi\\Interfaces,UpperRange,,""
\par HKR,Ndi\\Interfaces,LowerRange,,"ndis3,ndis4,ndis5"
\par
\par ; Install-Remove Sections
\par HKR,Ndi\\Install,,,"NDISUIO.Install"
\par HKR,Ndi\\Remove,,,"NDISUIO.Remove"
\par
\par ; Context help
\par HKR,Ndi,HelpText,,%NDISUIO_HELP%
\par
\par [NDISUIO.Install]
\par AddReg=NDISUIO.AddReg
\par DelReg=NDISUIO.Ins.DelReg
\par CopyFiles=NDISUIO.CopyFiles
\par
\par [NDISUIO.AddReg]
\par HKR,,DevLoader,,*ndis,*ntkern
\par HKR,,DeviceVxDs,,"ndisuio.sys"
\par
\par [NDISUIO.CopyFiles]
\par ndisuio.sys
\par
\par [NDISUIO.Remove]
\par DelReg=NDISUIO.Rmv.DelReg
\par DelFiles=NDISUIO.CopyFiles
\par
\par [NDISUIO.Rmv.DelReg]
\par
\par ;****************************************************************************
\par ; Destination Directories
\par ;****************************************************************************
\par [DestinationDirs]
\par NDISUIO.CopyFiles = 11 ; LDID_SYS
\par
\par [SourceDisksNames]
\par
\par [SourceDisksFiles]
\par
\par ;****************************************************************************
\par ; Localizable Strings
\par ;****************************************************************************
\par [strings]
\par V_MS="Microsoft"
\par V_CLASSNAME="Network Protocol"
\par
\par ; Devices
\par NDISUIO.DeviceDesc="Sample NDISUIO Protocol Driver"
\par
\par ; Parameters
\par PARAM_YES="Yes"
\par PARAM_NO="No"
\par PARAM_OFF="Off"
\par PARAM_NONE="None"
\par
\par ; Context help
\par NDISUIO_HELP="Sample Protocol Driver"
\par
\par }
------=_NextPart_0001_DFA29F7C--