home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*
- ** CLIPnet Library ** copyright of DataSync Technologies - Lansing, Mi
- *--------------------------------------------------------------------------*/
- #include "nandef.h"
- #include "extend.h"
- #include "extor.h"
-
- #include <dos.h>
- #include <stdio.h>
- #include <ctype.h>
-
- CLIPPER whoami() /* Returns name of user connected to the calling station
-
- Novell call: Connection Services
- NetWare API E3h(16h) "Get Connection Information"
-
- Added Notes:
- required Request buffer size is .... 4 bytes
- required Reply buffer size is ...... 63 bytes
-
- *---------------------------------------------------------------------------*/
- {
- union REGS inreg,outreg;
-
- unsigned i,j;
- struct SREGS seg;
-
- unsigned char *request = " ";
- unsigned char *reply = " ";
-
- /* Acquire local connect number from Novell */
- inreg.h.ah = 0xDC;
- intdos(&inreg,&outreg);
-
- inreg.h.ah = 0xE3; /* Novell function number */
-
- /* point DS:SI at the request buffer */
- seg.ds = FP_SEG(request);
- inreg.x.si = FP_OFF(request);
-
- /* point ES:DI at the reply buffer */
- seg.es = FP_SEG(reply);
- inreg.x.di = FP_OFF(reply);
-
- request[0] = 2; /* Length of send packet */
- request[1] = 0;
- request[2] = 0x16; /* Novell get connection info code */
- request[3] = outreg.h.al; /* logical ID of station we're interested in */
-
- intdosx(&inreg,&outreg,&seg); /* Software interrupt */
-
- /* Now retrieve user name from receive packet */
- for(i =0; reply[8+i] != 0 && i < 48; i++)
- reply[i] = reply[8+i];
-
- _retclen(reply,i); /* Clipper return mechanism */
-
- } /* EOF whoami */
- /*******************************/
-
-