1 /* Test client for the NUMBERS System Service.
\r
2 Run this program from another CLI when Service is running
\r
6 #include "\OSSOurce\MKernel.h"
\r
8 unsigned long Number; /* The number to return */
\r
9 unsigned long Exch; /* Where hte service will respond */
\r
10 unsigned long Message[2]; /* The Message from the service */
\r
14 unsigned long Error, rqhndl;
\r
16 Error = AllocExch(&Exch); /* get an exchange */
\r
19 printf("Error %d allocating Exchange.\r\n", Error);
\r
21 Error = Request("NUMBERS ", 1, Exch, &rqhndl,
\r
22 0, /* No Send ptrs */
\r
26 printf("Error %d from Request.\r\n", Error);
\r
30 Error = WaitMsg(Exch, Message);
\r
33 printf("Error %d from WaitMsg.\r\n", Error);
\r
37 printf("Error %d from NUMBERS Service.\r\n", Message[1]);
\r
39 printf("NUMBERS Service gave out number: %d.\r\n", Number);
\r
43 DeAllocExch(Exch); /* it's nice to do this for the OS */
\r