home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / fmi.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  34KB  |  731 lines

  1. /* fmi.h */
  2. /*
  3.  * (C) Copyright Data Connection Limited 1989-1992.
  4.  * (C) Copyright Microsoft Corporation 1991.
  5.  * All Rights Reserved.
  6.  */
  7.  
  8. #ifndef FMIH_INCLUDED
  9. #define FMIH_INCLUDED
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. #ifdef WIN32_SUPPORT
  16.   #pragma pack(1)
  17. #endif
  18.  
  19. /*****************************************************************************/
  20. /* The following type definitions are in os2def.h so are not needed in OS/2  */
  21. /*****************************************************************************/
  22. #if (defined(DOS_SUPPORT) || defined(MSWIN_SUPPORT))
  23. #define CHAR          char      /* ch  */
  24. typedef unsigned char UCHAR;    /* uch */
  25. typedef unsigned short USHORT;  /* us  */
  26. typedef unsigned long ULONG;    /* ul  */
  27. #endif
  28.  
  29. /*****************************************************************************/
  30. /* Type definitions for message fields                                       */
  31. /*****************************************************************************/
  32. typedef signed short         INTEGER;
  33.  
  34. /*****************************************************************************/
  35. /* Macro to convert integer fields other than STARTD and ENDD, SRCI          */
  36. /* and DESTI to In-line format                                               */
  37. /*****************************************************************************/
  38. #ifndef WIN32_SUPPORT
  39. #define DOFLIP(X) ((INTEGER)((((X) & 0xff) << 8) | (((X) >> 8) & 0xff)))
  40. #else
  41. #ifndef ROTL
  42.  #ifndef _CRTAPI1
  43.   unsigned int _rotl(unsigned int, int);
  44.  #else
  45.   unsigned int _CRTAPI1 _rotl(unsigned int, int);
  46.  #endif
  47.   #define ROTL
  48. #endif
  49. #pragma intrinsic(_rotl)
  50. #define DOFLIP(X)   ((INTEGER)_rotl(((unsigned short)(X))*(unsigned long)0x00010001, 8))
  51. #endif
  52. #define DONTFLIP(X) (X)
  53.  
  54.  
  55. #ifdef NON_INTEL_BYTE_ORDER
  56.  #define PFLIPI(X)      DONTFLIP(X)
  57.  #define PANTIFLIPI(X)  DOFLIP(X)
  58. #else
  59.  #define PFLIPI(X)      DOFLIP(X)
  60.  #define PANTIFLIPI(X)  DONTFLIP(X)
  61. #endif
  62.  
  63.  
  64. /*****************************************************************************/
  65. /* Element offset and length definitions                                     */
  66. /*****************************************************************************/
  67.  
  68. #define SBCBELT1 1
  69. #define SBCBELT3 13
  70. #define SNANBEDA 268     /* LENGTH OF BUFFER ELEMENT */
  71.  
  72. /*****************************************************************************/
  73. /* MESSAGE TYPE DECLARATIONS - ELEMENT OPTIONS                               */
  74. /*****************************************************************************/
  75.      typedef
  76. #define RHASENSE     0
  77. #define DATAONLY     1
  78.      signed char ELTDATAT;
  79.  
  80.      typedef CHAR     SNCHARRU[SNANBEDA];        /* LENGTH OF ELT */
  81.  
  82. /*****************************************************************************/
  83. /* MAIN DEFINITION OF MESSAGE ELEMENT                                        */
  84. /*****************************************************************************/
  85.  
  86. /**STRUCT+********************************************************************/
  87. /* Structure: BUFELT                                                         */
  88. /*                                                                           */
  89. /* Description: Main definition of SNAPS Buffer Element                      */
  90. /*****************************************************************************/
  91.  
  92. #ifdef WIN32_SUPPORT
  93.  #define PTRBFELT struct bufelt *
  94. #else
  95.  #define PTRBFELT struct bufelt far *
  96. #endif
  97.  
  98.      typedef struct bufelt{
  99.                      PTRBFELT elteptr;   /* Pointer to next element in buffer*/
  100.                      INTEGER  startd;    /* Offset (from 1) of start of data */
  101.                      INTEGER  endd;      /* Offset (from 1) of last data byte*/
  102.                      CHAR     trpad;
  103.                      /*ELTDATAT*/union {
  104.                        /*RHASENSE*/struct {unsigned char rhpad[8];
  105.                                      signed long BBUFF0V;
  106.                                      INTEGER  BBUFF0W;
  107.                                      INTEGER  BBUFF0X;}BBUFF0T;
  108.                        /*DATAONLY*/struct {SNCHARRU BBUFF0Z;
  109.                                                       }BBUFF0Y;
  110.                    }BBUFF0S;}
  111. #define rh       BBUFF0S.BBUFF0T.BBUFF0V /* The RH bytes themselves          */
  112. #define sense1   BBUFF0S.BBUFF0T.BBUFF0W /* Sense data 1 in negative response*/
  113. #define sense2   BBUFF0S.BBUFF0T.BBUFF0X /* Sense data 2 in negative response*/
  114. #define dataru   BBUFF0S.BBUFF0Y.BBUFF0Z /* The data bytes themselves        */
  115. #define lccpad   BBUFF0S.BBUFF0Y.BBUFF1A /* Pad                              */
  116.                    BUFELT;
  117.  
  118.  
  119. /*****************************************************************************/
  120. /* OPEN MESSAGE TYPE DECLARATIONS                                            */
  121. /*****************************************************************************/
  122.  
  123.      typedef struct tpophdr{                          /* OPEN MESSAGE HEADER */
  124.                       CHAR     openqual;
  125. #define REQU     1
  126. #define RSPOK    2
  127. #define RSPERR   3
  128. #define CONFOK   4
  129. #define CONFERR  5
  130.                       CHAR     opentype;
  131. #define SSCPSEC  1
  132. #define LUSEC    2
  133. #define SBPUSEC  3
  134.                       CHAR     appltype;     /* INTERFACE ID - X'02' FOR FMI */
  135.                       CHAR     opluno;              /* INTERFACE USER NUMBER */
  136.                       INTEGER  opresid;             /* INTERFACE USER ID     */
  137.                       union {
  138.                         struct {INTEGER  B03;
  139.                                 INTEGER  B04;
  140.                                 CHAR     B05;
  141.                                 CHAR     B06;}B02;
  142.                         struct {INTEGER  B08;
  143.                                 INTEGER  B09;}B07;
  144.                     }B01;}
  145. #define icreditr B01.B02.B03
  146. #define icredits B01.B02.B04
  147. #define opninfo1 B01.B02.B05
  148. #define opnpad1  B01.B02.B06
  149. #define operr1   B01.B07.B08
  150. #define operr2   B01.B07.B09
  151.                     TPOPHDR;
  152.  
  153. /*****************************************************************************/
  154. /* Open (SSCP) opnpad1 values                                                */
  155. /*****************************************************************************/
  156.  
  157. #define OPEN_TEST       0               /* DON'T FORCE A CONNECTION ACTIVE   */
  158. #define OPEN_FORCE      1               /* FORCE A CONNECTION ACTIVE         */
  159.  
  160. /*****************************************************************************/
  161. /* Constants for operr2 field in Open(SSCP) Error Responses                  */
  162. /*****************************************************************************/
  163.  
  164. #define CSRENOSR 0                      /* NO SERVERS FOUND                  */
  165. #define CSRESERV 1                      /* SERVICE NOT PRESENT AT LOCALITY   */
  166. #define CSRECNFG 2                      /* CONFIGURATION MISMATCH            */
  167. #define CSRECBSH 3                      /* CONTROL BLOCK/RESOURCE SHORTAGE   */
  168. #define CSREFORM 4                      /* FORMAT/PROTOCOL ERROR             */
  169.  
  170. /*****************************************************************************/
  171. /* LINK TYPE DEFINITIONS FOR OPEN (SSCP) RESPONSE IN DATARU[38]              */
  172. /*****************************************************************************/
  173.  
  174. #define CESLINK          3              /* SDLC LINK                         */
  175. #define CESX25           4              /* X.25 LINK                         */
  176. #define CESDFT          10              /* DFT LINK                          */
  177. #define CESTR           11              /* TOKEN RING LINK                   */
  178. #define CESTCPIP        30              /* TCP/IP LINK                       */
  179. #define CESRELAY        31              /* FRAME RELAY LINK                  */
  180. #define CESCHANL        32              /* CHANNEL LINK                      */
  181. #define CESISDN         33              /* ISDN LINK                         */
  182. #define CESETHER        34              /* ETHERNET 802.2 LINK               */
  183.  
  184. /*****************************************************************************/
  185. /* BIND Table Index Values for the Open PLU response (in element)            */
  186. /*****************************************************************************/
  187.  
  188. #define BIND_TABLE_INDEX_PRT    1
  189. #define BIND_TABLE_INDEX_CRT    2
  190.  
  191. /*****************************************************************************/
  192. /* CLOSE MESSAGE TYPE DECLARATIONS                                           */
  193. /*****************************************************************************/
  194.  
  195.      typedef struct tpclhdr{                         /* CLOSE MESSAGE HEADER */
  196.                       CHAR     closqual;    /* Same values as openqual       */
  197.                       CHAR     clstype;     /* Same values as opentype       */
  198.                       CHAR     clsctl;      /* For Close(PLU) only           */
  199. #define CLNORMAL 1
  200. #define CLBIND   2
  201. #define CLCFAERR 3
  202. #define CLPUINAC 4
  203. #define CLLUINAC 5
  204. #define CLLNKERR 6
  205. #define CLBFSHRT 7
  206. #define CLRCVCHK 8
  207. #define CLSLUTRM 9
  208.                       CHAR     clspad1;
  209.                       INTEGER  clspad2;
  210.                       INTEGER  clserr1;
  211.                       INTEGER  clserr2;
  212.                     }TPCLHDR;
  213.  
  214. /*****************************************************************************/
  215. /* STATUS-ACKNOWLEDGE MESSAGE TYPE DECLARATION                               */
  216. /*****************************************************************************/
  217.  
  218.      typedef struct tpstahdr{                   /* STATUS ACK MESSAGE HEADER */
  219.                       CHAR     akstat;
  220. #define ACK      1
  221.                       CHAR     akqual;
  222. #define ACKPOS   2
  223. #define ACKNEG1  3
  224. #define ACKNEG2  4
  225.                       INTEGER  akmsgkey;
  226.                       union {
  227.                               INTEGER XXXXX01;
  228.                               struct {
  229.                                  CHAR     XXXXX02;
  230.                                  CHAR     XXXXX03;
  231.                                      } XXXXX04;
  232.                             } XXXXX05;
  233.                       INTEGER  aknumb1;
  234.                       INTEGER  aknumb2;
  235.                       INTEGER  akseqno;
  236.  
  237. #define akmsgtim XXXXX05.XXXXX01
  238. #define akflags1 XXXXX05.XXXXX04.XXXXX02    /* Same values as fhflags1 below */
  239.                                             /* Reserved for ACKNEG2          */
  240. #define akflags2 XXXXX05.XXXXX04.XXXXX03    /* Same values as fhflags2 below */
  241.                                             /* Crit/Non-Crit fail for ACKNEG2*/
  242.  
  243.                     }TPSTAHDR;
  244.  
  245. /*****************************************************************************/
  246. /* STATUS-ERROR MESSAGE TYPE DECLARATION                                     */
  247. /*****************************************************************************/
  248.  
  249.      typedef struct tpstehdr{                 /* STATUS ERROR MESSAGE HEADER */
  250.                       CHAR     errstat;
  251. #define STERROR  3
  252.                       CHAR     errpad1;
  253.                       INTEGER  errpad2;
  254.                       INTEGER  errpad3;
  255.                       INTEGER  errcode1;
  256.                       INTEGER  errcode2;
  257.                     }TPSTEHDR;
  258.  
  259. /*****************************************************************************/
  260. /* STATUS-CONTROL MESSAGE TYPE DECLARATION                                   */
  261. /*****************************************************************************/
  262.  
  263.      typedef struct tpstchdr{               /* STATUS CONTROL MESSAGE HEADER */
  264.                      CHAR     ctlstat;
  265. #define STCNTRL  2
  266.                      CHAR     ctlqual;
  267. #define CTLREQU  1
  268. /* #define ACKPOS   2 */
  269. /* #define ACKNEG1  3 */
  270. /* #define ACKNEG2  4 */
  271.                      CHAR     ctltype;
  272. #define CCLEAR   1
  273. #define CSDT     2
  274. #define CRQR     3
  275. #define CSTSN    4
  276. #define CCANCEL  16
  277. #define CLUSTAT  17
  278. #define CSIGNAL  18
  279. #define CRSHUTD  19
  280. #define CBID     20
  281. #define CCHASE   21
  282. #define CSHUTC   22
  283. #define CSHUTD   23
  284. #define CRTR     24
  285. #define CQC      32
  286. #define CQEC     33
  287. #define CRELQ    34
  288.                      CHAR     ctlack;       /* Same values as fhackrqd below */
  289.                      CHAR     ctlflag1;     /* Same values as fhflags1 below */
  290.                      CHAR     ctlflag2;     /* Same values as fhflags2 below */
  291.                      INTEGER  ctlnumb1;
  292.                      INTEGER  ctlnumb2;
  293.                      INTEGER  ctlmsgk;
  294.                    }TPSTCHDR;
  295.  
  296. /*****************************************************************************/
  297. /* STATUS-RESOURCE MESSAGE TYPE DECLARATION                                  */
  298. /*****************************************************************************/
  299.  
  300.      typedef struct tpstrhdr{              /* STATUS RESOURCE MESSAGE HEADER */
  301.                       CHAR     resstat;
  302. #define STRESRCE 4
  303.                       CHAR     respad;
  304.                       INTEGER  rescred;
  305.                     }TPSTRHDR;
  306.  
  307. /*****************************************************************************/
  308. /* STATUS-SESSION MESSAGE TYPE DECLARATION                                   */
  309. /*****************************************************************************/
  310.  
  311.      typedef struct tpstshdr{               /* STATUS SESSION MESSAGE HEADER */
  312.                       CHAR     sessstat;
  313. #define STSESSN  5
  314.                       CHAR     sesspad;
  315.                       INTEGER  sesscode;
  316. #define STNOSESS 1                               /* X'01' (NO SESSION)       */
  317. #define STLINERR 2                               /* X'02' (LINK ERROR)       */
  318. #define STPUACT  3                               /* X'03' (PU ACTIVE)        */
  319. #define STPUREAC 4                               /* X'04' (PU RE-ACTIVATED)  */
  320. #define STLUACT  5                               /* X'05' (LU ACTIVE)        */
  321. #define STLUREAC 6                               /* X'06' (LU RE-ACTIVATED)  */
  322. #define STBETB   7                               /* BETB STATUS-SESSION CODE */
  323.                       INTEGER  sessqual;
  324. /* #define STPUACT  3                               X'03' (PU ACTIVE)        */
  325. /* #define STPUREAC 4                               X'04' (PU RE-ACTIVATED)  */
  326. #define STPUINAC 16                              /* X'10' (PU INACTIVE)      */
  327. #define STLUINAC 17                              /* X'11' (LU INACTIVE)      */
  328.                     }TPSTSHDR;
  329.  
  330. /*****************************************************************************/
  331. /* STATUS-RTM     MESSAGE TYPE DECLARATION                                   */
  332. /*****************************************************************************/
  333.  
  334.      typedef struct tpstmhdr{               /* STATUS RTM     MESSAGE HEADER */
  335.                       CHAR     rtmstat;
  336. #define STRTM    6
  337.                       CHAR     strbndry;   /* set boundaries flag */
  338.                       CHAR     strcount;   /* set counters flag */
  339.                       CHAR     strtmdef;   /* rtm definition */
  340.                       CHAR     strtmact;   /* rtm active flag */
  341.                       CHAR     strtmdsp;   /* local display active flag */
  342.                     }TPSTMHDR;
  343.  
  344. /*****************************************************************************/
  345. /* STATUS VARIANT TYPES                                                      */
  346. /*****************************************************************************/
  347.  
  348.      typedef struct tpashdr{                    /* APPLSTATUS MESSAGE HEADER */
  349.                       union {
  350.                         struct {TPSTAHDR B0G;}B0F; /* Status-Ack variant     */
  351.                         struct {TPSTCHDR B0I;}B0H; /* Status-Control variant */
  352.                         struct {TPSTEHDR B0K;}B0J; /* Status-Error variant   */
  353.                         struct {TPSTRHDR B0M;}B0L; /* Status-Resource variant*/
  354.                         struct {TPSTSHDR B0O;}B0N; /* Status-Session variant */
  355.                         struct {TPSTMHDR X1E;}X1D; /* Status-RTM variant     */
  356.                     }B0E;}
  357. #define stackhdr B0E.B0F.B0G
  358. #define stctlhdr B0E.B0H.B0I
  359. #define sterrhdr B0E.B0J.B0K
  360. #define streshdr B0E.B0L.B0M
  361. #define stseshdr B0E.B0N.B0O
  362. #define strtmhdr B0E.X1D.X1E
  363.                     TPASHDR;
  364.  
  365. /*****************************************************************************/
  366. /* FMI APPLDATA HERE                                                         */
  367. /*****************************************************************************/
  368.  
  369.      typedef struct tpfmihdr{                     /* FMI DATA MESSAGE HEADER */
  370.                      CHAR     fhackrqd;
  371. #define NOACKREQ 0
  372. #define ACKREQ   1
  373.                      CHAR     fhpad1;
  374.                      INTEGER  fhmsgkey;
  375.                      CHAR     fhflags1;           /* BIT SIGNIFICANT */
  376. #define AF_FMH  0x80
  377. #define AF_BC   0x40
  378. #define AF_EC   0x20
  379. #define AF_COMM 0x10
  380. #define AF_BB   0x08
  381. #define AF_EB   0x04
  382. #define AF_CD   0x02
  383. #define AF_SD   0x01
  384.                      CHAR     fhflags2;           /* BIT SIGNIFICANT */
  385. #define AF_CODE 0x80
  386. #define AF_ENCR 0x40
  387. #define AF_ENPD 0x20
  388. #define AF_QRI  0x10
  389. #define AF_CEI  0x08
  390. #define AF_BBIU 0x04
  391. #define AF_EBIU 0x02
  392. #define AF_RBI  0x01
  393.                      INTEGER  fhpad2;
  394.                      INTEGER  fhpad3;
  395.                      INTEGER  fhseqno;
  396.                    }TPFMIHDR;
  397.  
  398. /*****************************************************************************/
  399. /* MAIN DEFINITION OF MESSAGE HEADER                                         */
  400. /*****************************************************************************/
  401.  
  402. #ifdef WIN32_SUPPORT
  403.  #define PTRBFHDR struct bufhdr *
  404. #else
  405.  #define PTRBFHDR struct bufhdr far *
  406. #endif
  407.  
  408.      typedef struct bufhdr{
  409.                      PTRBFHDR nxtqptr;
  410.                      PTRBFELT hdreptr;
  411.                      CHAR     numelts;
  412.                      CHAR     msgtype;
  413. #define OPENMSG  1
  414. #define CLOSEMSG 2
  415. #define DATAFMI  32
  416. #define STATFMI  33
  417.                      CHAR     srcl;
  418.                      CHAR     srcp;
  419. #define S3PROD   18                               /* 3270 Partner number     */
  420.                      INTEGER  srci;
  421.                      CHAR     destl;
  422.                      CHAR     destp;
  423.                      INTEGER  desti;
  424.                      union {
  425.                        struct {TPOPHDR  B1C;}B1B;
  426.                        struct {TPCLHDR  B1E;}B1D;
  427.                        struct {TPFMIHDR B1K;}B1J;
  428.                        struct {TPASHDR  B1M;}B1L;
  429.                      }B0Y;}
  430. #define ophdr    B0Y.B1B.B1C
  431. #define clhdr    B0Y.B1D.B1E
  432. #define dfhdr    B0Y.B1J.B1K
  433. #define sfhdr    B0Y.B1L.B1M
  434.                      BUFHDR;
  435.  
  436. /*****************************************************************************/
  437. /* RETURN CONSTANTS FOR SBPURCV                                              */
  438. /*****************************************************************************/
  439.  
  440. #define CSUNORES 0 /* NO RESULT                                              */
  441. #define CSUMSGRT 1 /* MESSAGE RETURNED                                       */
  442. #define CSUPTHER 2 /* PATH ERROR                                             */
  443. #define CSUTERM  3 /* TERMINATE                                              */
  444. #define CSUBUFSH 4 /* BUFFER SHORTAGE                                        */
  445.  
  446. /*****************************************************************************/
  447. /* PROCTYPE AND SERVTYPE PARAMETERS FOR SBPUINIT                             */
  448. /*****************************************************************************/
  449.  
  450. #define CLIENT           2      /* client entry                              */
  451. #define CES3270          2      /* SNAP-3270                                 */
  452.  
  453. /*****************************************************************************/
  454. /* DL-Base return Values                                                     */
  455. /*****************************************************************************/
  456.  
  457. #ifndef NO_ERROR
  458.  #define NO_ERROR         0
  459. #endif
  460.  
  461. #define CEDINNOMSG       0          /* status = no message or status         */
  462. #define CEDINMSG         1          /* status = got message                  */
  463. #define CEDINLLN         2          /* status = lost locality                */
  464.  
  465. /* values for SBPUINIT only */
  466.  
  467. #define DMBASE          550            /* Base level for Com Manager errors  */
  468. #define DMLTABF         (DMBASE + 5)   /* L-table full                       */
  469. #define DMMNWGI         (DMBASE + 12)  /* NetWkstaGetInfo call failed        */
  470. #define DMDSTFL         (DMBASE + 13)  /* Service table full                 */
  471. #define DMMPIPF         (DMBASE + 17)  /* Make pipe call failed              */
  472. #define DMCOMNM         (DMBASE + 32)  /* No name found for this service     */
  473. #define DMCOMDUP        (DMBASE + 46)  /* Duplicate COMNAME for service      */
  474. #define DMNOTLOG        (DMBASE + 48)  /* User not logged on                 */
  475. #define DMCFGOPN        (DMBASE + 66)  /* Failed to open the config file     */
  476. #define DMCFREAD        (DMBASE + 68)  /* Error reading config file          */
  477. #define DMNONAP         (DMBASE + 75)  /* NAP not up when starting service   */
  478. #define WINBASE          950           /* Base level for Windows-only errors */
  479. #define DMMAXAPP        (WINBASE+3)    /* Exceeded max # of concurrent apps  */
  480.  
  481. /*****************************************************************************/
  482. /* Dmod/DL-Base entry points                                                 */
  483. /*****************************************************************************/
  484.  
  485. #ifdef MSWIN_SUPPORT
  486.  #ifndef APIENTRY
  487.   #define APIENTRY WINAPI
  488.  #endif
  489. #endif
  490.  
  491. #ifdef OS2_SUPPORT
  492. extern USHORT   APIENTRY  sbpuinit (HSEM FAR *, USHORT, USHORT, UCHAR FAR *);
  493. extern USHORT   APIENTRY  sbpurcv (PTRBFHDR FAR *, INTEGER FAR*);
  494. #endif
  495.  
  496. #ifdef WIN32_SUPPORT
  497. extern USHORT WINAPI sbpuinit (HANDLE *, USHORT, USHORT, UCHAR *);
  498. extern USHORT WINAPI sbpurcv (PTRBFHDR *, INTEGER *);
  499. #endif
  500.  
  501. #ifdef MSWIN_SUPPORT
  502. extern USHORT   WINAPI  sbpuinit (USHORT, USHORT, UCHAR FAR *);
  503. #endif
  504.  
  505. #ifdef DOS_SUPPORT
  506. extern USHORT   APIENTRY  sbpuinit (HSEM FAR *, USHORT, USHORT);
  507. #endif
  508.  
  509. #ifndef WIN32_SUPPORT
  510. extern USHORT   APIENTRY  sbpurcvx (BUFHDR FAR * FAR *, INTEGER, INTEGER);
  511. extern VOID     APIENTRY  sbpusend (PTRBFHDR);
  512. extern VOID     APIENTRY  sbputerm (VOID);
  513. #else
  514. extern USHORT WINAPI sbpurcvx (BUFHDR * *, INTEGER, INTEGER);
  515. extern VOID   WINAPI sbpusend (PTRBFHDR);
  516. extern VOID   WINAPI sbputerm (VOID);
  517. #endif
  518.  
  519. #ifdef OS2_SUPPORT
  520. extern USHORT APIENTRY sepdrout(USHORT (APIENTRY *) (BUFHDR far *, USHORT, USHORT));
  521. #endif
  522.  
  523. #ifdef WIN32_SUPPORT
  524. extern ULONG WINAPI sepdrout(ULONG (WINAPI *) (BUFHDR *, USHORT, USHORT));
  525. #endif
  526.  
  527. #ifdef MSWIN_SUPPORT
  528. extern USHORT WINAPI sepwrout(USHORT (WINAPI *) (BUFHDR far *, USHORT, USHORT));
  529. #endif
  530.  
  531. #ifdef DOS_SUPPORT
  532. extern USHORT APIENTRY sepdrout(USHORT (APIENTRY *) (BUFHDR far *, USHORT, USHORT));
  533. #endif
  534.  
  535. /*****************************************************************************/
  536. /* Buffer pool access routines                                               */
  537. /*****************************************************************************/
  538.  
  539. #ifndef WIN32_SUPPORT
  540. extern PTRBFHDR APIENTRY  sepdbubl (USHORT);
  541. extern VOID     APIENTRY  sepdburl (PTRBFHDR);
  542.  
  543. extern VOID     APIENTRY  sbpibegt (PTRBFELT FAR *);
  544. extern VOID     APIENTRY  sbpiberl (PTRBFELT FAR *);
  545.  
  546. extern VOID     APIENTRY  sepdchnk (USHORT FAR *, USHORT FAR *);
  547. #else
  548. extern PTRBFHDR WINAPI sepdbubl (USHORT);
  549. extern VOID     WINAPI sepdburl (PTRBFHDR);
  550.  
  551. extern VOID     WINAPI sbpibegt (PTRBFELT *);
  552. extern VOID     WINAPI sbpiberl (PTRBFELT *);
  553.  
  554. extern VOID     WINAPI sepdchnk (USHORT *, USHORT *);
  555. #endif
  556.  
  557. /*****************************************************************************/
  558. /* Structures for the 3270 user record.                                      */
  559. /*****************************************************************************/
  560.  
  561. #define CERT3270  0x0002           /* 3270 user record type                  */
  562. #define CECWKHAC  8                /* Length of Host Access Name             */
  563. #define CECWKUNM  20               /* Length of 3270 user name               */
  564. #define CECWKREM  25               /* Length of record remark                */
  565. #define CE3MASMX  10               /* Max number of 3270 sessions            */
  566.  
  567. typedef struct tecwrksd
  568. {
  569.   UCHAR   cwshost[CECWKHAC + 1];   /* LU/Pool name accessed                  */
  570.   USHORT  cwsestyp;                /* Session type (M2, M3, M4, M5, printer) */
  571. #define CERTMOD2 0                 /* 24x80                                  */
  572. #define CERTMOD3 1                 /* 32x80                                  */
  573. #define CERTMOD4 2                 /* 43x80                                  */
  574. #define CERTMOD5 3                 /* 27x132                                 */
  575. #define CERTPRNT 4                 /* Host printer                           */
  576.   USHORT  cwsmodov;                /* Has the user got override permission?  */
  577.   USHORT  cwspad;                  /* 2 bytes of padding                     */
  578. } TECWRKSD;
  579.  
  580. typedef struct tecwrkus
  581. {
  582.   USHORT   cwlen;                  /* Length of record                       */
  583.   USHORT   cwtype;                 /* Type of record                         */
  584.   UCHAR    cwname[CECWKUNM + 1];   /* User name                              */
  585.   UCHAR    cwremark[CECWKREM + 1]; /* Comment field                          */
  586.   UCHAR    cwstylef[9];            /* Initial style file name - no extnsn    */
  587.   USHORT   cwvewrtm;               /* Can user view RTM info ?               */
  588.   USHORT   cwalert;                /* Has user got ALERT permission ?        */
  589.   USHORT   cwchghan;               /* Can change LU/Pool name accessed ?     */
  590.   USHORT   cwmaxses;               /* Maximum number of active sessions 1-10 */
  591.   USHORT   cwnumrec;               /* Number of sessions for user            */
  592.   TECWRKSD cwsesdat[CE3MASMX];     /* Session information records            */
  593.   USHORT   cwmodisf;               /* Permission to modify initial style     */
  594.   USHORT   cwpad;                  /* 2 bytes of padding                     */
  595.   USHORT   cwnumrmp;               /* Number of LUs/Pools in remap list      */
  596.   TECWRKSD cwremap[1];             /* LU/Pool Remap list                     */
  597. } TECWRKUS;
  598.  
  599. /*****************************************************************************/
  600. /* Structures for the diagnostics record.                                    */
  601. /*****************************************************************************/
  602.  
  603. #define CERTDIAG  0x0001           /* Diagnostics record type                */
  604. #define CECNUMAL  20               /* Max number of ALERTs configurable      */
  605. #define CECALRNM  52               /* Length of ALERT description 52 (arr sz)*/
  606. #define CECALRNA  34               /* Actual length of ALERT desc is 34      */
  607. #define CECALRPR  32               /* Length of parameter description        */
  608. #define CECONAME  8                /* Length of connection name              */
  609. #define CESTRLEN  128              /* Length of a string + 1                 */
  610. #define CECCNLEN  15               /* Length of a computer name              */
  611.  
  612. typedef struct tedalert
  613. {
  614.   UCHAR    dalrtnam[CECALRNM + 1]; /* Description of the ALERT number        */
  615.   UCHAR    daparam1[CECALRPR + 1]; /* Description of parameter 1             */
  616.   UCHAR    daparam2[CECALRPR + 1]; /* Description of parameter 2             */
  617.   UCHAR    daparam3[CECALRPR + 1]; /* Description of parameter 3             */
  618. } TEDALERT;
  619.  
  620. typedef struct tediagns
  621. {
  622.   USHORT   dilen;                  /* Length of record                       */
  623.   USHORT   ditype;                 /* Type of record                         */
  624.   UCHAR    dinetmgt[CECONAME + 1]; /* Network Management Connection name     */
  625.   USHORT   disrtmco;               /* Send RTM data at counter overflow      */
  626.   USHORT   disrtmub;               /* Send RTM data at UNBIND                */
  627.   USHORT   diwruldr;               /* RTM timers run until:                  */
  628. #define CERTWRIT 0                 /*  0 - first data reaches screen         */
  629. #define CERTUNLK 1                 /*  1 - host unlocks keyboard             */
  630. #define CERTDIRE 2                 /*  2 - host lets user send               */
  631.   USHORT   dirtmth1;               /* RTM threshold #1                       */
  632.   USHORT   dirtmth2;               /* RTM threshold #2                       */
  633.   USHORT   dirtmth3;               /* RTM threshold #3                       */
  634.   USHORT   dirtmth4;               /* RTM threshold #4                       */
  635.   TEDALERT dialerts[CECNUMAL];     /* ALERT description records              */
  636.   UCHAR    diaudit[CESTRLEN];      /* Audit log filename                     */
  637.   UCHAR    dierror[CESTRLEN];      /* Error log filename                     */
  638.   USHORT   diaudlev;               /* Default audit level                    */
  639.                                    /*   0   -   level 6                      */
  640.                                    /*   1   -   level 8                      */
  641.                                    /*   2   -   level 10                     */
  642.   UCHAR    dipad[CECCNLEN + 1];    /* 16 bytes of padding                    */
  643. } TEDIAGNS;
  644.  
  645. /*****************************************************************************/
  646. /* Routine to access config information                                      */
  647. /*****************************************************************************/
  648. #ifndef WIN32_SUPPORT
  649. USHORT APIENTRY sepdcrec(UCHAR FAR *, USHORT, USHORT FAR * );
  650. #else
  651. USHORT WINAPI sepdcrec(UCHAR *, USHORT, USHORT * );
  652. #endif
  653.  
  654. /*****************************************************************************/
  655. /* Return codes from sepdcrec                                                */
  656. /*****************************************************************************/
  657.  
  658. #define NOCSSRVR 1                   /* No config server available           */
  659. #define NODGNREC 2                   /* Diagnostics record not found         */
  660. #define NOUSRREC 3                   /* No user record found for this user   */
  661. #define BUF2SMAL 4                   /* Buffer too small                     */
  662. #define NONOS    5                   /* Network not started                  */
  663. #define NOTLOGON 6                   /* User not logged on to network        */
  664. #define READERR  7                   /* File read error                      */
  665. #define NONAP    8                   /* NAP not started                      */
  666. #define MAXAPP   9                   /* Max # of client apps reached         */
  667. #define ERROR_SERVER 14              /* Error on the server end of the RPC   */
  668. #define ERROR_LOCAL_FAILURE 15       /* Error on the local end of the RPC    */
  669.  
  670. /*****************************************************************************/
  671. /* Structure of version information block                                    */
  672. /*****************************************************************************/
  673.  
  674. typedef struct cs_info {
  675.   unsigned short    length;            /* length of this struct (bytes)      */
  676.                                        /* (supplied parameter)               */
  677.   unsigned char     major_ver;         /* CS major ver CS1.1->1, CS2.0->2    */
  678.   unsigned char     minor_ver;         /* CS minor ver CS1.1->10 (dec)       */
  679.   unsigned char     config_share[80];  /* name of share point of current     */
  680.                                        /* config file = default location for */
  681.                                        /* style file \\box\share\ (null      */
  682.                                        /* terminated)                        */
  683.   unsigned short    nos;               /* NOS that the LAN is running        */
  684. #define Workstation 0
  685. #define LANMan      1      /* Also LAN Server, unless we can differentiate   */
  686. #define NetWare     2
  687. } CS_INFO;
  688.  
  689. /*****************************************************************************/
  690. /* Routine to get version information                                        */
  691. /*****************************************************************************/
  692. #ifndef WIN32_SUPPORT
  693. USHORT APIENTRY sepdgetinfo(struct cs_info far * );
  694. #else
  695. USHORT WINAPI sepdgetinfo(struct cs_info * );
  696. #endif
  697.  
  698. /*****************************************************************************/
  699. /* Additional return code from sepdgetinfo.                                  */
  700. /*****************************************************************************/
  701. #define BADLNGTH 2
  702.  
  703.  
  704. /*****************************************************************************/
  705. /* Function definition for fmistrings dll entry point                        */
  706. /*****************************************************************************/
  707. int WINAPI GetFmiReturnCode (UINT,UINT,UINT,unsigned char FAR * );
  708.  
  709. /*****************************************************************************/
  710. /* typedef for casting proc address return from GetProcAddress               */
  711. /*****************************************************************************/
  712. typedef int (FAR WINAPI * PGETFMISTR)(UINT, UINT, UINT, char FAR *);
  713.  
  714. /*****************************************************************************/
  715. /* Macro for creating the first parameter for the GetFmiReturnCode call when */
  716. /* using the error code and qualifier off a FMI status message.              */
  717. /*****************************************************************************/
  718. #define FMISTAT_TO_INT(code, qual)  ((INTEGER) (((code >> 8) << 8) | (qual >> 8)))
  719.  
  720. #ifdef WIN32_SUPPORT
  721.   #pragma pack()
  722. #endif
  723.  
  724. #ifdef __cplusplus
  725. }
  726. #endif
  727.  
  728. #endif
  729. /* End of file fmi.h */
  730.  
  731.