Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is my first Windows device driver & I have been assigned a task to develop a Windows device driver from scratch. When the user installs this driver on a windows PC it would ask the user, during the installation process, to enter the number of virtual serial port that user requires & after installation of the driver the number of virtual port desired by the user shall be created. Then the user connects his customized printer to the windows PC via USB port. The user should be able to send data to the printer through the Hyper terminal by selecting any of the newly created Virtual serial port at 9600 baud rate, 8 data bit, No parity & 1 stop bit.

Now to get started I am using a windows 7 system on which I have installed Visual Studio 2015 along with Windows Driver Kit 10 form the MSDN website. I have also downloaded the Windows drivers sample codes form the GITHUB this sample soce base contains a virtualSerial UMDF project under serial/Svirtualserial2. this project file contained 2 projects one being the Virtualserial2 project & the other is a FakeModem project so I deleted the FakeModem project(as its was of no use for me) & successfully compileed the source/VirtualSerial2 sample code. after compilation a .dll(as UDMF drivers have .dll extensions) file gets generated in the debug folded but I don't get any .exe for this driver so I am not sure how can I install this driver on my system. I was also going through this link https://msdn.microsoft.com/en-in/library/windows/hardware/dn745911%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 that list the process to debug a UMDF driver using WinDbg, in an example it also asks us to run the .exe so my 1st question is ***how do I need to generate a .exe file of my driver & test it on a system***.

Along with this I have one more query. after I install my driver on the target system(Windows 7 32 bit I need to link it to the hyper terminal. so that I will be able to send the Commands & data to my printer through the hyper terminal & my driver will be responsible to take the data from the hyper terminal & send it to my printer through USB. How can I do that?

Am I going in the right direction..?

Please help me out I am being asked to provide the time frame within which I can complete this Task. As I am not sure about the things which I am doing & the things that need to be done so I am not able to provide them a time frame.

What I have tried:

I have gone through the following links of CodeProject that describes the Driver development. But it mainly concentrated on KMDF drivers
http://www.codeproject.com/Articles/9636/Driver-Development-Part-Introduction-to-driver-c
Posted
Updated 30-May-16 5:06am
v2

1 solution

A question like this is far too broad to be answered in a Quick Answers forum. You should go to Microsoft Windows Driver Development Kit (DDK) Solution Center[^] and study the development of device drivers. But be aware it is quite a complex subject.
 
Share this answer
 
Comments
amitrkcian 30-May-16 11:07am    
Thank U Richard. Appreciate that.
AS my development machine & my test machine are 64bit windows system with Windows 7 operating System So to give myself a head start I compiled the ComPort project under Windows-driver-samples-master/serial/VirtualSerial2 sample code provided by Microsoft, initial it flashed an error that said as follows "Provider cannot be "Microsoft", must be an organization who authored INF" so I changed the following line in .inx file MSFTUMDF="Microsoft" to MSFTUMDF="Sample", then it compiled successfully.

Then I follow the following process to install the driver on the target machine.

1) I copied the VirtualSerial2um.cer file & VirtualSerial2um.inf from Windows-driver-samples-master\serial\VirtualSerial2\ComPort\x64\Debug & devcon.exe from C:\Program Files\Windows Kits\10\Tools\x64 to a Sample folder in the C:\ drive of the Target device.

2) Then on target machine I open the internet explorer I went to Internet Options->content->Certificates->import then I selected the VirtualSerial2um.cer file & imported the Certificate.

3) Then on target machine I open the command prompt as Administrator, browseed to the Sample folder & typed the following command.

devcon install virtualSerial2um.inf UMDF\Virtual_1

Then on the command prompt it says:
device tree entry created
devcon failed

In the device manager Under Unknown Device COM11 appears but when I open my hyper terminal COM11 doesn't show on the drop down list of COM ports.

Now I am unable to figure out why my devcon installation is failing.

Could anyone please guide me in the correct direction
Richard MacCutchan 30-May-16 11:47am    
I am not a driver developer, sorry. I would suggest you open a new question with the details just posted, or better still use the Hardware & Devices forum.
amitrkcian 30-May-16 11:50am    
This is the content of the VirtualSerial2um.inf file

;
; Copyright (C) Microsoft Corporation, All Rights Reserved.
;
; VirtualSerial.inf
;
;Installation Notes:
; Type "devcon install VirtualSerial2um.inf UMDF\VirtualSerial2um" to install

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MSFTUMDF%
CatalogFile=WUDF.cat
DriverVer=05/30/2016,19.7.52.160

[Manufacturer]
%MSFTUMDF%=Microsoft,NTx86

[Microsoft.NTx86]
%VirtualSerialDeviceName%=VirtualSerial_Install,UMDF\VirtualSerial2um

[SourceDisksFiles]
Virtualserial2um.dll=1

[SourceDisksNames]
1 = %MediaDescription%

; =================== UMDF VirtualSerial Device ==================================

[VirtualSerial_Install.NT]
CopyFiles=UMDriverCopy

[VirtualSerial_Install.NT.hw]
AddReg=SetDeviceType_AddReg

[VirtualSerial_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall

[VirtualSerial_Install.NT.Wdf]
UmdfService = VirtualSerial, VirtualSerial_Install
UmdfServiceOrder = VirtualSerial
UmdfKernelModeClientPolicy = AllowKernelModeClients
UmdfFileObjectPolicy = AllowNullAndUnknownFileObjects
UmdfFsContextUsePolicy = CannotUseFsContexts

[VirtualSerial_Install]
UmdfLibraryVersion=2.15.0
ServiceBinary=%12%\UMDF\Virtualserial2um.dll

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys

[SetDeviceType_AddReg]
HKR,,DeviceType,0x10001,0x0000001b ; 0x1b = FILE_DEVICE_SERIAL_PORT

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to drivers\UMDF

[UMDriverCopy]
Virtualserial2um.dll

; =================== Generic ==================================

[Strings]
MSFTUMDF="Chetu"
MediaDescription="Microsoft Sample Driver Installation Media"
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"
VirtualSerialDeviceName="Microsoft VirtualSerial Sample (UMDF 2)"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900