frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
684 stars 197 forks source link

Not able to compile the code of Virtual Smart Card Reader because of missing file or module "VirtualSCReaderDriver" in the solution #257

Closed MahaboobAslam closed 1 month ago

MahaboobAslam commented 7 months ago

Hi Mr Frank,

I am new to writing UMDF driver and understood after downloading the code from the repository that it uses 1.x framework. Since I am using the Visual Studio 2019, I need to port the code to the 2.x framework, following the steps given in the Microsoft documentation is guess.

Looking into code, there is a missing part in the code you have provided called "VirtualSCReaderDriver.h.cpp" files. With out this I would not be able to build the code, which is part of the Driver, Device, PipeReader, Reader, VpcdReader and TcpIpReader are the classes that are using/including this Module which was written for reading Virtual Card Reader.

I would be thankful to you if can provide the files for the missing modules of "VirtualSCReaderDriver".

Please do the needful.

Regards SMA

frankmorgner commented 7 months ago

There is no file or reference to a VirtualSCReaderDriver.h.cpp in some project file. We only have a module (coclass) with that name.

Try pasting the the exact error message or a screenshot here.

MahaboobAslam commented 7 months ago

There is no file or reference to a VirtualSCReaderDriver.h.cpp in some project file. We only have a module (coclass) with that name.

Try pasting the the exact error message or a screenshot here.

Hi Mr Frank

With the last comment of your, I am able to build the code and got the binary "BixVReader.dll" with some minor compilation issues, in Visual Studio 2019.

With Devcon.exe I tried to deploy the BixVReader.dll in my machine with the following command as below.

Commands executed are as follows:

devcon install BixVReader.inf root\BixVReader devcon -r install BixVReader.inf root\BixVReader

The outcome after running these commands is as follows, which i have attached.

Untitled

Prior to this, I have installed the certificate generated on the machine on which I am deploying the driver. And it doesnt have the "DevMsi" files init to build the installer, i am getting an error when i try to build the installer. The error is as follows: error CNDL0150: Undefined preprocessor variable '$(var.DevMsi.TargetPath)'. I am using the devcon that comes with the WDK installed for Windows10 and Visual Studio 2019. Please help me, I would be thankful to you if can provide the steps and setting in details to deploy the driver. Note: I have digitally signed my code. content of .inf file is as follows

 ;
; BixVReader.inf
;

[Version]
Signature="$Windows NT$"
Class=SmartCardReader
ClassGuid={50dd5230-ba8a-11d1-bf5d-0000f805f530}
Provider=%ManufacturerName%
CatalogFile=BixVReader.cat
DriverVer = 11/29/2023,18.49.33.926

[Manufacturer]
%ManufacturerName%=Standard,NTamd64

[Standard.NTamd64]
%DeviceName%=VReader_Install,root\BixVirtualReader

[SourceDisksFiles]
BixVReader.dll=1
WudfUpdate_01011.dll=1

[SourceDisksNames]
1 = %DiskName%

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

[VReader_Install.NT]
CopyFiles=UMDriverCopy

[VReader_Install.NT.hw]

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

[VReader_Install.NT.CoInstallers]
CopyFiles=CoInstallers_CopyFiles
AddReg=CoInstallers_AddReg

[VReader_Install.NT.Wdf]
UmdfService=BixVReader,BixVReader_Install
UmdfServiceOrder=BixVReader
UmdfKernelModeClientPolicy=AllowKernelModeClients

[BixVReader_Install]
UmdfLibraryVersion=1.11.0 
ServiceBinary=%12%\UMDF\BixVReader.dll
DriverCLSID={A44A2DF4-DCA4-4767-8EC4-86FE611C2EA7}

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

[CoInstallers_CopyFiles]
WudfUpdate_01011.dll

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WudfUpdate_01011.dll"

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

[UMDriverCopy]
BixVReader.dll

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

[Strings]
ManufacturerName="<Your manufacturer name>" ;TODO: Replace with your manufacturer name
DiskName = "BixVReader Installation Disk"
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"
DeviceName="Bix Virtual Smart Card Reader"

Regards SMA

frankmorgner commented 5 months ago

did you use test signing (for local installation) or did you sign with some other certificate? In the latter case, the system needs to trust this certificate, see http://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html#istalling-vpcd-on-windows