Virtual smartcard device

Is there any way to use IoRegisterDeviceInterface with a PDO that was
not created by the PnP Manager?

Plan A:
Create a DO in DriverEntry plus do all the stuff that would normally be
done in AddDevice. I think I am using the smartcard library correctly
but all the docs I’ve seen are written with the assumption it’s in a PnP
(or VxD) driver.

Plan B:
Reformat the code as a proper WDM PnP driver and use the mechanism
mentioned the other day (Thank you!) to fake out the PnP Manager.

I’m trying Plan A first and am at the point now where I’d like to see
some sort of request from the O/S to establish the driver as a usable
resource.

Your comments are appreciated
Mickey.

Nope. It only works if you’re in the PNP tree.

You could write a very simple KMDF driver to be your root enumerated device node, have it register the device interface and also open your Plan_A driver as a remote I/O target. You can then just forward any IRPs you get through to the smartcard driver. This might be sufficient to test out Plan A before moving on to Plan B.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 9:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual smartcard device

Is there any way to use IoRegisterDeviceInterface with a PDO that was
not created by the PnP Manager?

Plan A:
Create a DO in DriverEntry plus do all the stuff that would normally be
done in AddDevice. I think I am using the smartcard library correctly
but all the docs I’ve seen are written with the assumption it’s in a PnP
(or VxD) driver.

Plan B:
Reformat the code as a proper WDM PnP driver and use the mechanism
mentioned the other day (Thank you!) to fake out the PnP Manager.

I’m trying Plan A first and am at the point now where I’d like to see
some sort of request from the O/S to establish the driver as a usable
resource.

Your comments are appreciated
Mickey.


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

> Is there any way to use IoRegisterDeviceInterface with a PDO that was

not created by the PnP Manager?

Impossible.

You can create a do-nothing PDO via IoReportDetectedDevice with NULL parameters
though, and then attach your own FDO on top of such a PDO.

This devnode can carry device interfaces and even child devnodes
(BusRelations).


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

In the 6001 wdk there is a kmdf smart card sample that should be easy for you to convert to your requirements.

d

Sent using my smartphone, apologies forany typos

-----Original Message-----
From: “Peter Wieland”
To: “Windows System Software Devs Interest List”
Sent: 09/01/07 10:37 AM
Subject: RE: [ntdev] Virtual smartcard device

Nope. It only works if you’re in the PNP tree.

You could write a very simple KMDF driver to be your root enumerated device node, have it register the device interface and also open your Plan_A driver as a remote I/O target. You can then just forward any IRPs you get through to the smartcard driver. This might be sufficient to test out Plan A before moving on to Plan B.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 9:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual smartcard device

Is there any way to use IoRegisterDeviceInterface with a PDO that was
not created by the PnP Manager?

Plan A:
Create a DO in DriverEntry plus do all the stuff that would normally be
done in AddDevice. I think I am using the smartcard library correctly
but all the docs I’ve seen are written with the assumption it’s in a PnP
(or VxD) driver.

Plan B:
Reformat the code as a proper WDM PnP driver and use the mechanism
mentioned the other day (Thank you!) to fake out the PnP Manager.

I’m trying Plan A first and am at the point now where I’d like to see
some sort of request from the O/S to establish the driver as a usable
resource.

Your comments are appreciated
Mickey.


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


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

At the moment, anything KMDF from 6001 will only install on Server 2008.
This is issue (coinstaller) is getting fixed.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, September 01, 2007 14:22
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual smartcard device

In the 6001 wdk there is a kmdf smart card sample that should be easy
for you to convert to your requirements.

d

Sent using my smartphone, apologies forany typos

-----Original Message-----
From: “Peter Wieland”
To: “Windows System Software Devs Interest List”
Sent: 09/01/07 10:37 AM
Subject: RE: [ntdev] Virtual smartcard device

Nope. It only works if you’re in the PNP tree.

You could write a very simple KMDF driver to be your root enumerated
device node, have it register the device interface and also open your
Plan_A driver as a remote I/O target. You can then just forward any
IRPs you get through to the smartcard driver. This might be sufficient
to test out Plan A before moving on to Plan B.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 9:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual smartcard device

Is there any way to use IoRegisterDeviceInterface with a PDO that was
not created by the PnP Manager?

