1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 /* HISTORY COMMENTS:
10   1) change(86-05-09,Lee), approve(87-07-13,MCR7580), audit(87-07-13,Leskiw),
11      install(87-08-07,MR12.1-1072):
12      Created
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (get_mcb_values)
16 
17 get the major capability number and capability name from the mcb in the
18 application's memory space given a pointer to a local cat entry
19 */
20 
21 #include <dos.h>
22 #include <cat.h>
23 #include <ws_error.h>
24 
25 #define NULL 0
26 
27 extern local_cat l_CAT[];
28 
29 get_mcb_values (l_cat_ptr, entry_name, entry_number)
30 
31 local_cat *l_cat_ptr;                  /* Local CAT table */
32 char *entry_name;                      /* Name of entry */
33 int *entry_number;                     /* Number of entry */
34 {
35 int  data_segment;
36 char *segment_offset;
37 
38 /* : if the cat pointer is valid then
39      - get the data segment of the mcb in the cat entry
40      - if the mcb pointer in the cat entry is valid then
41      -- copy the value of the major capability from the mcb
42      -- copy the value of the capability name from the mcb
43      -- set code to no error and return */
44 
45    if (l_cat_ptr != NULL) {
46       data_segment = l_cat_ptr->sregs.ds;
47       if (l_cat_ptr->mcb_ptr != NULL) {
48          segment_offset = (char *) &(l_cat_ptr->mcb_ptr->major_capability);
49          peek (data_segment, segment_offset, entry_number, sizeof(int));
50          segment_offset = l_cat_ptr->mcb_ptr->capability_name;
51          peek (data_segment, segment_offset, entry_name, CAPABILITY_NAME_LENGTH);
52          return(0);
53       }
54       else
55          return(WSINVMCB);
56    }
57    else
58       return(WSINVNUM);
59 }
60 ^Z