Hi!

I am writing a virtual smartcard driver in WDM. When using IFDtest I can see
my reader, but when calling SCardListReaders, no reader is found. Could it
be because ithe driver is not managing pnp?. Is there some way in which I
could make it visible to SCardListReaders?. Thanks in advance for your help.

Regards,
Javier

Re: Virtual Smartcard Reader not listed with SCardListReaders by Walter

Walter
Mon Oct 08 08:35:10 PDT 2007

Javier Diez wrote:
> I am writing a virtual smartcard driver in WDM. When using IFDtest I can see
> my reader, but when calling SCardListReaders, no reader is found. Could it
> be because ithe driver is not managing pnp?. Is there some way in which I
> could make it visible to SCardListReaders?. Thanks in advance for your help.

IFDTEST doesn't work if SCARDSVR is running, so you may just need to do
a NET START SCARDSVR.

--
Walter Oney, Consulting and Training
http://www.oneysoft.com

Re: Virtual Smartcard Reader not listed with SCardListReaders by JavierDiez

JavierDiez
Tue Oct 09 02:57:02 PDT 2007

Hi!

First of all, thank you a lot Walter for taking the interest in answering my
question =). That was a good idea, but I have checked the smartcard resource
manager and it is started when I call SCardListReaders. Also, when I run
IFDtest, it finds the reader and gets attributes like vendor name, ifd type
and so on properly, whether the resource manager is started or not and the
driver gets IOCTLs, but when calling SCardListReaders, no readers are found =s

Regards,
Javier


"Walter Oney" wrote:

> Javier Diez wrote:
> > I am writing a virtual smartcard driver in WDM. When using IFDtest I can see
> > my reader, but when calling SCardListReaders, no reader is found. Could it
> > be because ithe driver is not managing pnp?. Is there some way in which I
> > could make it visible to SCardListReaders?. Thanks in advance for your help.
>
> IFDTEST doesn't work if SCARDSVR is running, so you may just need to do
> a NET START SCARDSVR.
>
> --
> Walter Oney, Consulting and Training
> http://www.oneysoft.com
>

Re: Virtual Smartcard Reader not listed with SCardListReaders by Walter

Walter
Wed Oct 10 05:45:47 PDT 2007

Javier Diez wrote:
> First of all, thank you a lot Walter for taking the interest in answering my
> question =). That was a good idea, but I have checked the smartcard resource
> manager and it is started when I call SCardListReaders. Also, when I run
> IFDtest, it finds the reader and gets attributes like vendor name, ifd type
> and so on properly, whether the resource manager is started or not and the
> driver gets IOCTLs, but when calling SCardListReaders, no readers are found =s

Okay. The next thing to check is that you're registering AND ENABLING
the SCard interface GUID (SmartCardReaderGuid). You need to copy the
DEFINE_GUID statement from smclib.h into your own source file because
the smclib definition will define multiple copies.

--
Walter Oney, Consulting and Training
http://www.oneysoft.com

Re: Virtual Smartcard Reader not listed with SCardListReaders by JavierDiez

JavierDiez
Tue Oct 16 01:28:00 PDT 2007

Hi!

Sorry about the delay, Walter. I have been abroad and could not check the
thread for some days. I am not using IoRegisterDeviceInterface; I was
creating a device, initializing the Smartcard structure and creating a
symbolic link in DriverEntry. Do I really need to use
IoRegisterDeviceInterface?. Also, to do so I would need a PDO and as it is a
virtual driver, without any hardware, I was hoping not to have to implement
PnP, but the only way I can think of getting such PDO would be either through
IoReportDetectedDevice with NULL parameters or maybe using a root enumerated
PDO and PnP. Could this work?. Do you have any other ideas?. Thanks a lot for
your help =).

Regards,
Javier


"Walter Oney" wrote:

> Javier Diez wrote:
> > First of all, thank you a lot Walter for taking the interest in answering my
> > question =). That was a good idea, but I have checked the smartcard resource
> > manager and it is started when I call SCardListReaders. Also, when I run
> > IFDtest, it finds the reader and gets attributes like vendor name, ifd type
> > and so on properly, whether the resource manager is started or not and the
> > driver gets IOCTLs, but when calling SCardListReaders, no readers are found =s
>
> Okay. The next thing to check is that you're registering AND ENABLING
> the SCard interface GUID (SmartCardReaderGuid). You need to copy the
> DEFINE_GUID statement from smclib.h into your own source file because
> the smclib definition will define multiple copies.
>
> --
> Walter Oney, Consulting and Training
> http://www.oneysoft.com
>

Re: Virtual Smartcard Reader not listed with SCardListReaders by Doron

Doron
Tue Oct 16 09:37:10 PDT 2007

forget IoReportDetectedDevice.
1) use KMDF to write the smart card driver, you can skip pnp/power
completely this way. the 6001 WDK (which uses KMDF v1.7) contains a KMDF
based smart card sample that you can start with. when the 6001 WDK ships,
you will be able to use KMDF v1.7 on any platform kmdf v1.5 supports, but
right now the installer does not work. to test your kmdf smart card sample,
copy the sample source and build it in the 6000 WDK.

