Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > smartcard reader kmdf .sys with multiple device interface

Reply
Thread Tools Display Modes

smartcard reader kmdf .sys with multiple device interface

 
 
Junior Member
Join Date: Feb 2011
Posts: 1

 
      02-11-2011
Hello everybody,
I try to develop a smartcard reader USB driver.
1) evtDeviceAdd :
_ I have created an usb target device, for catch usb interrupt.
_ I call WdfDeviceInitSetFileObjectConfig (EvtDeviceFileCreate) with a fileSlot context that contains all parameter needed for a slot interface smartcard.
_ I call twice "WdfDeviceCreateDeviceInterface" ( for 2 smartcard slot interface )

2) EvtDeviceD0Entry :
_ Start interruptPipe target for catch interrupt message

3) EvtDeviceFileCreate :
_ with "FileOject" I extract fileSlot context attached to my device interface.

When I launch a smartcard tool, I can see both interface.

Now I have a problem for distinguish what is the deviceinterface affected by the usb interrupt.
For example : the interruptPipe returned me 2 bytes (value 0x50, 0x0, 0x0, 0x0 )
If value is : (value 0x50, 0x0, 0x0, 0xFF ) : Slot 1 is concerned ( devInterface0)
If value is : (value 0x50, 0x0, 0xFF, 0x0 ) : Slot 2 is concerned ( devInterface1)

In Interrupt completionRoutine, I would like to know how to communicate directly with devInterface concerned ( for change status smartcard = detected ) ?

some one could give me any tips,
if I can use a WdfIoTarget during DeviceFileCreate function that point to the WdfFileObject input parameter ?
or use an array in deviceContext that contains both wdffileObject pointer ?

deviceContext
{
WDFUSBDEVICE UsbDevice;
WDFUSBPIPE pipeRead;
WDFUSBPIPE pipeWrite;
WDFUSBPIPE pipeInterrupt;

WDFQUEUE ioctlQueue;
} DEVICE_CONTEXT;

fileSlotContext
{
PSMARTCARD_EXTENSION smartcardExtension; // for each deviceInterface
UNICODE_STRING slotInterfaceName; // Slot0, Slot1, ....
UCHAR deviceSlotNumber // 0,1, ....
}

Thanks in advance,

Best regards,

Moulefrite
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Composite Device Can't Suspend Mini UVC UAC Windows Vista Drivers 1 12-02-2009 01:58 AM
Game Compatibility BCurrey Windows Vista Games 6 11-29-2007 08:11 PM
Going Golfing but not with Vista markbyrn Windows Vista Games 15 03-08-2007 10:59 AM
americas army stuttering under vista premium ernie Windows Vista Games 0 02-27-2007 10:20 PM
problem in dxdiag Peewee64 Windows Vista Games 0 02-14-2007 09:49 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59