Hello,

I was wondering if someone could help me, I am using
the standard NDISUIO sample of the Windows XP DDK in
a WIndows 2000 FREE build environment.

I have managed to install it successfully under WIndows 98
and 2000 and XP but run into the following problems:
- Under Windows 2000 none of the adapters bind
- Under Windows 98 I can't seem to retrieve the packets
that are sent back using an MJ_READ command.

The packets I get back do have the correct Header
information (802.1X EAPOL) and the sizes are correct.
60 bytes for the EAPOL Identity. But the data returned
using the IRPS is full of hex 0xAFAFAFAF.

Retrieving and setting OIDS works perfectly.

Has anyone else run into these problems?

I do remember someone stating that MJ_READ and MJ_WRITE
not working with a Windows 98 driver and is this what
I am experiencing? I don't know what is going wrong under
Windows 2000 but maybe the inf file is incorrect.

Thanks

Tom Rixom

RE: NDISUIO, problem reading packets by bburgin

bburgin
Sat Sep 06 13:41:21 CDT 2003

------=_NextPart_0001_DA8909EE
Content-Type: text/plain
Content-Transfer-Encoding: 7bit



I recall the same comment about MJ_READ and MJ_WRITE not working on 98, but
I'm not able to immediately find the exact reference. If I do, I'll post
it later. But just use Device IO Control.

On Windows 2000, check the INF for the adapters (their upper edge) and the
lower edge of your protocol -- as a starting place. I would expect "ndis5"
to be specified in both, and therefore the first requirement for binding is
satisfied. But that's a place to start.

Is your bind adapter handler getting called at all? Does your protocol
show up in the adapter's properties at all (you may have to check your
flags in your INF to make sure that it's not hidden)?

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_DA8909EE
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
\par I recall the same comment about MJ_READ and MJ_WRITE not working on 98, but I'm not able to immediately find the exact reference. If I do, I'll post it later. But just use Device IO Control.
\par
\par On Windows 2000, check the INF for the adapters (their upper edge) and the lower edge of your protocol -- as a starting place. I would expect "ndis5" to be specified in both, and therefore the first requirement for binding is satisfied. But that's a place to start.
\par
\par Is your bind adapter handler getting called at all? Does your protocol show up in the adapter's properties at all (you may have to check your flags in your INF to make sure that it's not hidden)?
\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 }
------=_NextPart_0001_DA8909EE--


RE: NDISUIO, problem reading packets by Tom

Tom
Sun Sep 07 03:41:10 CDT 2003

I recall the thread to and it was Thomas F. Divine who
stated that MJ_READ will not work for Windows 98/ME
but he did not reveal why...

I am using the inf file provided with the WIndows XP DDK.
And I just tested the driver on XP and this gives the
same problems. My bind adapter handler is not being
called.

But I have now got my device driver dumping the output
from the NDISQuery and it is full of junk. THe size
is correct but the buffer contains AFAFAFAFAFAF.

BTW. When using Device IO I will have to create a message
like NDISUIO_READ_PACKET I guess. Is it then possible to
use the MDLAddress of the IRP of this call, which means I
can simple queue the IRP and respond to it using the
serviceReads function or do I have to respond directly by
reading the first packet of the packet queue. The latter
is not really what I want as it would require a sort of
polling mechanism.

Also I checked the documentation of using IRPs and it
states when using buffered IO you cannot use the
MDLaddress of an IRP. I find this strange as the
serviceReads actually does use the MDLAddress to transfer
the data and when looking at the definiton of the READ in
ndisuio.h it uses the METHOD_BUFFERED flag which means
the call is using buffered IO right?

Thanks,

Tom.