Plan A:
Create a DO in DriverEntry plus do all the stuff that would normally be
done in AddDevice. I think I am using the smartcard library correctly
but all the docs I’ve seen are written with the assumption it’s in a PnP
(or VxD) driver.

Plan B:
Reformat the code as a proper WDM PnP driver and use the mechanism
mentioned the other day (Thank you!) to fake out the PnP Manager.

I’m trying Plan A first and am at the point now where I’d like to see
some sort of request from the O/S to establish the driver as a usable
resource.

Your comments are appreciated
Mickey.


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


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


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

I’m having a hard time getting my head wrapped around all this

I asked about IoReportDetectedDevice() and mentioned my plans:

Plan A:
>Create a DO in DriverEntry plus do all the stuff that would normally be
>done in AddDevice. [… the smartcard library …]
>
>Plan B:
>Reformat the code as a WDM PnP driver […]

I got a couple of responses about KMDF that for several reasons I
will consider Plan C.

I’m still working on Plan A.

Maxim Shatskih writes:

You can create a do-nothing PDO via IoReportDetectedDevice with NULL
parameters
>though, and then attach your own FDO on top of such a PDO.

The only reference to IoReportDetectedDevice() I can find in the samples
is in the serial
driver which on first glance looks about as clear as mud. (Reminds me of
the VMS one.)

Is my thinking correct here? I think I’m creating a hybrid legacy/pnp
driver that
supports most of the PnP functions. No AddDevice() == legacy but
IRP_MJ_PNP etc == PnP?

