This is true; it is one the things that I filed under “not reasonable.” Halting the machine to facilitate the insanity this dev’s client perpetrates is, in my opinion, not a very good idea. Debugging would also be interesting.
mm
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of I?aki Castillo
Sent: Wednesday, September 05, 2007 05:25
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Can I/O accesses be hooked?
You can just use the Debug Registers to hook IN/OUT.
This is available since Pentium (formerly the IN/OUT mode was not available).
Inaki.
De: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] En nombre de Martin O’Brien
Enviado el: mi?rcoles, 05 de septiembre de 2007 0:00
Para: Windows System Software Devs Interest List
Asunto: RE: [ntdev] Can I/O accesses be hooked?
There’s no reasonable way to intercept a driver that issues in/out directly. To do this, assuming that you may not modify their software and that they are indeed writing directly to some port with OUT, you’d have to resort to something rather extreme like virtualization, unless your chipset has something very specific and fortuitous. If you absolutely can not modify their software, then the best thing that I could think of is to either intercept their application in user mode, their driver in kernel mode or filter it. Of these, the first would certainly be the easiest, but it would be complicated, and it does beg the question as to why they don’t just modify their software to use an alternate configuration. The second would really suck and may not even be possible, depending on what they do and except.
I just reread your post, and I’m now unclear: does the application actually issue the IN/OUT? I don’t imagine so, but if so, then this is very different. If the app does not run under an NTVDM, then the IO instruction will cause a fault which you could handle, translate as necessary. This would not be easy, but it is possible, assuming that you can replace the handler without something like PatchGuard getting in the way. If this executes under an NTVDM, then it is also is possible, but quite different, as standard LPT1 access is, I believe handled automatically, but I believe can be addressed by a VDD, if they still exist. On this last scenario, I’m pretty much guessing, as I can’t say that I have ever had the pleasure of working with a VDD or with NTVDM much at all.
I have to ask: what on earth are they doing/why are they doing this? I realize that this is not your choice, but this is the strangest setup I have heard of in a while: an Active X control & driver to allow IO port access. I figured this was going to be some old VDD or something like that to support a HASP or whatnot.
All in all, this sounds a bad idea with a Capital B.
Good luck,
mm
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Chris Myers
Sent: Tuesday, September 04, 2007 17:04
To: Windows System Software Devs Interest List
Subject: [ntdev] Can I/O accesses be hooked?
I have an ExpressCard parallel port that uses PCI Express. It installs properly as a PnP device. The problem is that I have customers with brain-dead software that expects to access a parallel port at legacy addresses. Generally, these people have custom applications that they have written using an I/O proxy ActiveX control. The control exposes an interface to the app to do INs and OUTs, and the control talks to a driver that does the dirty work. Effectively, the application is bypassing the driver that I supply. This works fine on the PCMCIA version of the card, which can be forced into legacy I/O address ranges. On PCI Express, however, we can’t obtain a legacy address.
What I would like to do is grab control of the rogue INs and OUTs to legacy addresses and redirect them to the actual addresses used by my card. Is there a way to hook the I/O access?
Chris Myers
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