home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / memory / sspawn / readme.txt next >
Encoding:
Text File  |  1993-12-12  |  5.2 KB  |  127 lines

  1.  
  2.                                 SSPAWN
  3.  
  4.                     (c) 1993 4D Interactive Systems, Inc.
  5.  
  6.                                Written by
  7.                               Paul Penrose
  8.  
  9.  
  10. LEGAL STUFF
  11. -----------
  12.  
  13. The files in this archive (SSPAWN.ZIP) are being released as FREEWARE.  This
  14. means that you may use the programs and functions enclosed (see below for a
  15. complete list) for whatever use you wish, at no cost, with the following
  16. restrictions:
  17.  
  18.         1.) The 4D Interactive Systems copyright notices are not removed or
  19.             altered in any way.
  20.  
  21.         2.) The following notice is included in any documentation, printed or
  22.             in electronic form, that accompanies any program or package
  23.             containing any or all of the aformentioned programs and/or
  24.             functions:
  25.  
  26.                            SSPAWN provided and (c) 1993 by
  27.                              4D Interactive Systems, Inc.
  28.  
  29.  
  30. Warranties:
  31. Basically there are none, either expressed or implied.  We do not make any
  32. claims as to the usefulness of the programs and functions included for any
  33. particular purpose.  Niether are we responsible for any loss incurred by
  34. their use.  Any rights not specifically granted in this document are
  35. reserved.
  36.  
  37. CONTENTS
  38. --------
  39.  
  40. This archive contains the sspawn function which allows Borland C programs to
  41. to swap most of their code and data out to EMS or a disk file and spawn a DOS
  42. command shell.  Optionally a command may be passed to the shell and the path
  43. for the temporary file may be specified.  It is assumed that the user is
  44. already familar with the C language.  You should have the following files:
  45.  
  46.         README.TXT
  47.         SSPAWN.ASM
  48.  
  49. The Function
  50. ------------
  51.  
  52. The C prototype for the sspawn function is:
  53.  
  54.         unsigned int sspawn(char *command, char *path);
  55.  
  56. The command string will be passed to the spawned shell for execution.  Any
  57. command that can be executed at a DOS prompt can be used.  If an empty string
  58. or NULL is specified for the command then a standard DOS command shell will be
  59. started.  In this case the user must type EXIT at the command prompt to return
  60. to your program.  The path string is used to specify a valid DOS path where
  61. the function can write the swapped portion of the program, if needed.
  62.  
  63. When called the function will identify all the memory your program uses that
  64. is higher than itself.  This memory will then be copied into EMS memory, or
  65. if there is not enough EMS it will be written to a temporary file.  Then this
  66. memory is returned to DOS and a command shell is spawned.  When it returns
  67. the memory is restored, the EMS memory freed or the temporary file deleted,
  68. and the function returns to the caller.  The value returned will be one of
  69. the following:
  70.  
  71.         0x0000 = No errors
  72.         0x8001 = Unable to find the COMSPEC environment variable
  73.         0x8002 = Unable to create the temporary file
  74.         0x8003 = Error encountered while writing data to temporary file
  75.         0x8004 = Unable to release execess memory
  76.         0x8005 = Error encountered trying to spawn command shell
  77.  
  78. Additionally if the function is unable to restore the swapped portion of the
  79. program an error message is displayed and the program is terminated.  The most
  80. likely sources of these errors is one of the following:
  81.  
  82.         1.) A TSR was loaded from the spawned shell and the TSR is now using
  83.             memory that the program was using making it impossible to restore
  84.             the program.
  85.  
  86.         2.) The EMS pages that contained the swapped portion of the program
  87.             was released by some program run from the spawned command shell.
  88.  
  89.         3.) The temporary file that contained the swapped portion of the
  90.             program was deleted from the spawned command shell.
  91.  
  92. Note: This function has only been tested with Borland C++ 3.1 and the Borland
  93. heap functions.  It will probably work with older versions of the Borland C
  94. products as well, but we have not tested that.  It should also work with any
  95. C compiler that utilizes only one memory control block for the entire program
  96. and heap.  As I understand, some C compilers (including Microsoft's) will
  97. create new MCB's for the heap.  SSPAWN will NOT work with those products.
  98.  
  99. Compiling your Programs
  100. -----------------------
  101.  
  102. SSPAWN was written for TASM's IDEAL mode and the HUGE memory model.  If you
  103. use another memory model you must change the model specified in the source
  104. code.  The SPAWN.ASM module should be placed first in the project list.  For
  105. those of you that use the command line compiler and linker you should place
  106. the sspawn.obj file just after the startup code module.  If you have any ISR's
  107. they should either be disabled before you call sspawn, or the module that
  108. contains the ISR and ALL the data it references should be placed before sspawn
  109. in the project/link file.
  110.  
  111.  
  112. Support
  113. -------
  114.  
  115. Since this is FREEWARE we can't afford to spend much time supporting users.
  116. However, if you do find a bug, I would appreciate it if you would drop me a
  117. note, and we can both benefit.  Have fun.
  118.  
  119. Paul A. Penrose
  120. 4D Interactive Systems, Inc.
  121. 1885 University Ave, West
  122. Suite 229
  123. St. Paul, MN  55104
  124. 612-646-8104
  125. Compuserve: 72610,3377
  126. Internet: 72610.3377@compuServe.COM
  127.