home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_02 / 2n02057a < prev    next >
Text File  |  1991-01-02  |  1KB  |  42 lines

  1.  
  2. /* ---------------------------------------------------
  3.     TESTPFHT.C  -  Microsoft C ver 5.1
  4.  
  5.     A driver used to validate the assembly language
  6.     function process_handles_free().
  7.  
  8.     From the command line, executing this program
  9.     will print the following line.
  10.          free handles: [15]
  11.  
  12.     When executed under Microsoft CodeView ver 2.2,
  13.     this program will print the following line
  14.          free handles: [11]
  15.     since CodeView has taken four PFHT entries for
  16.     its own use.
  17.  
  18.     Further proof of the function can be obtained
  19.     by opening one or more files, calling the
  20.     function to check the free handles, and then
  21.     closing one file at a time.  After each close,
  22.     call the function.  The free handle count will
  23.     increase with each close.
  24.  
  25.     Commands to produce an executable from the code as
  26.     shown in the listings:
  27.         masm pfht;             (listing 3)
  28.         cl -c testpfht.c       (listing 4)
  29.         link testpfht pfht;
  30.   -------------------------------------------------- */
  31.  
  32. #include <stdio.h>
  33. #include <stdlib.h>     /* for _psp definition */
  34.  
  35. main()
  36. {
  37. extern int process_handles_free();
  38.  
  39.    printf("free handles: [%d]\n", process_handles_free());
  40. }
  41.  
  42.