PCSR ddk sample

Hello,

I have successfully built this sample for my laptop (win7 x64), however when installing this driver (using “Have Disk…” as explained in the doc) I always get the same error message:

“The folder you specified doesn’t contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems”

I built this sample using ddk 7600 using the Win 7 x64 Checked build environment.

I think the error lies in the inf file but I don’t know what to do to fix it.

Please help!

The driver name is PSCR (not pcsr sorry).

All 64-bit drivers must be signed.

For local testing you can run in test-signing mode. You need to read
the KMCS Walkthrough document
http://msdn.microsoft.com/en-us/windows/hardware/gg487328.aspx

At 12:37 05/04/2011, xxxxx@hotmail.com wrote:

Hello,

I have successfully built this sample for my laptop (win7 x64),
however when installing this driver (using “Have Disk…” as
explained in the doc) I always get the same error message:

“The folder you specified doesn’t contain a compatible software
driver for your device. If the folder contains a driver, make sure
it is designed to work with Windows for x64-based systems”

I built this sample using ddk 7600 using the Win 7 x64 Checked build
environment.

I think the error lies in the inf file but I don’t know what to do to fix it.

Please help!

You have either turn of driver signing during every boot, or apply a valid certificate. You can create your own test certificate or use a certificate from an appropriate CA, but the driver must be signed.

Gary G. Little

----- Original Message -----
From: xxxxx@hotmail.com
To: “Windows System Software Devs Interest List”
Sent: Tuesday, April 5, 2011 6:37:00 AM
Subject: [ntdev] PCSR ddk sample

Hello,

I have successfully built this sample for my laptop (win7 x64), however when installing this driver (using “Have Disk…” as explained in the doc) I always get the same error message:

“The folder you specified doesn’t contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems”

I built this sample using ddk 7600 using the Win 7 x64 Checked build environment.

I think the error lies in the inf file but I don’t know what to do to fix it.

Please help!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Wow , talk about early morning brain-drain, let me see if I can correct my own grammar: "You have to either turn off driver signing during every boot, or apply a valid certificate. You can create your own test certificate or use a certificate from an appropriate CA, but the driver must be signed. "

Gary G. Little

----- Original Message -----
From: “Gary G. Little”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, April 5, 2011 6:43:30 AM
Subject: Re: [ntdev] PCSR ddk sample

You have either turn of driver signing during every boot,

Gary G. Little

----- Original Message -----
From: xxxxx@hotmail.com
To: “Windows System Software Devs Interest List”
Sent: Tuesday, April 5, 2011 6:37:00 AM
Subject: [ntdev] PCSR ddk sample

Hello,

I have successfully built this sample for my laptop (win7 x64), however when installing this driver (using “Have Disk…” as explained in the doc) I always get the same error message:

“The folder you specified doesn’t contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems”

I built this sample using ddk 7600 using the Win 7 x64 Checked build environment.

I think the error lies in the inf file but I don’t know what to do to fix it.

Please help!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Like suggested by Gary,
Press F8 during reboot machine and select “Disable_driver_signature” for install your driver.

Best regards,

Moulefrite

Thanks for your replies, I have tried both solutions, signing the driver and disabling driver signature… but I still got the same error message while installing the driver “… make sure it is designed to work with Windows for x64-based systems”

I am sure I have built the driver with the appropriate environment (win7_amd64), the WdfCoInstaller01009.dll is the x64 version… everything should be fine…

Are you able to install this driver correctly on a Win7 x64 machine?

Does the inf file need to be customized for this configuration?

xxxxx@hotmail.com wrote:

Thanks for your replies, I have tried both solutions, signing the driver and disabling driver signature… but I still got the same error message while installing the driver “… make sure it is designed to work with Windows for x64-based systems”

I am sure I have built the driver with the appropriate environment (win7_amd64), the WdfCoInstaller01009.dll is the x64 version… everything should be fine…

Does the inf file need to be customized for this configuration?

Yes, and that error usually means the INF decorations are wrong, but the
one in the WDK has the proper decorations. Did you remove the “NTamd64”
string from there?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

The content of the generated pscr.inf is almost unchanged :
I only removed the ; on for this particular line CatalogFile=pscr.cat

; PSCR.INF
; Copyright (c) 1998 Microsoft Corporation

[Version]
DriverVer=04/05/2011,6.1.7600.16385
CatalogFile=pscr.cat
Signature=“$Windows NT$”
Class=SmartCardReader
ClassGuid={50DD5230-BA8A-11D1-BF5D-0000F805F530}
Provider=%Msft%

[ControlFlags]
; Prevent legacy install for PnP readers
ExcludeFromSelect=PCMCIA\PSCR-Smart_Card_Reader-488C

[Manufacturer]
%SCM%=SCM, NTia64, NTamd64

; ============ Add reg for all readers ===============

[Reader.Install.AddReg]
HKLM, Software\Microsoft\Cryptography\Calais\Readers,
HKLM, System\CurrentControlSet\Services\SCardSvr,Start,0x00010001,2
HKLM, System\CurrentControlSet\Services\CertPropSvc,Start,0x00010001,2

; ================= SCM readers =====================

[SCM]
; DisplayName Section DeviceId
; ----------- ------- --------
%SCM488C.DeviceDesc% = SCM488C.Install, PCMCIA\PSCR-Smart_Card_Reader-488C

[SCM.NTia64]
%SCM488C.DeviceDesc% = SCM488C.Install.NTia64, PCMCIA\PSCR-Smart_Card_Reader-488C

