home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
vrac
/
commspy.zip
/
COMMSPY.DOC
< prev
next >
Wrap
Text File
|
1994-05-21
|
7KB
|
123 lines
12-4-94 DAL CommSpy.Doc
INSTALLING COMMSPY
There are 6 files associated with Commspy. These are COMMSPY.EXE,
CSPYHKS.DLL, COMMSPY.HLP, BC30RTL.DLL, SH20W16.DLL. All other files
required are created dynamically by CommSpy. The files COMMSPY.EXE,
CSPYHKS.DLL, and COMMSPY.HLP can all be installed into a local directory
wherever you like. The files BC30RTL.DLL and SH20W16.DLL may also be used
by other applications, and so they should be copied into the
WINDOWS\STSTEM directory. BC30RTL.DLL is a Borland product and is used by
CSPYHKS.DLL for runtime library functions. SH20W16.DLL is a library that
provides memory management services; all memory allocations that commspy
requires are implemented through this library.
Note: COMMSPY.DOC (this file) is also included with those files.
OPERATION:
Commspy intercepts API function calls made to the serial communications
services in Windows by other applications. It accomplishes this by patching
the entry point of each function call with a piece of code that directs the
program flow into CSPYHKS.DLL. Once the API function has been intercepted,
Commspy records all the parameters passed to the function and then allows
the original call to proceed. The menu option "Start Spying" toggles the
interception on-and-off. When it is off, the API calls are no longer
intercepted and the patch is removed.
SPECIAL FEATURES:
The menu option "Filter Uninteresting Events" affects two
API function calls; ReadComm, and GetCommError. Most Windows
programs are written to operate in a "polled" mode, which is a fancy way
of saying that they must continually check the serial port to see if
anything happened since the last time they checked.
Many applications call the function GetCommError to do the polling.
This function not only tells the app if an error has occurred, it clears
any pending errors, and also tells the app how many characters are present
in the transmit and receive queues. An app may call this function to
clear outstanding errors and get the quantity of characters it has just
received; if any are available it will then call ReadComm to get the
characters.
Some apps do not call GetCommError, they just call ReadComm and check to
see if they were able to get anything. This is not the recommended way to
do it under Windows, but some apps did.
Based upon how the app implemented its polling logic, it may make a
lot of calls to either GetCommError or ReadComm as it looks for work to do,
but many of these calls return a value that simply tells the app that nothing
happened. This is what the option "Filter Uninteresting Events" is designed
to detect. In order to avoid filling up the screen and log file with
a list of events that signify nothing, when this option is turned on it
will ignore these polling type events that mean that the polling operation
indicated nothing of interest was occurring.
For ReadComm, if 0 bytes were read, it is filtered out and ignored.
For GetCommError, if the status is 0 (meaning ok) and the transmit and
receive queues are both empty, it is filtered out and ignored.
DISPLAY OPTIONS:
When the option "Record Task/Module Data" is turned on, the task and
module data of the caller of the API function is displayed. When the
option "Parameter Display" is on, all parameters to the API function are
displayed. When "Show Time in elapsed units" is on, the value displayed is
the interval between the current function and the last function that was
called. If the option is off, the time since Commspy was started to the
time the API function was called is displayed.
RINGBUFFERS:
When characters are actually read or written to one of the ports, Commspy
saves those characters off into a special buffer called a ring buffer. This
will happen after a call to either ReadComm, WriteComm, or TransmitCommChar.
This is called a ring buffer because when the buffer fills up, new characters
that are saved overwrite previous characters. Each of the ports has a
separate buffer, (COM1-4), and each buffer can contain up to approximately
10,000 characters.
When the option "AutoOpen/Close on use" is on, then whenever the API
function OpenComm or CloseComm is called, Commspy will automatically open or
close the appropriate ring buffer window.
CommSpy considers each call to ReadComm and WriteComm to be a separate
transaction, and when it saves the data, it marks the first character in
that transaction with a flag that indicates that this character was the
start of a transaction. When the display option "One line per transaction"
is on, it will begin a new display line each time it finds a character
with this flag. This is useful when programs read and write characters
as blocks.
COMM PORT STATUS DISPLAY (*** NEW FEATURE ALERT***)
Commspy is capable of showing an LED style display that shows the
current status of the hardware handshaking lines, and whether or not
characters are present in the transmit and receive queues. The user
should keep in mind that this is a software display only, and may not
accurately reflect the actual status of the comm port status. Discrepancies
may occur when the status display is open but there aren't any applications
that actually have the port open. The display is based on reading values
out of comm.drv, and comm.drv does not update the hardware handshaking lines
when the port is not in use. Also, the Rx and Tx display is based upon the
quantity of characters present in the software buffers that hold these
characters; if an application is not removing characters from the receive
queue then commspy will show the Rx line as on even though there isn't an
actual reception occurring. Also, if for some reason the commport is
incapable of transmitting, then the Tx line will show ON even though
characters are not physically being transmitted.
The display of the output lines RTS and DTR should, however, be
completely accurate, as Commspy reads these values directly out of the
communications port and does not rely on other software for its values.
All outputs are colored RED and all inputs to the port are colored GREEN.
FUNCTION INTERCEPTION LIST
OpenComm,
CloseComm,
WriteComm,
ReadComm,
BuildCommDCB,
ClearCommBreak,
EnableCommNotification,
EscapeCommFunction,
FlushComm,
GetCommError,
GetCommEventMask,
GetCommState,
SetCommBreak,
SetCommEventMask,
SetCommState,
TransmitCommChar,
UngetCommChar,