Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 opened the command prompt as Administrator, browsed 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 COMn(n is com port number) appears but when I open my hyper terminal COMn doesn't show on the drop down list of COM ports.

Now I am unable to figure out why my devcon installation is failing & as it says that my driver is registered in the device tree then why It is showing in the Unknown device & not in PORTS

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="Sample"
MediaDescription="Microsoft Sample Driver Installation Media"
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"
VirtualSerialDeviceName="Microsoft VirtualSerial Sample (UMDF 2)"

What I have tried:

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 opened the command prompt as Administrator, browsed 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 COMn(n is com port number) appears but when I open my hyper terminal COMn doesn't show on the drop down list of COM ports.
Posted
Comments
amitrkcian 31-May-16 5:38am    
I made the following changes which caused the installation to succeed but there are still some hiccups:

1) Initially I was placing three files in the Sample folder(devcon.exe, VirtualSerial2um.inf & Virtual Serial2um.cer), but now I have the VirtualSerial2Um.ll & all the object files along with the three files in the Sample folder.

2) initially in the command prompt I was trying to execute the following command
"devcon install virtualSerial2um.inf UMDF\Virtual_1" in this the hardwareID (UMDF\Virtual_1) was incorrect I changed it to UMDF\VirtualSerial2um.
So when I executed the following command

"devcon install virtualSerial2um.inf UMDF\VirtualSerial2um" in command prompt it said "Driver installed successfully"

When I checked my device manager, under Ports(COM & LPT) Microsoft VirtualSerial Sample (UMDF2)(COM9) appears with a "yellow !(exclamation mark)"

When I right click on the device name & go to properties-> General-> Device status it say "This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)"

I also checked the task manager & I donot see the wudfhost.exe running, which is the host process for the UMDF drivers.

Pleas advice me solution that would let remove the "yellow !" mark from the device in the device manager & let the host process run.

1 solution

Here is how I got mine to work.

0. cd to the build folder
C:\Temp\VirtualSerial\ComPort\x64\Release\virtualserial>


1. First install the driver using the devcon command, it will fail.
Devcon command is
devcon install virtualserial.inf UMDF\VirtualSerial


2. Check device manager, you will see it show up as Unknown Device, or COM# with an exclamation mark.


3. Right click on it -> Update Driver -> browse my computer for driver software -> let me pick from a list of available drivers on my computer


4. Now on my machine it shows
Microsoft VirtualSerial User-Mode Device Sample
and beneath it, it shows
This driver is digitally signed
.

5. Now, if you click on Have Disk, and browse to any of the virtualserial.inf files in the sample, it changes to
This driver is not digitally signed

You don't want this, so if you did this, cancel and go back to step 3

6. click Next, and you should see the
Microsoft VirtualSerial User-Mode Device Sample (COM#)
under Ports in Device Manager.


Notice, you can install this driver multiple times, and each time it will give you a different port number

Some additional steps to debugging for anyone reading.

1. Make sure you are building x64 if you are using an x64 system. I got both Debug and Release to work

2. Make sure you are running devcon from the virtualserial folder inside the Release or Debug folder. Because this folder contains the WudfUpdate_01011.dll file

3. If you cannot get it to show this driver is Digitally Signed at any point, grabt he Digicert utility from here: https://www.digicert.com/util/DigiCertUtil.exe you may see that the internet explorer installation method has an exclamation mark next to it. Right click on it, and digicert will describe the problem and offer to fix it. Alternatively you can also use digiert to import the virtualserial.cer file from the respective Release folder.

4. Finally, check the devcon logs, they are located in:
C:\Windows\INF\setupapi.dev.log


You are looking for a WHQL signature.

5. Lastly, try building and installing the project without making any modifications to it first, we are of course talking about this project Windows-driver-samples/serial/VirtualSerial at master · Microsoft/Windows-driver-samples · GitHub[^]

Thanks for the information you've provided. You should turn this into an instructional page from your question.
 
Share this answer
 

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