Installing fake devices

Hello,

I would like to know how could I install a fake device (LPT port, drives,…etc) and install a simple driver intercepting IRPs and process them (redirection to another driver or device, print informations about IRPs,…etc).

Can I do it with an apropriate inf file ? With registry writing ? Forcing device installation with hardware add/remove windows menu ?

Thanks for help,
Franck.

Yup. You want to create a Root Enumerated device.

Specify “Root/AnyUniqueNameHere” as the device ID in your INF file. The “AnyUniqueName” string can be anything you want – it doesn’t have to match your device name, it just needs to be unique system-wide.

Peter
SR

Install the WDK. One of the tools that is included is devcon.exe. run devcon install and you can create a root enumerated device. A wdk example of a root enumerated device the toaster bus (src\kmdf\toaster\bus\dynambus) whose INF shows you how to install this particular type of device

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@odyssee-systemes.fr
Sent: Sunday, March 23, 2008 10:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Installing fake devices

Hello,

I would like to know how could I install a fake device (LPT port, drives,…etc) and install a simple driver intercepting IRPs and process them (redirection to another driver or device, print informations about IRPs,…etc).

Can I do it with an apropriate inf file ? With registry writing ? Forcing device installation with hardware add/remove windows menu ?

Thanks for help,
Franck.


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

Thank you. That’s exactly what I was looking for.

Actually, I thought I could create a fake LPT port, intercepting reads and writes to it and redirecting to an USB device. But, I think most of the legacy access to the LPT port (I mean controlling electrical signals) are done directly with in and out functions to the base address, so no IRP to intercept.

Could I trap the access to, let’s say 0x378 and do something with that ?

I think you are going about this the wrong way. What do you want to do in the end? Implement a LPT port or COM Port that is attached via USB instead of the ISA bus?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@odyssee-systemes.fr
Sent: Monday, March 24, 2008 12:02 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Installing fake devices

Thank you. That’s exactly what I was looking for.

Actually, I thought I could create a fake LPT port, intercepting reads and writes to it and redirecting to an USB device. But, I think most of the legacy access to the LPT port (I mean controlling electrical signals) are done directly with in and out functions to the base address, so no IRP to intercept.

Could I trap the access to, let’s say 0x378 and do something with that ?


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 wanted to know how to install virtual device in general and devcon/root enumerated device was the answer.

Then yes, I thought making an LPT to USB translator in order to use old software using the printer port as a digital IO interface.

Well, these are complete 2 things. If you are going to create a usb device driver, you do not need a root enumerated device. The usb enumerated device will work just fine and you can expose the upper of edge of the device however you want.

Lpt ports are a little weird since there are other KM drivers which can consume the port and expect real hardware instead of a protocol bus like usb, but these are quite rare and getting more rare

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@odyssee-systemes.fr
Sent: Monday, March 24, 2008 1:08 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Installing fake devices

I wanted to know how to install virtual device in general and devcon/root enumerated device was the answer.

Then yes, I thought making an LPT to USB translator in order to use old software using the printer port as a digital IO interface.


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 and redirecting to an USB device. But, I think most of the legacy access to
the

LPT port (I mean controlling electrical signals) are done directly with in and
out
functions to the base address, so no IRP to intercept.

Windows will not allow this for a user-mode code.


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