AM> Does anyone know how can I modify a Dos box through a DLL under windows
AM> (3.1) so that all i/o to a comport (in the dos box) is sent directly to
AM> the DLL? Do I have to use harware hooks or something? I really need help
AM> on this. Thanx in advance.
You cannot do this from a DLL or any other ring 3 (user level) application
code. The only way that you can do "port trapping" is by writing a custom
virtua; device driver (VxD).
VxD's are 32 bit code that modify the underlying operating system, the part
known as the Virtual Machine Manager (VMM).
In order to write a VxD for Win 3.1, you will need the Device Driver Kit
(DDK) from Microsoft. The DDK is a commercial product that MS no longer
distribute separately, but only as part of the MS Developer Network
Professional or Universal Subscription. Since the Win 3.1 DDK was sold
separately at one time, you might find it through a second hand source.
An alternative might be to find an early edition of Theilen and Woodruff's
book on VxDs, which included a product called the "VxD lite" on the enclosed
disk. Note that MS persuaded the publisher to remove this package from later
revisions of the book. The book itself is a rewrite of the DDK
"documentation", with all of the implied limitations.
A good book on VxD's is Karen Hazzah's "Writing Windows Drivers and VxDs".
The second edition is better, although it focusses more on writing for Win
.
If your plan is to virtualize the i/o ports associated with a standard COM
port, you will also have to deal with the fact that there is already a
built-in VxD that does this, and handles contention issues surrounding these
ports.
Any of the above will require you to write your driver in ASM. The DDK
includes an appropriate version of MASM that will work with the include files
supplied in the DDK. If you want to write in C (OB C comment follows), you
can use the VToolsD library from Vireo (www.vireo.com). Since the library
retails for about $500, it is about the same price as the MSDN subscription.
I recommend it to professional VxD developers because of the quality of
support provided by Vireo.
Good Luck!
-Ron (ron-bass@ti.com)
--- EZPoint V2.2
---------------
* Origin: There's a point here, somewhere... (1:128/13.3)
|