|
|
Microsoft OS/2 SDK 03-01-1988
This directory contains the following files, which illustrate the
use of VioRegister.
register.c Contains shared memory initialization and VioRegister call.
access.c Accesses the shared memory allocated in register and
incremented in the VioWrtTTy replacement routine.
share.h Defines the shared memory layout used by register, access
and viosub.
viorout.asm Contains the VIO replacement router. This routine is linked
with viosub.obj, and violib.def to produce the dynamic link
module.
viosub.c Contains the replacement routine, called replace.
This routine is linked with violib.def and viorout.obj
to produce a dynamic link module containing a dynamic link
entry point for replace.
violib.def Contains dll creation information
testN.dat Different size data files for VioWrtTTy to read from
vioreg Makefile
In this example, VioWrtTTy is registered in a VioRegister call from
Register.c Register then makes calls to VioWrtTTy, at which time the
VIO router is invoked. The router passes control to the replacement
router (Viorout.asm), which calls the replacement routine, found in
Viosub.c. The routine increments counters in shared memory, showing
that it actually received control and was able to access the VioWrtTTy
parameters. The replacement routine returns (-1), signalling the VIO
router to invoke VioWrtTTy which continues with its normal operation.
A DosStartSession call in register.c starts access.exe in a seperate
screen group, which looks at the shared memory and prints the current
values. RAM semaphores interleave access.exe and the replacement
routine in updating and printing the values in shared memory.
There can be one and only one VioRegister call outstanding at a time
within a screen group without an intervening VioDeRegister. Because
the VioRegister call only allows one entry point name, a replacement
router becomes necessary so that many replacement routines can be
used, and registered at one time.
Usage: register 1|2|3
1, 2, and 3 specify a file for VioWrtTTy to read from
Access.exe will be the active screen. When you type CTRL-C
to quit, you will return to the session manager. To view
the output of the VioWrtTTy calls in register.exe, return
to the original screen group.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.