As Anton said, “mixing NDIS and WDM in the same driver is a bad idea.” But let me clarify that – the same driver cannot use both NDIS and WDM as its “top” edge, at least not without some dancing.
So the next question is – what kind of WDM requests do you need to perform on the “top” edge? If you build an NDIS driver, then NDIS controls your top edge. You receive network packets, indicate packets, handle set/get property requests, etc. You don’t get IRP_MJ_CREATE, or IRP_MJ_DEVICE_CONTROL, etc. These are all “consumed” or hidden by the NDIS wrapper layer. This is because your device is supposed to look and feel like a network device, not a WDM device.
So what kind of requests do you need to send down? Who will send those requests? If you need to manage configuration or status information, then NDIS provides a decent framework for that. But if you need something else (I don’t know what – you tell me), then you may need to use one of the uglier aspects of NDIS. You may need to use NdisMRegisterDevice, which will allow your driver to create a single WDM-style device object. A *single* device object – all of your miniports will need to multiplex access through this single device object.
But before continuing, is this necessary? What are you trying to do?
A few linkes on NdisMRegisterDevice:
http://msdn2.microsoft.com/en-us/library/ms804174.aspx
http://www.ndis.com/faq/QA10290101.htm
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Saturday, April 21, 2007 10:20 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is this possible?
Hi Arlie,
There is a 1:1 mapping between USB device and miniport instance.
Currently, the driver is a purely WDM driver i.e it uses IRPs on both upper and lower edge.
I am using the “DisptachRoutine” table - DispatchRead/DispatchCreate/DispatchWrite, etc on the upper edge of my driver to communicate with the application.
But in a classic NdisWDM driver, the upper edge exposes only Ndis Miniport interface.
I tried to open and register a network adapter in my existing WDM driver. The miniport registration routine returns with Ndis status success but then the OS (I/O manager or PnP manager) fails to automatically invoke the MiniportInitialize routine.
In a classic WDM driver, we have a DriverEntry and a AddDevice routine. In a NdisWDM driver, we have a DriverEntry and a MPInitialise (miniportintialize) routine. I guess, i am confused as to how to make my WDM driver open/register and initialize the miniport like a miniport driver manages to do.
Is writing two different drivers the only solution?
Thanks.
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer