I looked at the smartcard source some years ago. The version in the source
tree at that time was not written by Microsoft and was full of fundamental
bugs; I had a client who was trying to use it, and it was not passing the
Driver Verifier.
joe
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, February 21, 2011 5:31 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] SmartCard Reader Driver
Hi Jimmy James,
For resolve this problem, some way are needed.
First have you got created a queue dedied to your ioctl ( an ioctlQueue)
And have you got registered your callBack function for event smartcard
SmartCardExtension->ReaderExtension = ReaderExtension;
SmartCardExtension->ReaderFunction[RDF_CARD_TRACKING] =
Slot_ScardTracking;
SmartCardExtension->ReaderFunction[RDF_TRANSMIT] =
Slot_ScardTransmit;
SmartCardExtension->ReaderFunction[RDF_SET_PROTOCOL] =
Slot_ScardSetProtocol;
SmartCardExtension->ReaderFunction[RDF_CARD_POWER] =
Slot_ScardPower;
SmartCardExtension->ReaderFunction[RDF_IOCTL_VENDOR] =
Slot_ScardVendorIoctl;
and after this code :
status = SmartcardInitialize(SmartCardExtension);
if (status != STATUS_SUCCESS) {
SmartcardLogError(
WdfDriverWdmGetDriverObject(WdfGetDriver()),
STATUS_INSUFFICIENT_RESOURCES,
NULL,
0
);
return status;
}
SmartCardExtension->OsData->DeviceObject =
WdfDeviceWdmGetDeviceObject(fileSlotContext->Device);
Have you got attached your deviceObject to your OsData code.
For test :
Simulate a card detection :
// Add a fake ATR
static BYTE FakeATR[13] = {0x3b, 0x89, 0x40, 0x14, 0x47, 0x47, 0x32, 0x34,
0x4d, 0x35, 0x32, 0x38, 0x30};
static UCHAR FakeATRLength = 13;
SmartcardExtension->ReaderCapabilities.CurrentState = SCARD_SWALLOWED;
RtlCopyMemory(
SmartcardExtension->IoRequest.ReplyBuffer,
FakeATR,
FakeATRLength
);
*SmartcardExtension->IoRequest.Information =
FakeATRLength ;
// Take this Call for update smclib
status =
SmartcardUpdateCardCapabilities(SmartcardExtension);
SmartcardExtension->ReaderCapabilities.CurrentState = SCARD_SPECIFIC;
SmartcardExtension->CardCapabilities.Protocol.Selected = SCARD_PROTOCOL_T1;
I hope to help you
Best regards,
Moulefrite
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
–
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.