[SCM.NTamd64]
%SCM488C.DeviceDesc% = SCM488C.Install.NTamd64, PCMCIA\PSCR-Smart_Card_Reader-488C

[SCM488C.Install.NT]
AddReg = SCM488C.Install.AddReg, Reader.Install.AddReg
CopyFiles = SCM488C.Install.CopyFiles

[SCM488C.Install.NTia64]
AddReg = SCM488C.Install.AddReg, Reader.Install.AddReg
CopyFiles = SCM488C.Install.CopyFiles

[SCM488C.Install.NTamd64]
AddReg = SCM488C.Install.AddReg, Reader.Install.AddReg
CopyFiles = SCM488C.Install.CopyFiles

[SCM488C.Install.AddReg]
HKR, AdapterType, 0, “0100”

[SCM488C.Install.CopyFiles]
pscr.sys,2

[SCM488C.Install.NT.Services]
AddService = SCM488C, 2, SCM488C.Service, SCM488C.EventLog

[SCM488C.Install.NTia64.Services]
AddService = SCM488C, 2, SCM488C.Service, SCM488C.EventLog

[SCM488C.Install.NTamd64.Services]
AddService = SCM488C, 2, SCM488C.Service, SCM488C.EventLog

[SCM488C.Service]
DisplayName = %SCM488C.DeviceDesc%
ServiceType = 1 ;%SERVICE_KERNEL_DRIVER%
StartType = 3 ;%SERVICE_AUTO_START%
ErrorControl = 1 ;%SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\pscr.sys

[SCM488C.EventLog]
AddReg = SCM488C.AddEventLog.reg

[SCM488C.AddEventLog.reg]
HKR, EventMessageFile, 0x00020000, “%%SystemRoot%%\System32\drivers\pscr.sys”
HKR, TypesSupported, 0x00010001, 7

[DestinationDirs]
DefaultDestDir = 12
SCM488C.Install.CopyFiles = 12

[SourceDisksNames]
1 = %InstallDisk%,pscr.sys,

[SourceDisksFiles]
pscr.sys = 1

;
;— SCM488C.Install_Device WDF Coinstaller installation ------
;
[DestinationDirs]
SCM488C_CoInstaller_CopyFiles = 11

[SCM488C.Install.NT.CoInstallers]
AddReg=SCM488C_CoInstaller_AddReg
CopyFiles=SCM488C_CoInstaller_CopyFiles

[SCM488C_CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “wdfcoinstaller01009.dll,WdfCoInstaller”

[SCM488C_CoInstaller_CopyFiles]
wdfcoinstaller01009.dll

[SourceDisksFiles]
wdfcoinstaller01009.dll=1 ; make sure the number matches with SourceDisksNames

[SCM488C.Install.NT.Wdf]
KmdfService = SCM488C, SCM488C_Wdfsection
[SCM488C_Wdfsection]
KmdfLibraryVersion = 1.9

; ================= Strings =====================

[Strings]
Msft = “Microsoft”
SCM = “SCM Microsystems”
SCM488C.DeviceDesc = “SCM 488C PCMCIA Smart Card Reader”
ClassName = “Smart Card Readers”
InstallDisk = “SCM 488C Installation Disk”

Does it make sense to you?

xxxxx@hotmail.com wrote:

The content of the generated pscr.inf is almost unchanged :
I only removed the ; on for this particular line CatalogFile=pscr.cat

And are you actually implementing an SCM Microsystems SCR120? The INF
file matches exactly one device:

[SCM]
; DisplayName Section DeviceId
; ----------- ------- --------
%SCM488C.DeviceDesc% = SCM488C.Install, PCMCIA\PSCR-Smart_Card_Reader-488C

[SCM.NTia64]
%SCM488C.DeviceDesc% = SCM488C.Install.NTia64, PCMCIA\PSCR-Smart_Card_Reader-488C

[SCM.NTamd64]
%SCM488C.DeviceDesc% = SCM488C.Install.NTamd64, PCMCIA\PSCR-Smart_Card_Reader-488C

If your device doesn’t identify itself that way, then of course this INF
won’t match.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I have no such device actually. I am only interested in this driver because it somehow creates a virtual smart card reader. Then another part of the driver is used to handle some specific hardware (this is not the part I am interested in)…
All I would like to do is to install this driver, and then from a smart card aware user application be able to call SCardEstablishContext() then SCardListReaders() to see that the virtual driver is correctly listed. That would be a good start.

Could you tell me how I can do that?
Thanks.

xxxxx@hotmail.com wrote:

I have no such device actually. I am only interested in this driver because it somehow creates a virtual smart card reader.

Where did you get that idea? I don’t think that’s true. This is a
driver for a real smart card reader. Nothing virtual about it.

All I would like to do is to install this driver, and then from a smart card aware user application be able to call SCardEstablishContext() then SCardListReaders() to see that the virtual driver is correctly listed. That would be a good start.

Could you tell me how I can do that?

I imagine you COULD turn this into a virtual smart card reader, but
you’ll have to do that work yourself. There’s nothing in this driver
that does so.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

In the .inf file :
_ You need to remove the reference to the SCM reader : PCMCIA\PSCR-Smart_Card_Reader-488C
_ and replace it by : root"deviceName"

And in the driver sourceCode :
_ remove all reference to pcmcia exchange ( WRITE_PORT_UCHAR ).

For create a virtualSmartCardReader : just call “smartcardInitialize” with mandatory callBack for smclib.
Search in this forum, you could found my thread for create a virtual SM reader.

Hope to help you,

Best regards,

Moulefrite