From 66b09830c7b119ee042822207280b6090b00940d Mon Sep 17 00:00:00 2001 From: Richard Burgess <> Date: Sun, 5 Feb 1995 10:18:56 +0000 Subject: [PATCH] autocommit for file dated 1995-02-05 10:18:56 --- msamples/service/testsvc.c | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 msamples/service/testsvc.c diff --git a/msamples/service/testsvc.c b/msamples/service/testsvc.c new file mode 100644 index 0000000..107290f --- /dev/null +++ b/msamples/service/testsvc.c @@ -0,0 +1,44 @@ +/* Test client for the NUMBERS System Service. + Run this program from another CLI when Service is running +*/ + +#include +#include "\OSSOurce\MKernel.h" + +unsigned long Number; /* The number to return */ +unsigned long Exch; /* Where hte service will respond */ +unsigned long Message[2]; /* The Message from the service */ + +void main(void) +{ +unsigned long Error, rqhndl; + + Error = AllocExch(&Exch); /* get an exchange */ + + if (Error) + printf("Error %d allocating Exchange.\r\n", Error); + + Error = Request("NUMBERS ", 1, Exch, &rqhndl, + 0, /* No Send ptrs */ + &Number, 4, 0, 0, + 0,0,0); + if (Error) + printf("Error %d from Request.\r\n", Error); + + if (!Error) + { + Error = WaitMsg(Exch, Message); + + if (Error) + printf("Error %d from WaitMsg.\r\n", Error); + else + { + if (Message[1]) + printf("Error %d from NUMBERS Service.\r\n", Message[1]); + else + printf("NUMBERS Service gave out number: %d.\r\n", Number); + } + } + + DeAllocExch(Exch); /* it's nice to do this for the OS */ +} -- 2.40.0