Writing a windows class driver - windows

I'm new to WDM driver development, but I have an experience developing
Linux drivers.
i want to develop Ethernet over USB class driver for windows XP. (CDC-ECM class driver)
i know that windows only support RNDIS/NDIS for the network class and thus i will need to write a custom windows driver that replace the RNDIS driver while maintaining the rest of the USB stack.
so far i downloaded the windows driver kit (WDK) and still reading the documentation.
does anyone know how to do this or where to get started ? (other than WDK documentation)
i tried google but still can't figure it out.
Regards,

You have to write a NDIS Miniport driver which uses a USB KMDF miniport driver at the lower edge.

Related

Writing a UMDF virtual device driver (or software device) like Virtual DVD

I have an "off the shelf" commercial software using an ANT USB dongle to communicate with a cycling trainer.
My trainer is not compatible with the software because the protocol is slightly different (not a lot).
My goal is to write a protocol translator. The only thing I can think of is to write a UMDF virtual device driver (like Magic ISO Virtual DVD) looking like an ANT USB Device in the device manager (same PID\VID) while connecting itself to the physical ANT device. The virtual device driver will perform the protocol translation.
I looked at several examples from Microsoft here https://github.com/Microsoft/Windows-driver-samples but I was unable to find anything relevant. I thought this example would be a good start https://github.com/Microsoft/Windows-driver-samples-master/Sensors/CustomSensors but it is impossible to load the driver using the given procedure from the inf file.
BTW I am familiar with the content of INF files and the basics of KMDF & UMDF device drivers programming. My problem is to write something that will load in the device manager and present itself as a real USB device even if it is not enumerated by the USB bus subsystem.
Can anybody with driver development experience point me to some relevant code sample or documentation?
Best regards !
I am currently developing a UMDF CCID (smartcard reader) driver. This project helped me at the beginning because it compiles out of the box and creates virtual device nodes (smartcard readers) visible in the device manager.

Include my USB device driver in Windows Update?

How would an OEM go about getting their USB device driver added to Windows Update, so that it will be downloaded and installed automatically when the device is connected to the PC? In our case, if it matters, it will be a custom USB device class, and the driver will wrap WinUSB.
Is it possible to do this for Windows 7, Windows 8, and Windows 10? 32 and 64-bit.
What keywords (for searching) and concepts should I be aware of?
The question is misguided. The interface to WinUSB lives in userspace - not kernel space - so that DLL will be a library that lives in userspace; it won't be a driver.
The device will report via its device descriptors to Windows that it can use the WinUSB driver, so Windows won't look for its wrapper.

How to understand the internal working of NDIS Miniport driver

I am new to Window driver development.
I am trying to understand the working of a NDIS miniport driver (from Microsoft WDK samples). Especially, to understand the packet flow.
As per numerous sources, I have seen suggestions of installing two instances of NDIS miniport driver and proceed from there. However, I am unable to continue from there, as there is only vague info. Please advise - Especially on how to attach a Windows Debugger Tool to an instance of the driver and to see the callbacks being called on sent/receive packets.
My platform: Windows 7 x64 with debug mode set (Debugging Setup: Single Computer).
There is a similar question. But no info about how to debug the driver: NDIS and miniport driver
You can't debug on the same machine in which you are running the driver, you need to use remote machine, that could be a "Real" one or as done usually a VirtualMachine.
Here how to setup a Windows Kernel Debugging environment with a Virtual Machine:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff538143%28v=vs.85%29.aspx
Best way to understand driver internals of driver is to use WPP tracing in driver to print messages and view using traceview.exe. Or using dbgprint() to print messages and these messages are viewed using dbgview.
https://msdn.microsoft.com/en-us/library/windows/hardware/ff556204(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/hardware/ff543632(v=vs.85).aspx

RNDIS driver setup missing win 7 64 bit

Hi I have been trying to connect a few boards to my computer. These boards depend on RNDIS driver to get into concole. So if I connect a board for the first time my Win7 Laptop properly detects it as a RNDIS ethernet adapter or device. But when I plug in the boards second time it just comes up as a unknown device in USB section of device manager. From searching the web I assume that something is RNDIS to fail. So I try to install the driver manually using http://www.sharpduino.com/en/articles/article/19 where it suggest to manually install a driver under Network Adapters > Microsoft Corporation > RNDIS. But here is the problem the entire Microsoft corporation folder in the driver setup is missing. I am getting no help on the web on why this is so.
And this problem is not just on one board but on others as well. Boards used so far Intel Edison, Arietta G25.

NDIS Miniport driver failed to load on XP OS during a particular scenario

Our USB composite device will support different functionality.one interface will support Network functionality.
We are developing different NDIS miniport versions for different OS.(NDIS 5.1 for XP, NDIS 6.1 for Vista and NDIS 6.20 for Windows7 OS).
We have one test case as shown below:
1) After loading all drivers(serial and NDIS) open any serial interface using Hyperterminal
2) Do Some communication (enter AT command etc)
3) Unplug the device with out closing Hyper terminal
4) Replug the device to the same USB port.
For the above test scenario, NDIS miniport driver fails to load after step-4(error code 31) on XP OS.NDIS Miniport drivers' Initialize handler is not called.
On other OS i am not able to reproduce this issue.
Please let me know your valuable suggestions for this issue.
It's possible you're not releasing all of the resources you hold upon unlpug. Check your unplug handler code.

Resources