Hi, with reference to advice given by others (e.g. Doran Holan) on this forum, I have adapted the WDK 6001 PSCR for my Virtual Smart Card Driver. The driver seems to install OK on XPSP2 and appears in Device Manager - it is installed as a Root enumerated device.
The driver trace shows that various IOCTLs are issued to it (e.g. IOCTL_SMARTCARD_GET_ATTRIBUTE to get VendorName, IFDType, etc) - I suppose this is due to the SCardSvr.exe.
I have downloaded and installed IFDTEST and stopped SCardSvr. However, the IFDTEST reports no readers are installed. But I do observe that it is sending IOCTLs to my PSCR driver.
This is the output from the IFDTEST tool:-
Smart Card Reader Test Suite
Version 2.0.5
Copyright(c) Microsoft Corporation 1997 - 1999
VendorName of reader device \?\ROOT#SMARTCARDREADER#0000#{50dd5230-ba8a-11d1-bf
5d-0000f805f530} is NULL
No reader found
Tracing I’ve added to PSCR shows that an IOCTL is issued to retrieve the vendor name:-
PSCR!PscrEvtIoDeviceControl -> IOCTL_SMARTCARD_GET_ATTRIBUTE Request: 0x7e7cfd00
PSCR!PscrEvtIoDeviceControl - IOCTL_SMARTCARD_GET_ATTRIBUTE [SCARD_ATTR_VENDOR_NAME]
PSCR!PscrSmcLibComplete - IRP status: 0 Request: 7e7cfd00
PSCR!PscrSmcLibComplete - IOCTL_SMARTCARD_GET_ATTRIBUTE [len: 3]
4E 53 4C NSL
PSCR!PscrEvtIoDeviceControl <-
As you can see that the vendor name (“NSL”) is being retrieved by the driver. From some debugging I have done it appears IFDTEST is reporting “VendorName for … is NULL” and “No reader found” before the above IOCTL_SMARTCARD_GET_ATTRIBUTE completes. So I am thinking IFDTEST is failing regardless of teh success of IOCTL_SMARTCARD_GET_ATTRIBUTE. Maybe some registry data is missing?
If someone has spotted what maybe wrong then please let me know. But what I was wondering, is there a way of getting IFDTEST to generate more verbose output. Or even maybe to get source code to it to help me debug?
Any help will be greatly appreciated.
Ditta
When you complete the IOCTL_SMARTCARD_GET_ATTRIBUTE request, are you returning the number of byte you have written to the output buffer, e.g. are you calling WdfRequestCompleteWithInformation(request, status, ); ? Looking at ifdtest.exe sources, it looks like you are not indicating the number of bytes written.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Thursday, November 01, 2007 10:22 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Smart Card Driver issue
Hi, with reference to advice given by others (e.g. Doran Holan) on this forum, I have adapted the WDK 6001 PSCR for my Virtual Smart Card Driver. The driver seems to install OK on XPSP2 and appears in Device Manager - it is installed as a Root enumerated device.
The driver trace shows that various IOCTLs are issued to it (e.g. IOCTL_SMARTCARD_GET_ATTRIBUTE to get VendorName, IFDType, etc) - I suppose this is due to the SCardSvr.exe.
I have downloaded and installed IFDTEST and stopped SCardSvr. However, the IFDTEST reports no readers are installed. But I do observe that it is sending IOCTLs to my PSCR driver.
This is the output from the IFDTEST tool:-
Smart Card Reader Test Suite
Version 2.0.5
Copyright(c) Microsoft Corporation 1997 - 1999
VendorName of reader device \?\ROOT#SMARTCARDREADER#0000#{50dd5230-ba8a-11d1-bf
5d-0000f805f530} is NULL
No reader found
Tracing I’ve added to PSCR shows that an IOCTL is issued to retrieve the vendor name:-
PSCR!PscrEvtIoDeviceControl -> IOCTL_SMARTCARD_GET_ATTRIBUTE Request: 0x7e7cfd00
PSCR!PscrEvtIoDeviceControl - IOCTL_SMARTCARD_GET_ATTRIBUTE [SCARD_ATTR_VENDOR_NAME]
PSCR!PscrSmcLibComplete - IRP status: 0 Request: 7e7cfd00
PSCR!PscrSmcLibComplete - IOCTL_SMARTCARD_GET_ATTRIBUTE [len: 3]
4E 53 4C NSL
PSCR!PscrEvtIoDeviceControl <-
As you can see that the vendor name (“NSL”) is being retrieved by the driver. From some debugging I have done it appears IFDTEST is reporting “VendorName for … is NULL” and “No reader found” before the above IOCTL_SMARTCARD_GET_ATTRIBUTE completes. So I am thinking IFDTEST is failing regardless of teh success of IOCTL_SMARTCARD_GET_ATTRIBUTE. Maybe some registry data is missing?
If someone has spotted what maybe wrong then please let me know. But what I was wondering, is there a way of getting IFDTEST to generate more verbose output. Or even maybe to get source code to it to help me debug?
Any help will be greatly appreciated.
Ditta
—
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
Thank you for your help. OK swapped the original code calling WdfRequestComplete with WdfRequestCompleteWithInformation. But the end result was still the same. However, my initial suspision was that it was failing for some reason prior to the IOCTL_SMARTCARD_GET_ATTRIBUTE request - as I get the “VendorName … is NULL” output before the IOCTL completes. My suspicion is either invalid/incomplete registry info or some error being returned within SMCLIB.sys. Can I get SMCLIB to trace stuff out?
When you complete the IOCTL_SMARTCARD_GET_ATTRIBUTE request, are you returning
the number of byte you have written to the output buffer, e.g. are you calling
WdfRequestCompleteWithInformation(request, status, the buffer>); ? Looking at ifdtest.exe sources, it looks like you are not
indicating the number of bytes written.
d
What version of ifdtest are you using? Previous to the 6000 WLK it did not handle async i/o properly in some cases. The 6000 WLK version fixes this issue, please make sure you are using this version (or later).
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Friday, November 02, 2007 5:05 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Smart Card Driver issue
Thank you for your help. OK swapped the original code calling WdfRequestComplete with WdfRequestCompleteWithInformation. But the end result was still the same. However, my initial suspision was that it was failing for some reason prior to the IOCTL_SMARTCARD_GET_ATTRIBUTE request - as I get the “VendorName … is NULL” output before the IOCTL completes. My suspicion is either invalid/incomplete registry info or some error being returned within SMCLIB.sys. Can I get SMCLIB to trace stuff out?
When you complete the IOCTL_SMARTCARD_GET_ATTRIBUTE request, are you returning
the number of byte you have written to the output buffer, e.g. are you calling
WdfRequestCompleteWithInformation(request, status, the buffer>); ? Looking at ifdtest.exe sources, it looks like you are not
indicating the number of bytes written.
d
—
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
Downloaded and installed WLK 6001. Used ifdtest from that package and that has resolved my issue. Thanks for your help!
Ditta
What version of ifdtest are you using? Previous to the 6000 WLK it did not
handle async i/o properly in some cases. The 6000 WLK version fixes this issue,
please make sure you are using this version (or later).
d