home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / queues.arj / DESTROYQ.C < prev    next >
Text File  |  1991-05-31  |  2KB  |  70 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2.  *                                                                           *
  3.  *                                                                           *
  4.  Program : DESTROYQ.C
  5.  Author  : Christopher R. Ojeda
  6.  Date    : 05/20/91
  7.  Function: DESTROYQ destroys a queue created with CREATQ.
  8.  Genesis : Turbo C 2.0
  9.            Compiled in Turbo C environment with defaults under DOS 3.3.
  10.  
  11.  This software is provided as is and carries no warranty
  12.  whatsoever.  Novell disclaims and excludes any and all implied
  13.  warranties of merchantability, title and fitness for a particular
  14.  purpose.  Novell does not warrant that the software will satisfy
  15.  your requirements or that the software is without defect or error
  16.  or that operation of the software will be uninterrupted.  You are
  17.  using the software at your risk.  The software is not a product
  18.  of Novell, Inc. or any of subsidiaries.
  19.  *                                                                           *
  20.  *                                                                           *
  21.  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  22.  
  23. #include <stdio.h>
  24. #include <dos.h>
  25. #include <nit.h>
  26. #include <niterror.h>
  27. #include <nitq.h>
  28.  
  29. #define INT21          0x21
  30. #define OT_TEST_SERVER 0x8010
  31. #define OT_TEST_QUEUE  0x8020
  32.  
  33. char GetCurrentDrive (void);
  34. void main (void);
  35.  
  36. void main() {
  37.     int  cCode;
  38.     long queueID;
  39.     BYTE drive ;
  40.     BYTE dirHandle;
  41.  
  42.     drive = GetCurrentDrive() ;
  43.     dirHandle = GetDirectoryHandle (drive);
  44.     if (cCode = GetBinderyObjectID ("CHRIS_QUEUE",
  45.                                     OT_TEST_QUEUE,
  46.                                     &queueID)) {
  47.       printf ("\nError %d getting bindery object ID.", cCode);
  48.       exit (1);
  49.       }
  50.     if (cCode = DestroyQueue (queueID)) {
  51.       printf ("\nError %d destroying queue.", cCode);
  52.       exit (1);
  53.       }
  54.      else printf ("\nQueue destroyed.");
  55.     if (cCode = DeleteBinderyObject ("CHRIS_SERVER",
  56.                                      OT_TEST_SERVER))
  57.       printf ("\nError %d deleting bindery object.", cCode);
  58.     else printf ("\nBindery object deleted.");
  59. }
  60.  
  61. char GetCurrentDrive()
  62. {
  63.     union REGS reg ;
  64.     struct SREGS segs ;
  65.  
  66.     reg.h.ah = 0x19 ;
  67.     int86x(INT21,®,®,&segs) ;
  68.     return(reg.h.al) ;
  69. }
  70.