Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NDISUIO - some basic questions

35 views
Skip to first unread message

Gammaraman

unread,
Aug 9, 2008, 2:15:00 AM8/9/08
to
Hi,

I have some basic questions regarding NDISUIO and I am hoping someone here
can help me out. My platforms of interest are WM 6.1 and WM 7.0.

Basically I want to use NDISUIO to call some custom OIDs my WLAN miniport
driver provides from a user application. So all I want is the
IOCTL_NDISUIO_SET_OID_VALUE and IOCTL_NDISUIO_QUERY_OID_VALUE. I believe on
WM there is no issue with an application calling these IOCTLs even if WZC or
some other service has done a IOCTL_NDISUIO_OPEN_DEVICE since the
ptcDeviceName can be passed with the set/query IOCTLs.

Is there anything special that needs to be done from an application
perspective to use NDISUIO other than CreateFile and DeviceIoControl with
IOCTL_NDISUIO_SET_OID_VALUE/IOCTL_NDISUIO_QUERY_OID_VALUE with the
ptcDeviceName?

Does the application have to load the NDISUIO driver or is this loaded at
system start?

What happens if the NDISUIO driver is not loaded when application calls the
DeviceIoControl? What happens if there is no binding between the NDISUIO and
ptcDeviceName?

How can the application find out whether a given OID is supported by the
device? Is it application expected to query OID_GEN_SUPPORTED_LIST? Can NDIS
be relied upon to pass the custom OID supported information upto application?

Is there anything special that needs to be done from a WLAN miniport driver
perspective to work with NDISUIO? Is the miniport driver even aware of
NDISUIO? Does it even care?

How does the NDISUIO driver bind to the WLAN miniport driver? Is it the case
that when the WLAN miniport driver registers with NDIS by calling
NdisRegisterAdapter, NDIS will tell NDISUIO to create a binding to the
miniport? If not, how can I setup a binding between NDISUIO and my miniport
driver?

When the miniport driver gets a packet and it indicates it to NDIS, who will
NDIS send the packet to if multiple protocol drivers (say a IP protocol
driver and the NDISUIO driver) are bound to the same miniport? Is there a
chance that presence of the NDISUIO will impact the other protocol drivers
who care about the 802.3/802.11 frames?

Lastly, is marshalling handled by NDIS? So if an application passes a
pointer to a buffer in its address space with a query_oid, does the miniport
not have to worry about marshalling and it can just write to that pointer? Is
the differences in the memory architecture between WinCE 5.0 and WinCE6.0
handled by NDIS itself?

Thanks.

Maxim S. Shatskih

unread,
Aug 10, 2008, 2:42:05 PM8/10/08
to
> How does the NDISUIO driver bind to the WLAN miniport driver? Is it the case
> that when the WLAN miniport driver registers with NDIS by calling
> NdisRegisterAdapter, NDIS will tell NDISUIO to create a binding to the
> miniport?

Yes, same ProtocolBindAdapter call.

> When the miniport driver gets a packet and it indicates it to NDIS, who will
> NDIS send the packet to if multiple protocol drivers (say a IP protocol
> driver and the NDISUIO driver) are bound to the same miniport? Is there a
> chance that presence of the NDISUIO will impact the other protocol drivers
> who care about the 802.3/802.11 frames?

No, the packet is delivered to all protocols sequentially.

> Lastly, is marshalling handled by NDIS? So if an application passes a
> pointer to a buffer in its address space with a query_oid, does the miniport
> not have to worry about marshalling and it can just write to that pointer?

No, NDISUIO does this.

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

Gammaraman

unread,
Aug 10, 2008, 4:55:01 PM8/10/08
to
Thanks, Maxim. I appreciate your help.

How does NDIS know that it should call ProtocolBindAdapter to setup a
binding between NDISUIO and the miniport adapter when the miniport does a
NdisRegisterAdapter?

NDISUIO may not have registered with NDIS at the time the miniport driver
registers with NDIS. Isn't this possible?

Maxim S. Shatskih

unread,
Aug 10, 2008, 5:13:48 PM8/10/08
to
> How does NDIS know that it should call ProtocolBindAdapter to setup a
> binding between NDISUIO and the miniport adapter when the miniport does a
> NdisRegisterAdapter?

Due to registry structures mentioning NDISUIO.

> NDISUIO may not have registered with NDIS at the time the miniport driver
> registers with NDIS. Isn't this possible?

In CE? hardly I think. It is embedded to the image.

Gammaraman

unread,
Aug 10, 2008, 8:16:00 PM8/10/08
to
Thanks, Maxim. I appreciate your help.

Can you please elaborate on "registry structures mentioning NDISUIO"?

I found this snippet on MSDN

"The NDISUIO driver is installed as an NDIS protocol that is bound to all
devices installed with an Interfaces value in the registry of either ndis4 or
ndis5. When NDISUIO is loaded, NDIS calls ProtocolBindAdapter for all devices
it is configured to bind to"

So in the snippet below can you please tell me what should be added/modified
to make NDIS call ProtocolBindAdapter in NDISUIO? I mean where do I add the
required entry?

"
HKEY_LOCAL_MACHINE\Comm\<MiniportDriverName>]
"Group"="NDIS"
"ImagePatch"="<driver>.dll"
[HKEY_LOCAL_MACHINE\Comm\<AdapterInstanceName>\Parms]
"BusNumber"=dword:<busnumber>
"BusType"=dword:<bustype>
"

I found this other snippet on MSDN which seems to imply that the binding
between NDISUIO and the adapter is created in response to
IOCTL_NDISUIO_OPEN_DEVICE. This seems to contradict what is said above OR am
I reading this wrong?

"
The following function call shows the use of IOCTL_NDISUIO_OPEN_DEVICE to
create a binding with an NE20001 network device using the handle obtained
from CreateFile.

DeviceIoControl(
hAdapter,
IOCTL_NDISUIO_OPEN_DEVICE,
TEXT("NE20001"),
wcslen(TEXT("NE20001")) * sizeof(TCHAR),
NULL,
0,
&dwReturnedBytes,
NULL);

0 new messages