MCBscan v1.0.0
==============

Developed by ChrisR3tro
X: https://x.com/ChrisR3tro
E-Mail: chrisr3tro@pm.me
Project page: http://www.a20gate.net/dos-tools/


DISCLAIMER
----------
Usage may lead to data loss, spontaneous combustion and other calamities.
Use at your own risk!


Licensing
---------
This program is free and open-source software as long as it's used privately.
Commercial use, as unlikely as it may seem, is hereby prohibited.
The source code may be modified and distributed as long as my contact info
is left in place.


What this tool does
-------------------
With MCBscan, you can list information about currently resident (loaded)
programs (e.g. Terminate and Stay Resident programs known as "TSRs", or
drivers). For that, it scans the so-called memory control blocks (MCBs) to
determine if a program or driver with a specific name is currently loaded.
An exit code is provided based on the results of the search, making it easy
to incorporate into batch scripts.

For example, you can use MCBscan before loading a network driver to check if
it's already loaded. This prevents the driver from loading a second time, which
is useful, because not all TSRs or drivers automatically check, if they are
already active when they are started and some would even (undesirably) load as
multiple instances.

For an example batch script with MCBscan integration, please refer to the file
EXAMPLE.BAT, which is supplied together with MCBscan.


Requirements and notes on operation
-----------------------------------

* Microsoft DOS 5.0 or higher. This tool was not tested under other DOS
  operating systems, but may well work under other MS-DOS-compatible OSs such
  as FreeDOS! Let me know if it works for you and you're not using MS-DOS.


How do I run it?
----------------
This program is invoked through the command-line under DOS.
Please use the /? switch for further instructions. Type:
  mcbscan /? [Return]


Error levels (exit codes)
-------------------------

  0   Name found
  1   Name not found (normal search result)
  2+  Other errors

DOS IF ERRORLEVEL tests for greater than or equal, so best check for errors
(2 or higher) before checking for a name not found (1).


Development
-----------

This tool is compiled using the Open Watcom C compiler v1.9.
You can use Watcom MAKE to build it.

MCBscan is based on MCBC, a DOS program by Michael Tischer from his book
series "PC intern" on system programming for the IBM-PC and compatibles. MCBC
was written for a different C compiler and needed a few tweaks to compile and
run with Open Watcom C. Its original source code, along with my Open Watcom
version, can be downloaded here (published with Michael's kind permission):
http://www.a20gate.net/dos-tools/mcbscan/MCBCS.ZIP


Acknowledgements & Special Thanks
---------------------------------

Thanks to Michael Tischer for MCBC. For more info on him, have a look at
his page: https://www.mitinet.de/

Special thanks go out to Eric Voirin a.k.a. Oerg866 for helping me in
development by pointing out that alignment (specified via #pragma pack())
matters on structs when assigning MCB pointers!
Check out his profile on X: https://x.com/oerg866


Version history
---------------

1.0.0:
  * initial release