DriverEntry (DriverObject…

DriverObject->DriverUnload = (func)
DriverObject->DriverExtension->AddDevice = NULL
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (func)
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (func)
DriverObject->MajorFunction[IRP_MJ_PNP] = (func)
DriverObject->MajorFunction[IRP_MJ_POWER] = (func)
(plus others)

IoCreateDevice (
DriverObject,
sizeof(EXTENSION),
&DeviceObjName,
FILE_DEVICE_SMARTCARD,…
&NewDeviceObject

IoReportDetectedDevice (
DriverObject,
InterfaceTypeUndefined,
-1,
-1,
NULL,
NULL,
FALSE,
&NewPdo

LowerDevice = IoAttachDeviceToDeviceStack (NewDeviceObject, NewPdo);

IoRegisterDeviceInterface (
&NewPdo
&SmartCardReaderGuid,…

Every IRP I get that would normally be passed on to the lower bus
driver(etc) gets
completed by me so from this point on, I pretty much ignore NewPdo. (True?)

I sincerly appreciate our comments
Mickey.

True if you build it in 6001, but it can be copied to the 6000 wdk and them it works on all os releases

d

Sent using my smartphone, apologies forany typos

-----Original Message-----
From: “Martin O’Brien”
To: “Windows System Software Devs Interest List”
Sent: 09/01/07 1:21 PM
Subject: RE: [ntdev] Virtual smartcard device

At the moment, anything KMDF from 6001 will only install on Server 2008.
This is issue (coinstaller) is getting fixed.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, September 01, 2007 14:22
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual smartcard device

In the 6001 wdk there is a kmdf smart card sample that should be easy
for you to convert to your requirements.

d

Sent using my smartphone, apologies forany typos

-----Original Message-----
From: “Peter Wieland”
To: “Windows System Software Devs Interest List”
Sent: 09/01/07 10:37 AM
Subject: RE: [ntdev] Virtual smartcard device

Nope. It only works if you’re in the PNP tree.

You could write a very simple KMDF driver to be your root enumerated
device node, have it register the device interface and also open your
Plan_A driver as a remote I/O target. You can then just forward any
IRPs you get through to the smartcard driver. This might be sufficient
to test out Plan A before moving on to Plan B.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 9:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual smartcard device

Is there any way to use IoRegisterDeviceInterface with a PDO that was
not created by the PnP Manager?

Plan A:
Create a DO in DriverEntry plus do all the stuff that would normally be
done in AddDevice. I think I am using the smartcard library correctly
but all the docs I’ve seen are written with the assumption it’s in a PnP
(or VxD) driver.

Plan B:
Reformat the code as a proper WDM PnP driver and use the mechanism
mentioned the other day (Thank you!) to fake out the PnP Manager.

I’m trying Plan A first and am at the point now where I’d like to see
some sort of request from the O/S to establish the driver as a usable
resource.

Your comments are appreciated
Mickey.


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


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


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


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

IoReportDetectedDevice is not worth your while, you install a root
enumerated device w/out all the weirdness (devcon install
). Why are you giving yourself so much design grief? Do
you have an existing NT4 driver that you already wrote that you want to
port or that you thought the NT4 driver would be easier to start with?
If it is the latter, that is not the case. Please take a look at the
KMDF smart card sample. I think you will be able to make a lot of fast
progress with it rather than starting from scratch.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 2:20 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

I’m having a hard time getting my head wrapped around all this

I asked about IoReportDetectedDevice() and mentioned my plans:

>Plan A:
>Create a DO in DriverEntry plus do all the stuff that would normally
be
>done in AddDevice. [… the smartcard library …]
>
>Plan B:
>Reformat the code as a WDM PnP driver […]

I got a couple of responses about KMDF that for several reasons I
will consider Plan C.

I’m still working on Plan A.

Maxim Shatskih writes:

>You can create a do-nothing PDO via IoReportDetectedDevice with NULL
parameters
>though, and then attach your own FDO on top of such a PDO.

The only reference to IoReportDetectedDevice() I can find in the samples

is in the serial
driver which on first glance looks about as clear as mud. (Reminds me of

the VMS one.)

Is my thinking correct here? I think I’m creating a hybrid legacy/pnp
driver that
supports most of the PnP functions. No AddDevice() == legacy but
IRP_MJ_PNP etc == PnP?

DriverEntry (DriverObject…

DriverObject->DriverUnload = (func)
DriverObject->DriverExtension->AddDevice = NULL
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (func)
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (func)
DriverObject->MajorFunction[IRP_MJ_PNP] = (func)
DriverObject->MajorFunction[IRP_MJ_POWER] = (func)
(plus others)

IoCreateDevice (
DriverObject,
sizeof(EXTENSION),
&DeviceObjName,
FILE_DEVICE_SMARTCARD,…
&NewDeviceObject

IoReportDetectedDevice (
DriverObject,
InterfaceTypeUndefined,
-1,
-1,
NULL,
NULL,
FALSE,
&NewPdo

LowerDevice = IoAttachDeviceToDeviceStack (NewDeviceObject, NewPdo);

IoRegisterDeviceInterface (
&NewPdo
&SmartCardReaderGuid,…

Every IRP I get that would normally be passed on to the lower bus
driver(etc) gets
completed by me so from this point on, I pretty much ignore NewPdo.
(True?)

I sincerly appreciate our comments
Mickey.


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

My investigations have shown that FtDisk in pre-Vista OSes used
IoReportDetectedDevice to “plant the root” of the tree of
\Device\HarddiskVolume%d PDOs.

From this I concluded that IoReportDetectedDevice is fine and can be used
just as IoCreateKernelManagedStandardPdo :slight_smile:


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Doron Holan” wrote in message news:xxxxx@ntdev…
IoReportDetectedDevice is not worth your while, you install a root
enumerated device w/out all the weirdness (devcon install
). Why are you giving yourself so much design grief? Do
you have an existing NT4 driver that you already wrote that you want to
port or that you thought the NT4 driver would be easier to start with?
If it is the latter, that is not the case. Please take a look at the
KMDF smart card sample. I think you will be able to make a lot of fast
progress with it rather than starting from scratch.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Saturday, September 01, 2007 2:20 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

I’m having a hard time getting my head wrapped around all this

I asked about IoReportDetectedDevice() and mentioned my plans:

>Plan A:
>Create a DO in DriverEntry plus do all the stuff that would normally
be
>done in AddDevice. [… the smartcard library …]
>
>Plan B:
>Reformat the code as a WDM PnP driver […]

I got a couple of responses about KMDF that for several reasons I
will consider Plan C.

I’m still working on Plan A.

Maxim Shatskih writes:

>You can create a do-nothing PDO via IoReportDetectedDevice with NULL
parameters
>though, and then attach your own FDO on top of such a PDO.

The only reference to IoReportDetectedDevice() I can find in the samples

is in the serial
driver which on first glance looks about as clear as mud. (Reminds me of

the VMS one.)

Is my thinking correct here? I think I’m creating a hybrid legacy/pnp
driver that
supports most of the PnP functions. No AddDevice() == legacy but
IRP_MJ_PNP etc == PnP?

DriverEntry (DriverObject…

DriverObject->DriverUnload = (func)
DriverObject->DriverExtension->AddDevice = NULL
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (func)
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (func)
DriverObject->MajorFunction[IRP_MJ_PNP] = (func)
DriverObject->MajorFunction[IRP_MJ_POWER] = (func)
(plus others)

IoCreateDevice (
DriverObject,
sizeof(EXTENSION),
&DeviceObjName,
FILE_DEVICE_SMARTCARD,…
&NewDeviceObject

IoReportDetectedDevice (
DriverObject,
InterfaceTypeUndefined,
-1,
-1,
NULL,
NULL,
FALSE,
&NewPdo

LowerDevice = IoAttachDeviceToDeviceStack (NewDeviceObject, NewPdo);

IoRegisterDeviceInterface (
&NewPdo
&SmartCardReaderGuid,…

Every IRP I get that would normally be passed on to the lower bus
driver(etc) gets
completed by me so from this point on, I pretty much ignore NewPdo.
(True?)

I sincerly appreciate our comments
Mickey.


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

Doron Holan wrote:

[…] Please take a look at the KMDF smart card sample. I think you will be able to make a lot of fast
progress with it rather than starting from scratch.

I would if I could find it. I have 6000 + 6001 installed and I see KMDF
and Smartcard samples but not what you refer to. Google doesn’t seem to
help either.

Does it make use of the smclib support library?

Whatever I do needs to run on XP SP2 and up plus Windows 2000 if I can
manage it.

Thanks,
Mickey.

It’s in the “smartcrd” directory, which, for whatever reason, is not
under the kmdf directory. I assume that this is the one that Doron was
referring to, as it is indeed based on KMDF, but only in the 6001 beta 3
WDK; it exists in the 6000 WDK (and presumably others as well; I don’t
know), but it is KMDF.

I always hesitate to disagree with Doron, as when I do so, I am almost
always wrong. That being said, I don’t think that he is correct about
being able to build this under the 6000 WDK without some modification or
setting, because the KMDF smartcrd sample uses typedefs for event
handlers that are new to the 6001 WDK, such as
“EVT_WDF_DRIVER_DEVICE_ADD,” which, I believe, is a new name for
“PFN_WDF_DRIVER_DEVICE_ADD.” I think that’s the deal, at least. Not
that I anticipated this problem; I most definitely did not. I just
tried to build smartcrd under the 6000 WDK 2000 x86 Checked window, as I
wasn’t sure that Windows 2000 would be supported, and noticed the errors
about not knowing what a “EVT_WDF_DRIVER_DEVICE_ADD” is. I’ve seen this
with one other sample, somewhere along the way as well, and although I
don’t recall which sample it was

This really isn’t my thing, but there would seem to be a few pretty
obvious approaches to fixing this problem, but someone who knows more
about KMDF that I could tell you better what the easiest and safest
method is, assuming that my theory here is correct.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Sunday, September 02, 2007 06:15
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Doron Holan wrote:

[…] Please take a look at the KMDF smart card sample. I think you
will be able to make a lot of fast
progress with it rather than starting from scratch.

I would if I could find it. I have 6000 + 6001 installed and I see KMDF
and Smartcard samples but not what you refer to. Google doesn’t seem to
help either.

Does it make use of the smclib support library?

Whatever I do needs to run on XP SP2 and up plus Windows 2000 if I can
manage it.

Thanks,
Mickey.


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

Well for cryin’ out loud! No directory name change, very few file name
differences and no mention in the release notes.

I’ll be the first to admit that I’m dumber 'n a box of rocks with
respect to KMDF…  A cursory glance at the files leads me to think
that the complexity level is about the same (not a good indicator but
the directory size difference is < 1%), most of the function calls
seem to do the same sort of work only they’re implemented differently
and I think I’m still faced with solving my non-existent physical
device PnP issues.

Given that the boss would really really really like to have some basic
functionality by Friday, I think I’ll keep going with my current effort
and if I can’t show progress in a day or so, switch to my backup plan.

Thanks for your time and effort,

Mickey.

Martin O’Brien wrote:

cite="mid:xxxxx@edoevicboemb01.evitechnology.com"
type=“cite”>

It’s in the “smartcrd” directory, which, for whatever reason, is not
under the kmdf directory. I assume that this is the one that Doron was
referring to, as it is indeed based on KMDF, but only in the 6001 beta 3
WDK; it exists in the 6000 WDK (and presumably others as well; I don’t
know), but it is KMDF.

I always hesitate to disagree with Doron, as when I do so, I am almost
always wrong. That being said, I don’t think that he is correct about
being able to build this under the 6000 WDK without some modification or
setting, because the KMDF smartcrd sample uses typedefs for event
handlers that are new to the 6001 WDK, such as
“EVT_WDF_DRIVER_DEVICE_ADD,” which, I believe, is a new name for
“PFN_WDF_DRIVER_DEVICE_ADD.” I think that’s the deal, at least. Not
that I anticipated this problem; I most definitely did not. I just
tried to build smartcrd under the 6000 WDK 2000 x86 Checked window, as I
wasn’t sure that Windows 2000 would be supported, and noticed the errors
about not knowing what a “EVT_WDF_DRIVER_DEVICE_ADD” is. I’ve seen this
with one other sample, somewhere along the way as well, and although I
don’t recall which sample it was

This really isn’t my thing, but there would seem to be a few pretty
obvious approaches to fixing this problem, but someone who knows more
about KMDF that I could tell you better what the easiest and safest
method is, assuming that my theory here is correct.

Good luck,

mm

-----Original Message-----
From:xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Sunday, September 02, 2007 06:15
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Doron Holan wrote:

[…] Please take a look at the KMDF smart card sample. I think you

will be able to make a lot of fast

progress with it rather than starting from scratch.

I would if I could find it. I have 6000 + 6001 installed and I see KMDF

and Smartcard samples but not what you refer to. Google doesn’t seem to
help either.

Does it make use of the smclib support library?

Whatever I do needs to run on XP SP2 and up plus Windows 2000 if I can
manage it.

Thanks,
Mickey.


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


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 athttp://www.osronline.com/page.cfm?name=ListServer

Maxim S. Shatskih wrote:

You can create a do-nothing PDO via IoReportDetectedDevice with NULL parameters
though, and then attach your own FDO on top of such a PDO.

This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,
_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)
but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually
answers these requests and since I have no bus driver…

This devnode can carry device interfaces and even child devnodes
(BusRelations).

Can you expand on this a bit? Or point to something I need to read?

Thanks,
Mickey.

I still don’t understand your fascination with IoReportDetectedDevice.
The Devcon utility will install a root enumerated (virtual in your
terms) without a single line of driver code.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 11:57 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Maxim S. Shatskih wrote:

You can create a do-nothing PDO via IoReportDetectedDevice with NULL
parameters
though, and then attach your own FDO on top of such a PDO.

This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,
_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)
but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually
answers these requests and since I have no bus driver…

This devnode can carry device interfaces and even child devnodes
(BusRelations).

Can you expand on this a bit? Or point to something I need to read?

Thanks,
Mickey.


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

It’s probably one of those “When the only tool you have is a hammer,
every problem looks like a nail” situations. Much as I hate to admit
it…

devcon [-r] install

Specifies an INF file with installation information
for the device.

Specifies a hardware ID for the device.

-r Reboots the system only when a restart or reboot is
required.

I would use “devcon install MyInf.inf

I presume the matches the Device ID field in
the INF file. What are the rules for selecting this string?

Of course I need to move all of the executable code currently in my
DriverEntry to an AddDevice routine and change the target type in the
sources file… (i.e. make it a properly constructed PnP driver.)

Regards,

Mickey.

Doron Holan wrote:

cite="mid:xxxxx@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com
type=“cite”>
I still don’t understand your fascination with IoReportDetectedDevice.
The Devcon utility will install a root enumerated (virtual in your
terms) without a single line of driver code.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 11:57 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Maxim S. Shatskih wrote:




You can create a do-nothing PDO via IoReportDetectedDevice with NULL




parameters




though, and then attach your own FDO on top of such a PDO.





This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,
_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)
but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually
answers these requests and since I have no bus driver…




This devnode can carry device interfaces and even child devnodes
(BusRelations).





Can you expand on this a bit? Or point to something I need to read?

Thanks,
Mickey.


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


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





While we’re on the subject…

There’s a manager at work who admittedly doesn’t know kernel coding and
really wants to know if a virtual smartcard can be implemented using
all user code via UMDF. Visual Studio debugging, etc.

Possible?

Thanks,

Mickey.

Doron Holan wrote:

cite="mid:xxxxx@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com"
type=“cite”>

I still don’t understand your fascination with IoReportDetectedDevice.
The Devcon utility will install a root enumerated (virtual in your
terms) without a single line of driver code.

d

-----Original Message-----
From:xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 11:57 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Maxim S. Shatskih wrote:

You can create a do-nothing PDO via IoReportDetectedDevice with NULL

parameters

though, and then attach your own FDO on top of such a PDO.

This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,
_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)
but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually
answers these requests and since I have no bus driver…

This devnode can carry device interfaces and even child devnodes
(BusRelations).

Can you expand on this a bit? Or point to something I need to read?

Thanks,
Mickey.


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


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 athttp://www.osronline.com/page.cfm?name=ListServer

is the hw ID you put in MyInf.inf. it can be anything
you want. The ID for a root enumerated device starts with "root" and
then a string of their own choosing. so in your case, it could be
root\mickeylane. For instance if you look at the dynambus example
(WinDDK\6000\src\kmdf\toaster\bus\dynamic) you see this in the INF
(actually inx, when you build the directory the inx gets processed into
an INF file)

; For XP and later

[Standard.NT$ARCH$]

%ToasterDynamicBus.DeviceDesc%=ToasterDynamicBus_Device, root\dynambus

So the cmd line would be

Devcon install dynambus.inf root\dynambus

As for UMDF, not for any released OS. This may change in the future but
right now you need to right your smart card driver in a KM driver and
use windbg/kd for debugging (and not VS).

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 2:40 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

While we’re on the subject…

There’s a manager at work who admittedly doesn’t know kernel coding and
really wants to know if a virtual smartcard can be implemented using all
user code via UMDF. Visual Studio debugging, etc.

Possible?

Thanks,
Mickey.

Doron Holan wrote:

I still don’t understand your fascination with IoReportDetectedDevice.
The Devcon utility will install a root enumerated (virtual in your
terms) without a single line of driver code.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 11:57 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

Maxim S. Shatskih wrote:

You can create a do-nothing PDO via IoReportDetectedDevice with
NULL

parameters

though, and then attach your own FDO on top of such a PDO.

This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,
_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)
but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually
answers these requests and since I have no bus driver…

This devnode can carry device interfaces and even child devnodes
(BusRelations).

Can you expand on this a bit? Or point to something I need to read?

Thanks,
Mickey.


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


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


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

Possible. The MS team that “owns” smartcard is investigating this for an unspecified point in the future. However you can’t use the SMCLIB component very easily … or if you want to it’s left as an exercise for the reader (and since it depends on things like DEVICE_OBJECT and IRP it would be hard) … so you have to reimplement a significant portion of what it does.

Also note that we don’t technically support “Visual Studio debugging, etc…”. It can be made to work, but it’s not something we’ve explored in great detail and is also left largely as an exercise for the reader to get right.

-p

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane
Sent: Tuesday, September 04, 2007 2:40 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Virtual smartcard device

While we’re on the subject…

There’s a manager at work who admittedly doesn’t know kernel coding and really wants to know if a virtual smartcard can be implemented using all user code via UMDF. Visual Studio debugging, etc.

Possible?

Thanks,
Mickey.

Doron Holan wrote:

I still don’t understand your fascination with IoReportDetectedDevice.

The Devcon utility will install a root enumerated (virtual in your

terms) without a single line of driver code.

d

-----Original Message-----

From: xxxxx@lists.osr.commailto:xxxxx

[mailto:xxxxx@lists.osr.com] On Behalf Of Mickey Lane

Sent: Tuesday, September 04, 2007 11:57 AM

To: Windows System Software Devs Interest List

Subject: Re: [ntdev] Virtual smartcard device

Maxim S. Shatskih wrote:

You can create a do-nothing PDO via IoReportDetectedDevice with NULL

parameters

though, and then attach your own FDO on top of such a PDO.

This works.

I see a number of PnP minor functions for set up (IRP_MN_QUERY_ID,

_CAPABILITIES, _PNP_DEVICE_STATE, _DEVICE_RELATIONS,_DEVICE_TEXT etc)

but I do not see IRP_MN_START_DEVICE. I believe a bus driver usually

answers these requests and since I have no bus driver…

This devnode can carry device interfaces and even child devnodes

(BusRelations).

Can you expand on this a bit? Or point to something I need to read?

Thanks,

Mickey.



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



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


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</mailto:xxxxx>