hi all
is it possible to have a plug and play virtual device driver?
I mean for example something like a smart card reader driver.
Starting XP SP2,smart card reader driver SHOULD be PnP,but i wanna write a virtual one,and i don’t know how.
I have been written a virtual drive,but because we need a HardwareID for it and install it for that HardwareID,I cannot make it virtual.
Is there anyway to do it?
Regards
Yes you can make a virtual PnP device. These are “root enumerated” the bus
inf in the toaster sample is an example of a root enumerated device INF.
Personally, I follow the practices given in a WinHEC talk of a few years ago
and use a GUID as part of the device Id to make it unique.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
> hi all
> is it possible to have a plug and play virtual device driver?
> I mean for example something like a smart card reader driver.
> Starting XP SP2,smart card reader driver SHOULD be PnP,but i wanna write a
> virtual one,and i don’t know how.
> I have been written a virtual drive,but because we need a HardwareID for
> it and install it for that HardwareID,I cannot make it virtual.
> Is there anyway to do it?
>
> Regards
>
thanks for info,i try to read more about them…
I writing a small smartcard reader virtual device driver,so i need to make it bus enumerated one…
Regards
Yes, a root enumerated device is enumerated by the root “Bus”. You do not need to create a bus driver just to enumerate your smart card driver.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Friday, July 04, 2008 9:19 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is it possible to have a PnP virtual device driver?
thanks for info,i try to read more about them…
I writing a small smartcard reader virtual device driver,so i need to make it bus enumerated one…
Regards
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
Oh,I forget to ask something.
Root enumerated devices are devices that enumerated before any other device,aren’t they?
If yes, Depending my Root enumerated device driver to a non Root enumurated device can cause problem,isn’t it?
Regards
Well it causes you to have to design your virtual device with this
dependency in mind. Your virtual driver can arrange to be notified of the
arrival and departure of pnp enumerated device interfaces. That mechanism
provides a design hook for your virtual device to manage this dependency.
On Fri, Jul 4, 2008 at 2:25 PM, wrote:
> Oh,I forget to ask something.
> Root enumerated devices are devices that enumerated before any other
> device,aren’t they?
> If yes, Depending my Root enumerated device driver to a non Root enumurated
> device can cause problem,isn’t it?
>
> Regards
>
> —
> 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
>
–
Mark Roddy
> Root enumerated devices are devices that enumerated before any other
device,aren’t they?
No, root enumerated devices are devices which have no hardware-enumerable bus
under them, and are only registered in the registry.
They are displayed at root tree level in Device Manager
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
hi again
First,thanks for help,now i can install my driver in system as a root enumerated one.
but now i have another problem.
I’m trying to write a smartcard reader virtual driver,so I need to make it PnP(I have alreadt read pcsc and DDK samples).
I have a small driver that creates SMARTCARD device,and setup it.this driver is a NULL driver,I mean it do nothing yet,but I wana make sure that it is identified as a smartcard reader in system,then go and complete its driver.
I have registered this SMARTCARD device driver,as a bus enumurated system driver,now it goes into AddDevice routine and create smartcard device.
1-is registering a smartcard device as a bus enumerated device a correct approach for doing this?
2-my device is registered in system and its AddDevice routine is getting called and my Smartcard device has been created successfully,but why i don’t enter IRP_MJ_PNP dispatch routine?
3-what is system method of enumerating smartcard readers?eventhough I made this device as a PnP one(by registering it as root enumerated one as i described),It makes no deferent from when it was not.In both cases call to ScardListReaders fails.
Regards
What device class did you install your driver under? this would be the GUID in the INF for your device. It is enabling the right device interface GUID that makes the OS notice your reader. Are you registering and enabling that interface? The OS will not see the reader until you successfully start the stack though. If you are not seeing a start irp, I suggest that you put a breakpoing on your pnp dispatch routine and see what pnp irps actually arrive.
Are you using smclib? Are you returning NT_SUCCESS() from your AddDevice routine? From which WDK did you copy pcsr from? The server 2008 wdk has pscr based on KMDF which takes care of a lot of the mundane work of getting all of this up and running
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Friday, July 04, 2008 11:22 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is it possible to have a PnP virtual device driver?
hi again
First,thanks for help,now i can install my driver in system as a root enumerated one.
but now i have another problem.
I’m trying to write a smartcard reader virtual driver,so I need to make it PnP(I have alreadt read pcsc and DDK samples).
I have a small driver that creates SMARTCARD device,and setup it.this driver is a NULL driver,I mean it do nothing yet,but I wana make sure that it is identified as a smartcard reader in system,then go and complete its driver.
I have registered this SMARTCARD device driver,as a bus enumurated system driver,now it goes into AddDevice routine and create smartcard device.
1-is registering a smartcard device as a bus enumerated device a correct approach for doing this?
2-my device is registered in system and its AddDevice routine is getting called and my Smartcard device has been created successfully,but why i don’t enter IRP_MJ_PNP dispatch routine?
3-what is system method of enumerating smartcard readers?eventhough I made this device as a PnP one(by registering it as root enumerated one as i described),It makes no deferent from when it was not.In both cases call to ScardListReaders fails.
Regards
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
hi
At first,for installing my device driver,i were doing something incorrect and i were installing it under “System” GUID.
But reason was simple,because if I try to install it under “Smartcardreader” GUID(that suppose to be), “Add new Hardware” gives an error and says “cannot find proper hardware for this driver” and i will not be able to install it.
Perhaps I need to register a Custom class for myself in order to register my virtual smartcard reader,So I will try that out too.
And yes,I use smclib of windows 2003 server DDK,and for its pcsr,i were not even be able to compile it… 
I have been written my own null smart card by reading structure of DDK pcsr and PC/SC workgroup smartcard reader(to tell truth,i personnaly don’t like to use smclib at all, but because every sample are using them and even MSDN only describe them,i forced to use them too)
Regards
Continuing my previous post,I were be able to register my device driver as a custom class and as smartcard class itself(by tampering smartcard class registery flags).
but in both cases,SCardListReaders faild to get any smartcard reader list.
it is strange,but in system,non of of my driver dispatch routines(and smartcard callback routines also) are getting called.The only routine that gets called is AddDevice that i finish it with STATUS_SUCCESS. :S
For example IRP_MJ_PNP dispatch should be called right after AddDevice,Isn’t it(my deivce HardwareID is something like root\mytestvirtualsmartcardreader)?But system is not even enter that dispatch routine(My debug version of driver DbgPrint enetr and leave from each driver routine)
Regards
Do you specify the FILE_DEVICE_SMARTCARD flag in IoCreateDevice call? Do you register the SmartCardReaderGuid device interface?
??2008-07-05 18:24:32??xxxxx@yahoo.com д???
Continuing my previous post,I were be able to register my device driver as a custom class and as smartcard class itself(by tampering smartcard class registery flags).
but in both cases,SCardListReaders faild to get any smartcard reader list.
it is strange,but in system,non of of my driver dispatch routines(and smartcard callback routines also) are getting called.The only routine that gets called is AddDevice that i finish it with STATUS_SUCCESS. :S
For example IRP_MJ_PNP dispatch should be called right after AddDevice,Isn’t it(my deivce HardwareID is something like root\mytestvirtualsmartcardreader)?But system is not even enter that dispatch routine(My debug version of driver DbgPrint enetr and leave from each driver routine)
Regards
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
1-yea,i create device by FILE_DEVICE_SMARTCARD flag.
2-i don’t know what you exactly mean by "Do you
register the SmartCardReaderGuid device interface? ",but if you mean shortlinks,i used SmartCardCreateShortLink(or something similar,not sure about name) to create its shortlink.
Regards
I mean you must call IoRegisterDeviceInterface after calling IoCreateDevice and specify the SmartCardReaderGuid as the second parameter for the function call.The Guid value is defined in smclib.h.
??2008-07-07 12:03:00??xxxxx@yahoo.com д???
1-yea,i create device by FILE_DEVICE_SMARTCARD flag.
2-i don’t know what you exactly mean by "Do you
register the SmartCardReaderGuid device interface? ",but if you mean shortlinks,i used SmartCardCreateShortLink(or something similar,not sure about name) to create its shortlink.
Regards
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