>-----Original Message-----
>
>
>I recall the same comment about MJ_READ and MJ_WRITE not
working on 98, but
>I'm not able to immediately find the exact reference.
If I do, I'll post
>it later. But just use Device IO Control.
>
>On Windows 2000, check the INF for the adapters (their
upper edge) and the
>lower edge of your protocol -- as a starting place. I
would expect "ndis5"
>to be specified in both, and therefore the first
requirement for binding is
>satisfied. But that's a place to start.
>
>Is your bind adapter handler getting called at all?
Does your protocol
>show up in the adapter's properties at all (you may have
to check your
>flags in your INF to make sure that it's not hidden)?
>
>Bryan S. Burgin
>bburgin@microsoft.com
>
>This posting is provided "AS IS" with no warranties, and
confers no rights.

RE: NDISUIO, problem reading packets by Tom

Tom
Sun Sep 07 08:13:54 CDT 2003

I am testing on Windows XP SP1 now.

I have changed the inf file so the protocol now shows up
in the adapter properties. This means (I think) the
installation is proceeding correctly. But again the bind
adapter is not called. So when I do a query bindings it
returns empty.

I am using the standard INF and source from the Windows
XP DDK but I have changed the name of the sys to my own
name. Maybe I screwed up here...

The standard ndisuio driver running on WinXP does work.

T.

>-----Original Message-----
>I recall the thread to and it was Thomas F. Divine who
>stated that MJ_READ will not work for Windows 98/ME
>but he did not reveal why...
>
>I am using the inf file provided with the WIndows XP DDK.
>And I just tested the driver on XP and this gives the
>same problems. My bind adapter handler is not being
>called.
>
>But I have now got my device driver dumping the output
>from the NDISQuery and it is full of junk. THe size
>is correct but the buffer contains AFAFAFAFAFAF.
>
>BTW. When using Device IO I will have to create a message
>like NDISUIO_READ_PACKET I guess. Is it then possible to
>use the MDLAddress of the IRP of this call, which means
I
>can simple queue the IRP and respond to it using the
>serviceReads function or do I have to respond directly
by
>reading the first packet of the packet queue. The latter
>is not really what I want as it would require a sort of
>polling mechanism.
>
>Also I checked the documentation of using IRPs and it
>states when using buffered IO you cannot use the
>MDLaddress of an IRP. I find this strange as the
>serviceReads actually does use the MDLAddress to
transfer
>the data and when looking at the definiton of the READ
in
>ndisuio.h it uses the METHOD_BUFFERED flag which means
>the call is using buffered IO right?
>
>Thanks,
>
>Tom.
>
>>-----Original Message-----
>>
>>
>>I recall the same comment about MJ_READ and MJ_WRITE
not
>working on 98, but
>>I'm not able to immediately find the exact reference.
>If I do, I'll post
>>it later. But just use Device IO Control.
>>
>>On Windows 2000, check the INF for the adapters (their
>upper edge) and the
>>lower edge of your protocol -- as a starting place. I
>would expect "ndis5"
>>to be specified in both, and therefore the first
>requirement for binding is
>>satisfied. But that's a place to start.
>>
>>Is your bind adapter handler getting called at all?
>Does your protocol
>>show up in the adapter's properties at all (you may
have
>to check your
>>flags in your INF to make sure that it's not hidden)?
>>
>>Bryan S. Burgin
>>bburgin@microsoft.com
>>
>>This posting is provided "AS IS" with no warranties,
and
>confers no rights.
>.
>

RE: NDISUIO, problem reading packets by bburgin

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--


RE: NDISUIO, problem reading packets by Tom

Tom
Sun Sep 07 18:19:42 CDT 2003

Thanks!

I found the error and it was indeed something to do with
the names used for your driver (Do not use a "_" as it
will not bind under WIndows 2000 or XP, Windows 98 doesnt
seem to mind). I got it working now on both Windows 2000
and XP.

I am still having trouble with the Windows 98 version
though. I am outputting the buffer from the
NDISQueryBuffer using the DEBUGPDUMP macro (in the driver
itself) and all I get is the AFAFAF I have been talking
about. Any ideas what I am doing wrong here? Like I said
I am using an unaltered NDISUIO sample. Off course this
works fine on XP and 2K.

Tom.

>-----Original Message-----
>
>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"