2) install a root enumerated device using devcon, "devcon install <hwid>
<inf>"

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Javier Diez" <JavierDiez@discussions.microsoft.com> wrote in message
news:C5454680-6F65-4AD8-8ADE-7E675722BD73@microsoft.com...
> Hi!
>
> Sorry about the delay, Walter. I have been abroad and could not check the
> thread for some days. I am not using IoRegisterDeviceInterface; I was
> creating a device, initializing the Smartcard structure and creating a
> symbolic link in DriverEntry. Do I really need to use
> IoRegisterDeviceInterface?. Also, to do so I would need a PDO and as it is
> a
> virtual driver, without any hardware, I was hoping not to have to
> implement
> PnP, but the only way I can think of getting such PDO would be either
> through
> IoReportDetectedDevice with NULL parameters or maybe using a root
> enumerated
> PDO and PnP. Could this work?. Do you have any other ideas?. Thanks a lot
> for
> your help =).
>
> Regards,
> Javier
>
>
> "Walter Oney" wrote:
>
>> Javier Diez wrote:
>> > First of all, thank you a lot Walter for taking the interest in
>> > answering my
>> > question =). That was a good idea, but I have checked the smartcard
>> > resource
>> > manager and it is started when I call SCardListReaders. Also, when I
>> > run
>> > IFDtest, it finds the reader and gets attributes like vendor name, ifd
>> > type
>> > and so on properly, whether the resource manager is started or not and
>> > the
>> > driver gets IOCTLs, but when calling SCardListReaders, no readers are
>> > found =s
>>
>> Okay. The next thing to check is that you're registering AND ENABLING
>> the SCard interface GUID (SmartCardReaderGuid). You need to copy the
>> DEFINE_GUID statement from smclib.h into your own source file because
>> the smclib definition will define multiple copies.
>>
>> --
>> Walter Oney, Consulting and Training
>> http://www.oneysoft.com
>>


Re: Virtual Smartcard Reader not listed with SCardListReaders by JavierDiez

JavierDiez
Wed Oct 17 06:32:00 PDT 2007

Hi!

Thanks a lot to both of you for your answers, they are very helpful. I am
now giving a try at what Doron said and I am using KMDF. I root-enumerate my
device using devcon during installation, create a driver object in
DriverEntry and set a EvtAddDevice callback. In EvtAddDevice callback I set
my device as a filter, create a device object, create an interface for the
device and a non-powered default queue with an EvtIoDeviceControl callback
and do the call to SmartcardInitialize. Apparently it is doing it
successfully, but the virtual reader is not receiving any IOCTLs, nor is it
being listed with SCardListReaders =S. Do you have any ideas about what I may
be doing wrong?

Regards,
Javier




"Doron Holan [MSFT]" wrote:

> forget IoReportDetectedDevice.
> 1) use KMDF to write the smart card driver, you can skip pnp/power
> completely this way. the 6001 WDK (which uses KMDF v1.7) contains a KMDF
> based smart card sample that you can start with. when the 6001 WDK ships,
> you will be able to use KMDF v1.7 on any platform kmdf v1.5 supports, but
> right now the installer does not work. to test your kmdf smart card sample,
> copy the sample source and build it in the 6000 WDK.
>
> 2) install a root enumerated device using devcon, "devcon install <hwid>
> <inf>"
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Javier Diez" <JavierDiez@discussions.microsoft.com> wrote in message
> news:C5454680-6F65-4AD8-8ADE-7E675722BD73@microsoft.com...
> > Hi!
> >
> > Sorry about the delay, Walter. I have been abroad and could not check the
> > thread for some days. I am not using IoRegisterDeviceInterface; I was
> > creating a device, initializing the Smartcard structure and creating a
> > symbolic link in DriverEntry. Do I really need to use
> > IoRegisterDeviceInterface?. Also, to do so I would need a PDO and as it is
> > a
> > virtual driver, without any hardware, I was hoping not to have to
> > implement
> > PnP, but the only way I can think of getting such PDO would be either
> > through
> > IoReportDetectedDevice with NULL parameters or maybe using a root
> > enumerated
> > PDO and PnP. Could this work?. Do you have any other ideas?. Thanks a lot
> > for
> > your help =).
> >
> > Regards,
> > Javier
> >
> >
> > "Walter Oney" wrote:
> >
> >> Javier Diez wrote:
> >> > First of all, thank you a lot Walter for taking the interest in
> >> > answering my
> >> > question =). That was a good idea, but I have checked the smartcard
> >> > resource
> >> > manager and it is started when I call SCardListReaders. Also, when I
> >> > run
> >> > IFDtest, it finds the reader and gets attributes like vendor name, ifd
> >> > type
> >> > and so on properly, whether the resource manager is started or not and
> >> > the
> >> > driver gets IOCTLs, but when calling SCardListReaders, no readers are
> >> > found =s
> >>
> >> Okay. The next thing to check is that you're registering AND ENABLING
> >> the SCard interface GUID (SmartCardReaderGuid). You need to copy the
> >> DEFINE_GUID statement from smclib.h into your own source file because
> >> the smclib definition will define multiple copies.
> >>
> >> --
> >> Walter Oney, Consulting and Training
> >> http://www.oneysoft.com
> >>
>
>