home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / winappc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  105.3 KB  |  1,927 lines

  1. /* Copyright Data Connection Ltd. 1989 */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*****************************************************************************/
  5. /* winappc.h                                                                 */
  6. /* Copyright (c) 1989, Microsoft Corporation.  All rights reserved.          */
  7.  
  8. /*****************************************************************************/
  9. /* APPC constant, vcb and function definitions                               */
  10. /*****************************************************************************/
  11.  
  12. /*****************************************************************************/
  13. /* Change History                                                            */
  14. /*  CPIC  07/05/91  GH  Add get_conv_state verb, and support for fully       */
  15. /*                      qualified network names in the (mc)allocate VCBs     */
  16. /*  CPIC  03/06/91  GH  Changed FQname support. Name now '.' separated.      */
  17. /*  CPIC  14/06/91  GH  Added constants for the conv_state parameter         */
  18. /*  SCSN  08/08/91  GH  Fixed the AP_SEND_DATA_CONFIRM_SYNC_NONE defn.       */
  19. /*  CPIC  22/08/91  GH  Removed the FQ-flag in (mc)allocate VCBs             */
  20. /*  9997  23/10/91  AD  Change TP_ENDED end_type field to EE friendly 'type' */
  21. /*  3054  13/11/91  SW  Add pascal entry point function prototype            */
  22. /*  xxxx  02/01/92  SW  Update what_rcvd values                              */
  23. /*  CNOS  17/01/92  PP  Add opcode for CNOS.  NS/2 allows management verbs   */
  24. /*                      to go through APPC entry point                       */
  25. /*  W32   24/02/92  AD  Win32 port                                           */
  26. /*  CPIC  24/02/92  AD  Move CPIC specific constants and types               */
  27. /*  W32   14/04/92  AD  remove far keyword for Win32, add pack pragma        */
  28. /*  DISP  14/04/92  TB  Add definition for DISPLAY opcode.                   */
  29. /*  DSP2  04/06/92  TB  Check to see if appc_c.h already included mgmt hdrs  */
  30. /*  ES10  03/11/92  SP  Add support for ES 1.0 APPC extensions               */
  31. /*  WSNA2 27/10/92  CD  Changes for WinSNA                                   */
  32. /*  DFLU  18/02/93  SP  Add rc for Bad Partner LU Alias                      */
  33. /*  IBM1  29/06/93  NGR Add #defines and typedefs from ES include files      */
  34. /*  EVNT  14/12/93  DK  Allow completion to be notified by setting an event  */
  35. /*  GRC   20/01/94  DK  Add definition of GetAppcReturnCode                  */
  36. /*  RPRP  24/10/95  JD  Implement TEST_RTS_AND_POST                          */
  37. /*  SYNC  25/03/96  SGF Syncpoint Support                                    */
  38. /*  APOR  02/12/96  DA  Implement POST_ON_RECEIPT                            */
  39. /*  SELD  02/01/97  DA  Send error log data on mapped conversations          */
  40. /*  RELD  02/01/97  DA  Recv error log data                                  */
  41. /*  5178  02/25/97  SGF Single signon for priviledged proxy                  */
  42. /*  7239  03/05/97  SGF Make single signon strings UNICODE                   */
  43. /*  ACTS  05/01/96  RW  ACTIVATE_SESSION & DEACTIVATE_SESSION support        */
  44. /*  2PC   09/27/98  DP  Add ENLIST verb, return codes for 2-phase commit     */
  45. /*  3669  02/18/99  RW  Support Attach Manager for IBM DB2                   */
  46. /*  IOCP  14/05/99  PH  Add IOCP support.                                    */
  47. /*****************************************************************************/
  48.  
  49. /*****************************************************************************/
  50. /* If winappc.h not already included then define APPC_C_INCLUDED to avoid it */
  51. /* being included again. This is needed as winappc.h is included in the      */
  52. /* management header acsmgtc.h.  *DSP2*                                      */
  53. /*****************************************************************************/
  54. #ifndef APPC_C_INCLUDED
  55. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  56. #define APPC_C_INCLUDED
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61.  
  62. /*****************************************************************************/
  63. /* Set WINSNA if this is Win16 or Win32                                *WSNA2*/
  64. /*****************************************************************************/
  65. #if ( defined(WINDOWS) || defined(WIN32) )
  66.  #define WINSNA
  67. #endif
  68.  
  69.  
  70.  
  71.  
  72. /* ========================================================================= */
  73. /*****************************************************************************/
  74. /* ------------------------- macro definitions ----------------------------- */
  75. /*****************************************************************************/
  76.  
  77. /*************************************************************************W32*/
  78. /* for Win32 environment:                                                *W32*/
  79. /* -  ensure correct packing                                             *W32*/
  80. /* -  remove references to far                                           *W32*/
  81. /*************************************************************************W32*/
  82. #ifdef WIN32                                                            /*W32*/
  83.                                                                         /*W32*/
  84. #pragma pack(4)                                                         /*W32*/
  85. #define far                                                             /*W32*/
  86.                                                                         /*W32*/
  87. #endif                                                                  /*W32*/
  88.  
  89. /*************************************************************************W32*/
  90. /* define type conversion macros                                         *W32*/
  91. /*************************************************************************W32*/
  92. #define APPC_LO_UC(w)    ((unsigned char)(((unsigned short)(w)) & 0xFF))/*W32*/
  93. #define APPC_HI_UC(w)    ((unsigned char)(((unsigned short)(w) >> 8)  \
  94.                             & 0xff))                                    /*W32*/
  95. #define APPC_MAKUS(l, h) (((unsigned short)(l)) |                     \
  96.                           ((unsigned short)(h)) << 8)                   /*W32*/
  97. #define APPC_MAKUL(l, h) ((unsigned long)(((unsigned short)(l))|      \
  98.                           ((unsigned long)((unsigned short)(h))) << 16))/*W32*/
  99. #define APPC_LO_US(l)   ((unsigned short)(((unsigned long)(l)) & 0xFFFF))/*W32*/
  100. #define APPC_HI_US(l)    ((unsigned short)(((unsigned long)(l) >> 16) \
  101.                            & 0xffff))                                   /*W32*/
  102.                                                                         /*W32*/
  103. /*************************************************************************W32*/
  104. /* IF non-Intel THEN                                                     *W32*/
  105. /*   set flipping to nop for now                                         *W32*/
  106. /*************************************************************************W32*/
  107. #ifdef NON_INTEL_BYTE_ORDER                                             /*W32*/
  108. #define APPC_FLIPI(X)  (X)                                              /*W32*/
  109. #define APPC_FLIPL(X)  (X)                                              /*W32*/
  110.                                                                         /*W32*/
  111. /*************************************************************************W32*/
  112. /* ELSE (Intel environment)                                              *W32*/
  113. /*   define flipping macros                                              *W32*/
  114. /*************************************************************************W32*/
  115. #else                                                                   /*W32*/
  116. #define APPC_FLIPI(X) APPC_MAKUS(APPC_HI_UC(X),APPC_LO_UC(X))           /*W32*/
  117. #define APPC_FLIPL(X) APPC_MAKUL(APPC_FLIPI(APPC_HI_US(X)),           \
  118.                                  APPC_FLIPI(APPC_LO_US(X)))             /*W32*/
  119. #endif                                                                  /*W32*/
  120.  
  121. #ifdef WIN32
  122. #define far
  123. #endif
  124.  
  125. /* ========================================================================= */
  126. /*****************************************************************************/
  127. /* ------------------------- verb opcodes ---------------------------------- */
  128. /*****************************************************************************/
  129.  
  130. /*****************************************************************************/
  131. /* control verbs                                                             */
  132. /*****************************************************************************/
  133. #define AP_TP_STARTED                   APPC_FLIPI(0x1400)        /* X'1400' */
  134. #define AP_RECEIVE_ALLOCATE             APPC_FLIPI(0x1600)        /* X'1600' */
  135. #define AP_TP_ENDED                     APPC_FLIPI(0x1300)        /* X'1300' */
  136.  
  137.  
  138. /*****************************************************************************/
  139. /* ACTS: activate/deactivate session verbs                                   */
  140. /*****************************************************************************/
  141. #define  AP_DEACTIVATE_SESSION          APPC_FLIPI(0x2E00)
  142. #define  AP_ACTIVATE_SESSION            APPC_FLIPI(0x1410)
  143.  
  144. /*****************************************************************************/
  145. /* New opcode for RCV_ALLOC with a list of TP names                    *WSNA5*/
  146. /*                                                                           */
  147. /* Though defined for all OS, this verb will only be allowed for WINSNA      */
  148. /* environments                                                              */
  149. /*****************************************************************************/
  150. #define AP_RECEIVE_ALLOCATE_X           APPC_FLIPI(0x9600) /*X'1600'+ X'8000'*/
  151. #define AP_RECEIVE_ALLOCATE_EX          APPC_FLIPI(0xF103)        /* X'F103' */
  152. #define AP_RECEIVE_ALLOCATE_EX_END      APPC_FLIPI(0xF104)        /* X'F104' */
  153.  
  154. /*****************************************************************************/
  155. /* management verbs                                                *DISP*CNOS*/
  156. /*****************************************************************************/
  157. #define AP_CNOS                         APPC_FLIPI(0x1500)        /* X'1500' */
  158. #define AP_DISPLAY                      APPC_FLIPI(0X1B00)        /* X'1B00' */
  159.  
  160. /*****************************************************************************/
  161. /* mapped conversation verbs                                                 */
  162. /*****************************************************************************/
  163. #define AP_M_ALLOCATE                   APPC_FLIPI(0x0100)        /* X'0100' */
  164. #define AP_M_CONFIRM                    APPC_FLIPI(0x0300)        /* X'0300' */
  165. #define AP_M_CONFIRMED                  APPC_FLIPI(0x0400)        /* X'0400' */
  166. #define AP_M_DEALLOCATE                 APPC_FLIPI(0x0500)        /* X'0500' */
  167. #define AP_M_FLUSH                      APPC_FLIPI(0x0600)        /* X'0600' */
  168. #define AP_M_GET_ATTRIBUTES             APPC_FLIPI(0x0700)        /* X'0700' */
  169. #define AP_M_PREPARE_TO_RECEIVE         APPC_FLIPI(0x0a00)        /* X'0a00' */
  170. #define AP_M_RECEIVE_AND_POST           APPC_FLIPI(0x0d00)        /* X'0d00' */
  171. #define AP_M_RECEIVE_AND_WAIT           APPC_FLIPI(0x0b00)        /* X'0b00' */
  172. #define AP_M_RECEIVE_IMMEDIATE          APPC_FLIPI(0x0c00)        /* X'0c00' */
  173. #define AP_M_REQUEST_TO_SEND            APPC_FLIPI(0x0e00)        /* X'0e00' */
  174. #define AP_M_SEND_CONVERSATION          APPC_FLIPI(0x1800) //ES10 /* X'1800' */
  175. #define AP_M_SEND_DATA                  APPC_FLIPI(0x0f00)        /* X'0f00' */
  176. #define AP_M_SEND_ERROR                 APPC_FLIPI(0x1000)        /* X'1000' */
  177. #define AP_M_TEST_RTS                   APPC_FLIPI(0x1200)        /* X'1200' */
  178. #define AP_M_TEST_RTS_AND_POST          APPC_FLIPI(0x8100)        /* X'8100' */ /*RPRP*/
  179. #ifdef WIN32                                                                    /*APOR*/
  180. #define AP_M_POST_ON_RECEIPT            APPC_FLIPI(0x8200)        /* X'8200' */ /*APOR*/
  181. #endif                                                                          /*APOR*/
  182. #define AP_M_RECEIVE_LOG_DATA           APPC_FLIPI(0x8300)        /* X'8300' */ /*RELD*/
  183.  
  184. /*****************************************************************************/
  185. /* basic conversation verbs                                                  */
  186. /*****************************************************************************/
  187. #define AP_B_ALLOCATE                   APPC_FLIPI(0x0100)        /* X'0100' */
  188. #define AP_B_CONFIRM                    APPC_FLIPI(0x0300)        /* X'0300' */
  189. #define AP_B_CONFIRMED                  APPC_FLIPI(0x0400)        /* X'0400' */
  190. #define AP_B_DEALLOCATE                 APPC_FLIPI(0x0500)        /* X'0500' */
  191. #define AP_B_FLUSH                      APPC_FLIPI(0x0600)        /* X'0600' */
  192. #define AP_B_GET_ATTRIBUTES             APPC_FLIPI(0x0700)        /* X'0700' */
  193. #define AP_B_PREPARE_TO_RECEIVE         APPC_FLIPI(0x0a00)        /* X'0a00' */
  194. #define AP_B_RECEIVE_AND_POST           APPC_FLIPI(0x0d00)        /* X'0d00' */
  195. #define AP_B_RECEIVE_AND_WAIT           APPC_FLIPI(0x0b00)        /* X'0b00' */
  196. #define AP_B_RECEIVE_IMMEDIATE          APPC_FLIPI(0x0c00)        /* X'0c00' */
  197. #define AP_B_REQUEST_TO_SEND            APPC_FLIPI(0x0e00)        /* X'0e00' */
  198. #define AP_B_SEND_CONVERSATION          APPC_FLIPI(0x1800) //ES10 /* X'1800' */
  199. #define AP_B_SEND_DATA                  APPC_FLIPI(0x0f00)        /* X'0f00' */
  200. #define AP_B_SEND_ERROR                 APPC_FLIPI(0x1000)        /* X'1000' */
  201. #define AP_B_TEST_RTS                   APPC_FLIPI(0x1200)        /* X'1200' */
  202. #define AP_B_TEST_RTS_AND_POST          APPC_FLIPI(0x8100)        /* X'8100' */ /*RPRP*/
  203. #ifdef WIN32                                                                    /*APOR*/
  204. #define AP_B_POST_ON_RECEIPT            APPC_FLIPI(0x8200)        /* X'8200' */ /*APOR*/
  205. #endif                                                                          /*APOR*/
  206. #define AP_B_RECEIVE_LOG_DATA           APPC_FLIPI(0x8300)        /* X'8300' */ /*RELD*/
  207.  
  208. /*****************************************************************************/
  209. /* type independent verbs                                                    */
  210. /*****************************************************************************/
  211. #define AP_GET_TP_PROPERTIES            APPC_FLIPI(0x1700) //ES10 /* X'1700' */
  212. #define AP_GET_TYPE                     APPC_FLIPI(0x0800)        /* X'0800' */
  213. #define AP_GET_STATE                    APPC_FLIPI(0x0900)        /* X'0900' */
  214. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  215. #define AP_ENLIST                       APPC_FLIPI(0x7d00)  /* X'7d00'  *2PC*/
  216. #define AP_SET_TP_PROPERTIES            APPC_FLIPI(0x7e00)  /* X'7e00'  *SYNC*/
  217. #define AP_GET_LU_STATUS                APPC_FLIPI(0x7f00)  /* X'7f00'  *SYNC*/
  218. #endif                                                                 /*SYNC*/
  219.  
  220. /* ========================================================================= */
  221. /*****************************************************************************/
  222. /* ------------------- primary and secondary return codes ------------------ */
  223. /*****************************************************************************/
  224. #define AP_OK                           APPC_FLIPI(0x0000)      /* X'0000'   */
  225.  
  226. #define AP_PARAMETER_CHECK              APPC_FLIPI(0x0001)      /* X'0001'   */
  227.   #define AP_BAD_TP_ID                   APPC_FLIPL(0x00000001) /*X'00000001'*/
  228.   #define AP_BAD_CONV_ID                 APPC_FLIPL(0x00000002) /*X'00000002'*/
  229.   #define AP_BAD_LU_ALIAS                APPC_FLIPL(0x00000003) /*X'00000003'*/
  230.   #define AP_INVALID_DATA_SEGMENT        APPC_FLIPL(0x00000006) /*X'00000006'*/
  231.   #define AP_BAD_CONV_TYPE               APPC_FLIPL(0x00000011) /*X'00000011'*/
  232.   #define AP_BAD_SYNC_LEVEL              APPC_FLIPL(0x00000012) /*X'00000012'*/
  233.   #define AP_BAD_SECURITY                APPC_FLIPL(0x00000013) /*X'00000013'*/
  234.   #define AP_BAD_RETURN_CONTROL          APPC_FLIPL(0x00000014) /*X'00000014'*/
  235.   #define AP_PIP_LEN_INCORRECT           APPC_FLIPL(0x00000016) /*X'00000016'*/
  236.   #define AP_NO_USE_OF_SNASVCMG          APPC_FLIPL(0x00000017) /*X'00000017'*/
  237.   #define AP_UNKNOWN_PARTNER_MODE        APPC_FLIPL(0x00000018) /*X'00000018'*/
  238.   #define AP_CONFIRM_ON_SYNC_LEVEL_NONE  APPC_FLIPL(0x00000031) /*X'00000031'*/
  239.   #define AP_DEALLOC_BAD_TYPE            APPC_FLIPL(0x00000051) /*X'00000051'*/
  240.   #define AP_DEALLOC_LOG_LL_WRONG        APPC_FLIPL(0x00000057) /*X'00000057'*/
  241.   #define AP_P_TO_R_INVALID_TYPE         APPC_FLIPL(0x000000a1) /*X'000000a1'*/
  242.   #define AP_RCV_AND_WAIT_BAD_FILL       APPC_FLIPL(0x000000b5) /*X'000000b5'*/
  243.   #define AP_RCV_IMMD_BAD_FILL           APPC_FLIPL(0x000000c4) /*X'000000c4'*/
  244.   #define AP_RCV_AND_POST_BAD_FILL       APPC_FLIPL(0x000000d5) /*X'000000d5'*/
  245.   #define AP_INVALID_SEMAPHORE_HANDLE    APPC_FLIPL(0x000000d6) /*X'000000d6'*/
  246.   #define AP_BAD_RETURN_STATUS_WITH_DATA APPC_FLIPL(0x000000d7) /*X'000000d7'*/
  247.   #define AP_BAD_LL                      APPC_FLIPL(0x000000f1) /*X'000000f1'*/
  248.   #define AP_SEND_DATA_INVALID_TYPE      APPC_FLIPL(0x000000f4) /*X'000000f4'*/
  249.   #define AP_INVALID_SESSION_ID          APPC_FLIPL(0x00000512) /*X'00000512'*/
  250.                                                                        /*ES10*/
  251.   #define AP_INVALID_POLARITY            APPC_FLIPL(0x00000513) /*X'00000513'*/
  252.   #define AP_INVALID_TYPE                APPC_FLIPL(0x00000514) /*X'00000514'*/
  253.   #define AP_INVALID_LU_ALIAS            APPC_FLIPL(0x00000515) /*X'00000515'*/
  254.   #define AP_INVALID_PLU_ALIAS           APPC_FLIPL(0x00000516) /*X'00000516'*/
  255.   #define AP_INVALID_MODE_NAME           APPC_FLIPL(0x00000517) /*X'00000517'*/
  256.                                                                         /*2PC*/
  257.   #define AP_INVALID_TRANSACT_ID         APPC_FLIPL(0x00000518) /*X'00000518'*/
  258.  
  259.  
  260.  
  261. /*#define AP_SEND_DATA_CONFIRM_ON_SYNC_LEVEL_NONE 0xf5000000*/ /*X'000000f5' */
  262.   #define AP_SEND_DATA_CONFIRM_SYNC_NONE APPC_FLIPL(0x000000f5) /*X'000000f5'*/
  263.                                                                        /*SCSN*/
  264.   #define AP_BAD_PARTNER_LU_ALIAS        APPC_FLIPL(0x0000015b) /*X'0000015b'*/
  265.                                                                        /*DFLU*/
  266.  
  267.   #define AP_SEND_ERROR_LOG_LL_WRONG     APPC_FLIPL(0x00000102) /*X'00000102'*/
  268.   #define AP_SEND_ERROR_BAD_TYPE         APPC_FLIPL(0x00000103) /*X'00000103'*/
  269.   #define AP_BAD_ERROR_DIRECTION         APPC_FLIPL(0x00000105) /*X'00000105'*/
  270.   #define AP_TOO_MANY_TPS                APPC_FLIPL(0x00000243) /*X'00000243'*/
  271.   #define AP_BAD_TYPE                    APPC_FLIPL(0x00000250) /*X'00000250'*/
  272.   #define AP_UNDEFINED_TP_NAME           APPC_FLIPL(0x00000506) /*X'00000506'*/
  273.   #define AP_INVALID_SET_PROT            APPC_FLIPL(0x00000700) /*X'00000700'SYNC*/
  274.   #define AP_INVALID_NEW_PROT            APPC_FLIPL(0x00000701) /*X'00000701'SYNC*/
  275.   #define AP_INVALID_SET_UNPROT          APPC_FLIPL(0x00000702) /*X'00000702'SYNC*/
  276.   #define AP_INVALID_NEW_UNPROT          APPC_FLIPL(0x00000703) /*X'00000703'SYNC*/
  277.   #define AP_INVALID_SET_USER            APPC_FLIPL(0x00000704) /*X'00000704'SYNC*/
  278.   #define AP_INVALID_DATA_TYPE           APPC_FLIPL(0x00000705) /*X'00000705'SYNC*/
  279.   #define AP_BAD_LOCAL_LU_ALIAS          APPC_FLIPL(0x01000003) /*X'01000003'SYNC*/
  280.   #define AP_BAD_REMOTE_LU_ALIAS         APPC_FLIPL(0x02000003) /*X'02000003'SYNC*/
  281. #ifdef WIN32                                                               /*APOR*/
  282.   #define AP_POST_ON_RECEIPT_BAD_FILL    APPC_FLIPL(0x03000003) /*X'03000003'APOR*/
  283. #endif                                                                     /*APOR*/
  284. #define AP_STATE_CHECK                  APPC_FLIPI(0x0002)      /* X'0002'   */
  285.   #define AP_CONFIRM_BAD_STATE           APPC_FLIPL(0x00000032) /*X'00000032'*/
  286.   #define AP_CONFIRM_NOT_LL_BDY          APPC_FLIPL(0x00000033) /*X'00000033'*/
  287.   #define AP_CONFIRMED_BAD_STATE         APPC_FLIPL(0x00000041) /*X'00000041'*/
  288.   #define AP_DEALLOC_FLUSH_BAD_STATE     APPC_FLIPL(0x00000052) /*X'00000052'*/
  289.   #define AP_DEALLOC_CONFIRM_BAD_STATE   APPC_FLIPL(0x00000053) /*X'00000053'*/
  290.   #define AP_DEALLOC_NOT_LL_BDY          APPC_FLIPL(0x00000055) /*X'00000055'*/
  291.   #define AP_FLUSH_NOT_SEND_STATE        APPC_FLIPL(0x00000061) /*X'00000061'*/
  292.   #define AP_P_TO_R_NOT_LL_BDY           APPC_FLIPL(0x000000a2) /*X'000000a2'*/
  293.   #define AP_P_TO_R_NOT_SEND_STATE       APPC_FLIPL(0x000000a3) /*X'000000a3'*/
  294.   #define AP_RCV_AND_WAIT_BAD_STATE      APPC_FLIPL(0x000000b1) /*X'000000b1'*/
  295.   #define AP_RCV_AND_WAIT_NOT_LL_BDY     APPC_FLIPL(0x000000b2) /*X'000000b2'*/
  296.   #define AP_RCV_IMMD_BAD_STATE          APPC_FLIPL(0x000000c1) /*X'000000c1'*/
  297.   #define AP_RCV_AND_POST_BAD_STATE      APPC_FLIPL(0x000000d1) /*X'000000d1'*/
  298.   #define AP_RCV_AND_POST_NOT_LL_BDY     APPC_FLIPL(0x000000d2) /*X'000000d2'*/
  299.   #define AP_R_T_S_BAD_STATE             APPC_FLIPL(0x000000e1) /*X'000000e1'*/
  300.   #define AP_SEND_DATA_NOT_SEND_STATE    APPC_FLIPL(0x000000f2) /*X'000000f2'*/
  301.   #define AP_SEND_DATA_NOT_LL_BDY        APPC_FLIPL(0x000000f6) /*X'000000f6'*/
  302.   #define AP_ATTACH_MANAGER_INACTIVE     APPC_FLIPL(0x00000508) /*X'00000508'*/
  303.   #define AP_ALLOCATE_NOT_PENDING        APPC_FLIPL(0x00000509) /*X'00000509'*/
  304.   #define AP_LU_ALREADY_REGISTERED       APPC_FLIPL(0x0000050A) /*X'0000050A'*/
  305.   #define AP_INVALID_PROCESS             APPC_FLIPL(0x00000525) /*X'00000525'*/
  306.  
  307. #define AP_ALLOCATION_ERROR             APPC_FLIPI(0x0003)      /* X'0003'   */
  308.   #define AP_ALLOCATION_FAILURE_NO_RETRY APPC_FLIPL(0x00000004) /*X'00000004'*/
  309.   #define AP_ALLOCATION_FAILURE_RETRY    APPC_FLIPL(0x00000005) /*X'00000005'*/
  310.   #define AP_SECURITY_NOT_VALID          APPC_FLIPL(0x080f6051) /*X'080f6051'*/
  311.   #define AP_TRANS_PGM_NOT_AVAIL_RETRY   APPC_FLIPL(0x084b6031) /*X'084b6031 */
  312.   #define AP_TRANS_PGM_NOT_AVAIL_NO_RETRY APPC_FLIPL(0x084c0000) /*X'084c0000*/
  313.   #define AP_TP_NAME_NOT_RECOGNIZED      APPC_FLIPL(0x10086021) /*X'10086021'*/
  314.   #define AP_PIP_NOT_ALLOWED             APPC_FLIPL(0x10086031) /*X'10086031'*/
  315.   #define AP_PIP_NOT_SPECIFIED_CORRECTLY APPC_FLIPL(0x10086032) /*X'10086032'*/
  316.   #define AP_CONVERSATION_TYPE_MISMATCH  APPC_FLIPL(0x10086034) /*X'10086034'*/
  317.   #define AP_SYNC_LEVEL_NOT_SUPPORTED    APPC_FLIPL(0x10086041) /*X'10086041'*/
  318.  
  319.   #define AP_SECURITY_NOT_VALID_PASSWORD_EXPIRED                      APPC_FLIPL(0x080fff00)
  320.   #define AP_SECURITY_NOT_VALID_PASSWORD_INVALID                      APPC_FLIPL(0x080fff01)
  321.   #define AP_SECURITY_NOT_VALID_USERID_REVOKED                        APPC_FLIPL(0x080fff02)
  322.   #define AP_SECURITY_NOT_VALID_USERID_INVALID                        APPC_FLIPL(0x080fff03)
  323.   #define AP_SECURITY_NOT_VALID_USERID_MISSING                        APPC_FLIPL(0x080fff04)
  324.   #define AP_SECURITY_NOT_VALID_PASSWORD_MISSING                      APPC_FLIPL(0x080fff05)
  325.   #define AP_SECURITY_NOT_VALID_GROUP_INVALID                         APPC_FLIPL(0x080fff06)
  326.   #define AP_SECURITY_NOT_VALID_USERID_REVOKED_IN_GROUP               APPC_FLIPL(0x080fff07)
  327.   #define AP_SECURITY_NOT_VALID_USERID_NOT_DEFD_TO_GROUP              APPC_FLIPL(0x080fff08)
  328.   #define AP_SECURITY_NOT_VALID_NOT_AUTHORIZED_AT_REMOTE_LU           APPC_FLIPL(0x080fff09)
  329.   #define AP_SECURITY_NOT_VALID_NOT_AUTHORIZED_FROM_LOCAL_LU          APPC_FLIPL(0x080fff0a)
  330.   #define AP_SECURITY_NOT_VALID_NOT_AUTHORIZED_TO_TRANSACTION_PROGRAM APPC_FLIPL(0x080fff0b)
  331.   #define AP_SECURITY_NOT_VALID_INSTALLATION_EXIT_FAILED              APPC_FLIPL(0x080fff0c)
  332.   #define AP_SECURITY_NOT_VALID_PROCESSING_FAILURE                    APPC_FLIPL(0x080fff0d)
  333.   #define AP_SECURITY_NOT_VALID_PROTOCOL_VIOLATION                    APPC_FLIPL(0x080fff0e)
  334.  
  335. #define AP_DEALLOC_ABEND                APPC_FLIPI(0x0005)      /* X'0005'   */
  336. #define AP_DEALLOC_ABEND_PROG           APPC_FLIPI(0x0006)      /* X'0006'   */
  337. #define AP_DEALLOC_ABEND_SVC            APPC_FLIPI(0x0007)      /* X'0007'   */
  338. #define AP_DEALLOC_ABEND_TIMER          APPC_FLIPI(0x0008)      /* X'0008'   */
  339. #define AP_DEALLOC_NORMAL               APPC_FLIPI(0x0009)      /* X'0009'   */
  340. #define AP_PROG_ERROR_NO_TRUNC          APPC_FLIPI(0x000c)      /* X'000c'   */
  341. #define AP_PROG_ERROR_TRUNC             APPC_FLIPI(0x000d)      /* X'000d'   */
  342. #define AP_PROG_ERROR_PURGING           APPC_FLIPI(0x000e)      /* X'000e'   */
  343. #define AP_CONV_FAILURE_RETRY           APPC_FLIPI(0x000f)      /* X'000f'   */
  344. #define AP_CONV_FAILURE_NO_RETRY        APPC_FLIPI(0x0010)      /* X'0010'   */
  345. #define AP_SVC_ERROR_NO_TRUNC           APPC_FLIPI(0x0011)      /* X'0011'   */
  346. #define AP_SVC_ERROR_TRUNC              APPC_FLIPI(0x0012)      /* X'0012'   */
  347. #define AP_SVC_ERROR_PURGING            APPC_FLIPI(0x0013)      /* X'0013'   */
  348. #define AP_UNSUCCESSFUL                 APPC_FLIPI(0x0014)      /* X'0014'   */
  349. #define AP_CONVERSATION_TYPE_MIXED      APPC_FLIPI(0x0019)      /* X'0019'   */
  350. #define AP_CANCELLED                    APPC_FLIPI(0x0021)      /* X'0021'   */
  351. #define AP_SECURITY_REQUESTED_NOT_SUPPORTED  APPC_FLIPI(0x0022) /* X'0022'   */
  352. #define AP_TP_BUSY                      APPC_FLIPI(0xf002)      /* X'f002'   */
  353.  
  354. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  355. #define AP_BACKED_OUT                   APPC_FLIPI(0x0023)  /* X'0022'  *SYNC*/
  356.   #define AP_BO_NO_RESYNC            APPC_FLIPL(0x08240000) /*X'08240000'SYNC*/
  357.   #define AP_BO_RESYNC               APPC_FLIPL(0x08240001) /*X'08240001'SYNC*/
  358. #endif                                                                 /*SYNC*/
  359.  
  360. #define  AP_ACTIVATION_FAIL_RETRY       APPC_FLIPI(0x0310)
  361. #define  AP_ACTIVATION_FAIL_NO_RETRY    APPC_FLIPI(0x0311)
  362. #define  AP_SESSION_LIMITS_CLOSED       APPC_FLIPI(0x0312)
  363. #define  AP_SESSION_LIMITS_EXCEEDED     APPC_FLIPI(0x0313)
  364. #define  AP_VERB_IN_PROGRESS            APPC_FLIPI(0x0314)
  365. #define  AP_SESSION_DEACTIVATED         APPC_FLIPI(0x0315)
  366.  
  367. #define AP_COMM_SUBSYSTEM_ABENDED       APPC_FLIPI(0xf003)      /* X'f003'   */
  368. #define AP_COMM_SUBSYSTEM_NOT_LOADED    APPC_FLIPI(0xf004)      /* X'f004'   */
  369. #define AP_CONV_BUSY                    APPC_FLIPI(0xf005)      /* X'f005'   */
  370. #define AP_THREAD_BLOCKING              APPC_FLIPI(0xf006)      /* X'f006'   */
  371. #define AP_INVALID_VERB_SEGMENT         APPC_FLIPI(0xf008)      /* X'f008'   */
  372. #define AP_CANT_ENLIST_TX               APPC_FLIPI(0xf009)      /* X'f009'2PC*/
  373. #define AP_CANT_CONTACT_DTC             APPC_FLIPI(0xf00A)      /* X'f00A'2PC*/
  374. #define AP_UNEXPECTED_DOS_ERROR         APPC_FLIPI(0xf011)      /* X'f011'   */
  375. #define AP_STACK_TOO_SMALL              APPC_FLIPI(0xf015)      /* X'f015'   */
  376. #define AP_INVALID_VERB                 APPC_FLIPI(0xffff)      /* X'ffff'   */
  377.  
  378. /* ========================================================================= */
  379. /*****************************************************************************/
  380. /* ---------------------------- parameters --------------------------------- */
  381. /*****************************************************************************/
  382.  
  383. /*****************************************************************************/
  384. /* opext and conv_type                                                       */
  385. /*****************************************************************************/
  386. #define AP_BASIC_CONVERSATION             0x00
  387. #define AP_BASIC                          0x00                         /*IBM1*/
  388. #define AP_MAPPED_CONVERSATION            0x01
  389. #define AP_MAPPED                         0x01                         /*IBM1*/
  390.  
  391. /*****************************************************************************/
  392. /* rts_rcvd and return_status_with_data                                      */
  393. /*****************************************************************************/
  394. #define AP_NO                             0x00
  395. #define AP_YES                            0x01
  396.  
  397. /****************************************************************************/
  398. /* sync_level, security and send_type                                        */
  399. /*****************************************************************************/
  400. #define AP_NONE                           0x00
  401.  
  402. /*****************************************************************************/
  403. /* sync_level                                                                */
  404. /*****************************************************************************/
  405. #define AP_CONFIRM_SYNC_LEVEL             0x01
  406. #define AP_CONFIRM                        0x01                         /*IBM1*/
  407. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  408. #define AP_SYNCPT                         0x02                         /*SYNC*/
  409. #endif                                                                 /*SYNC*/
  410.  
  411. /*****************************************************************************/
  412. /* security                                                                  */
  413. /*****************************************************************************/
  414. #define AP_SAME                           0x01
  415. #define AP_PGM                            0x02
  416. #define AP_STRONG                         0x03
  417. #define AP_PROXY                          0x80                         /*5178*/
  418. #define AP_PROXY_SAME                     0x81                         /*5178*/
  419. #define AP_PROXY_PGM                      0x82                         /*5178*/
  420. #define AP_PROXY_STRONG                   0x83                         /*5178*/
  421.  
  422. /*****************************************************************************/
  423. /* dealloc_type and ptr_type                                                 */
  424. /*****************************************************************************/
  425. #define AP_SYNC_LEVEL                     0x00
  426.  
  427. /*****************************************************************************/
  428. /* dealloc_type and ptr_type                                                 */
  429. /*****************************************************************************/
  430. #define AP_FLUSH                          0x01
  431. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  432. #define AP_CONFIRM_TYPE                   0x0B                         /*SYNC*/
  433. #endif                                                                 /*SYNC*/
  434.  
  435. /*****************************************************************************/
  436. /* dealloc_type                                                              */
  437. /*****************************************************************************/
  438. #define AP_ABEND_PROG                     0x02
  439. #define AP_ABEND_SVC                      0x03
  440. #define AP_ABEND_TIMER                    0x04
  441. #define AP_ABEND                          0x05
  442. #ifdef SYNCPT_SUPPORT                                                  
  443. #define AP_TP_NOT_AVAIL_RETRY                                               0x06                         
  444. #define AP_TP_NOT_AVAIL_NO_RETRY                                            0x07                         
  445. #define AP_TPN_NOT_RECOGNIZED                                               0x08                         
  446. #define AP_PIP_DATA_NOT_ALLOWED                                             0x09                         
  447. #define AP_PIP_DATA_INCORRECT                                               0x0A                         
  448. #define AP_RESOURCE_FAILURE_NO_RETRY                                        0x0C                         
  449. #define AP_CONV_TYPE_MISMATCH                                               0x0D                         
  450. #define AP_SYNC_LVL_NOT_SUPPORTED                                           0x0E                         
  451. #define AP_SECURITY_PARAMS_INVALID                                          0x0F                         
  452. #define AP_DEALLOC_SECURITY_NOT_VALID_PASSWORD_EXPIRED                      0x10
  453. #define AP_DEALLOC_SECURITY_NOT_VALID_PASSWORD_INVALID                      0x11
  454. #define AP_DEALLOC_SECURITY_NOT_VALID_USERID_REVOKED                        0x12
  455. #define AP_DEALLOC_SECURITY_NOT_VALID_USERID_INVALID                        0x13
  456. #define AP_DEALLOC_SECURITY_NOT_VALID_USERID_MISSING                        0x14
  457. #define AP_DEALLOC_SECURITY_NOT_VALID_PASSWORD_MISSING                      0x15
  458. #define AP_DEALLOC_SECURITY_NOT_VALID_GROUP_INVALID                         0x16
  459. #define AP_DEALLOC_SECURITY_NOT_VALID_USERID_REVOKED_IN_GROUP               0x17
  460. #define AP_DEALLOC_SECURITY_NOT_VALID_USERID_NOT_DEFD_TO_GROUP              0x18
  461. #define AP_DEALLOC_SECURITY_NOT_VALID_NOT_AUTHORIZED_AT_REMOTE_LU           0x19
  462. #define AP_DEALLOC_SECURITY_NOT_VALID_NOT_AUTHORIZED_FROM_LOCAL_LU          0x1A
  463. #define AP_DEALLOC_SECURITY_NOT_VALID_NOT_AUTHORIZED_TO_TRANSACTION_PROGRAM 0x1B
  464. #define AP_DEALLOC_SECURITY_NOT_VALID_INSTALLATION_EXIT_FAILED              0x1C
  465. #define AP_DEALLOC_SECURITY_NOT_VALID_PROCESSING_FAILURE                    0x1D
  466. #define AP_DEALLOC_SECURITY_NOT_VALID_PROTOCOL_VIOLATION                    0x1E
  467. #endif                                                                 
  468.  
  469. /*****************************************************************************/
  470. /* locks                                                                     */
  471. /*****************************************************************************/
  472. #define AP_SHORT                          0x00
  473. #define AP_LONG                           0x01
  474.  
  475. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  476. /************************************************************************SYNC*/
  477. /* data_type                                                            *SYNC*/
  478. /************************************************************************SYNC*/
  479. #define AP_APPLICATION                    0x00                         /*SYNC*/
  480. #define AP_USER_CONTROL_DATA              0x01                         /*SYNC*/
  481. #define AP_PS_HEADER                      0x02                         /*SYNC*/
  482. #endif                                                                 /*SYNC*/
  483.  
  484. /*****************************************************************************/
  485. /* what_rcvd                                                                 */
  486. /*****************************************************************************/
  487. #define AP_DATA                          APPC_FLIPI(0x0001)     /* X'0001'   */
  488. #define AP_DATA_COMPLETE                 APPC_FLIPI(0x0002)     /* X'0002'   */
  489. #define AP_NOT_DATA                      APPC_FLIPI(0x0003)     /* X'0003'   */ /*APOR*/
  490. #define AP_DATA_INCOMPLETE               APPC_FLIPI(0x0004)     /* X'0004'   */
  491. #define AP_SEND                          APPC_FLIPI(0x0100)     /* X'0100'   */
  492. #define AP_CONFIRM_WHAT_RECEIVED         APPC_FLIPI(0x0200)     /* X'0200'   */
  493. #define AP_CONFIRM_SEND                  APPC_FLIPI(0x0300)     /* X'0300'   */
  494. #define AP_CONFIRM_DEALLOCATE            APPC_FLIPI(0x0400)     /* X'0400'   */
  495.  
  496. #define AP_DATA_COMPLETE_SEND            APPC_FLIPI(0x0102)     /* X'0102'   */
  497. #define AP_DATA_COMPLETE_CONFIRM         APPC_FLIPI(0x0202)     /* X'0202'   */
  498. #define AP_DATA_COMPLETE_CONFIRM_SEND    APPC_FLIPI(0x0302)     /* X'0302'   */
  499. #define AP_DATA_COMPLETE_CONFIRM_DEALL   APPC_FLIPI(0x0402)     /* X'0402'   */
  500.  
  501. #define AP_DATA_SEND                     APPC_FLIPI(0x0101)     /* X'0101'   */
  502. #define AP_DATA_CONFIRM                  APPC_FLIPI(0x0201)     /* X'0201'   */
  503. #define AP_DATA_CONFIRM_SEND             APPC_FLIPI(0x0301)     /* X'0301'   */
  504. #define AP_DATA_CONFIRM_DEALLOCATE       APPC_FLIPI(0x0401)     /* X'0401'   */
  505.  
  506. #ifdef SYNCPT_SUPPORT                                                  /*SYNC*/
  507. #define AP_USER_CONTROL_DATA_COMPLETE    APPC_FLIPI(0x0008) /* X'0008'  *SYNC*/
  508. #define AP_USER_CONTROL_DATA_INCOMPLETE  APPC_FLIPI(0x0010) /* X'0010'  *SYNC*/
  509. #define AP_PS_HEADER_COMPLETE            APPC_FLIPI(0x0020) /* X'0020'  *SYNC*/
  510. #define AP_PS_HEADER_INCOMPLETE          APPC_FLIPI(0x0040) /* X'0040'  *SYNC*/
  511. #endif                                                                 /*SYNC*/
  512.  
  513. /*****************************************************************************/
  514. /* fill                                                                      */
  515. /*****************************************************************************/
  516. #define AP_BUFFER                         0x00
  517. #define AP_LL                             0x01
  518.  
  519. /*****************************************************************************/
  520. /* rtn_ctl                                                                   */
  521. /*****************************************************************************/
  522. #define AP_WHEN_SESSION_ALLOCATED         0x00
  523. #define AP_IMMEDIATE                      0x01
  524. #define AP_WHEN_SESSION_FREE              0x02
  525. #define AP_WHEN_CONWINNER_ALLOCATED       0x03                        
  526. #define AP_WHEN_CONV_GROUP_ALLOCATED      0x04                        
  527.  
  528. /*****************************************************************************/
  529. /* err_type                                                                  */
  530. /*****************************************************************************/
  531. #define AP_PROG                           0x00
  532. #define AP_SVC                            0x01
  533. #ifdef SYNCPT_SUPPORT                                                 
  534. #define AP_BACKOUT_NO_RESYNC              0x02                        
  535. #define AP_BACKOUT_RESYNC                 0x03                        
  536. #endif                                                                
  537.  
  538. /*****************************************************************************/
  539. /* send_type                                                                 */
  540. /*****************************************************************************/
  541. #define AP_SEND_DATA_FLUSH                0x01
  542. #define AP_SEND_DATA_CONFIRM              0x02
  543. #define AP_SEND_DATA_P_TO_R_FLUSH         0x03
  544. #define AP_SEND_DATA_P_TO_R_SYNC_LEVEL    0x04
  545. #define AP_SEND_DATA_DEALLOC_FLUSH        0x05
  546. #define AP_SEND_DATA_DEALLOC_SYNC_LEVEL   0x06
  547. #define AP_SEND_DATA_DEALLOC_ABEND        0x07
  548. #ifdef SYNCPT_SUPPORT                                                 
  549. #define AP_SEND_DATA_P_TO_R_CONFIRM       0x08                        
  550. #define AP_SEND_DATA_DEALLOC_CONFIRM      0x09                        
  551. #endif                                                                
  552.  
  553. /*****************************************************************************/
  554. /* err_dir                                                                   */
  555. /*****************************************************************************/
  556. #define  AP_RCV_DIR_ERROR                 0x00
  557. #define  AP_SEND_DIR_ERROR                0x01
  558.  
  559. /*****************************************************************************/
  560. /* end_type                                                                  */
  561. /*****************************************************************************/
  562. #define AP_SOFT                           0x00
  563. #define AP_HARD                           0x01
  564.  
  565. /*****************************************************************************/
  566. /* conv_state                                                                */
  567. /*****************************************************************************/
  568. #define AP_RESET_STATE            1
  569. #define AP_SEND_STATE             2
  570. #define AP_RECEIVE_STATE          3
  571. #define AP_CONFIRM_STATE          4
  572. #define AP_CONFIRM_SEND_STATE     5
  573. #define AP_CONFIRM_DEALL_STATE    6
  574. #define AP_PEND_POST_STATE        7
  575. #define AP_PEND_DEALL_STATE       8
  576. #define AP_END_CONV_STATE         9
  577. #define AP_SEND_PENDING_STATE    10
  578.  
  579. #ifdef SYNCPT_SUPPORT                                                  
  580. /*****************************************************************************/
  581. /* values for type parameter on implied forget callback                      */
  582. /*****************************************************************************/
  583. #define AP_DATA_FLOW                      0x00                         
  584. #define AP_UNBIND                         0x01                         
  585. #define AP_FAILURE                        0x02                         
  586.                                                                        
  587. #endif                                                                 
  588.  
  589.  
  590. /*****************************************************************************/
  591. /* ACTS Values for Polarity on ACTIVATE_SESSION verb                         */
  592. /*****************************************************************************/
  593. #define  AP_POL_EITHER                    0x00
  594. #define  AP_POL_FIRST_SPEAKER             0x01
  595. #define  AP_POL_BIDDER                    0x02
  596.  
  597. /*****************************************************************************/
  598. /* ACTS Values for activation type on ACTIVATE_SESSION verb                  */
  599. /*****************************************************************************/
  600. #define  AP_ACT_ACTIVE                    0x00
  601. #define  AP_ACT_PASSIVE                   0x01
  602. #define  AP_DACT_ACTIVE                   0x02
  603. #define  AP_DACT_PASSIVE                  0x03
  604.  
  605. /*****************************************************************************/
  606. /* ACTS Values for deactivation type on DEACTIVATE_SESSION verb              */
  607. /*****************************************************************************/
  608. #define  AP_DEACT_CLEANUP                 0x02
  609. #define  AP_DEACT_NORMAL                  0x01
  610.  
  611. /*****************************************************************************/
  612. /* extension bit for the opext field                                         */
  613. /*****************************************************************************/
  614. #define AP_EXTD_VCB                       0x80                     
  615.  
  616. /* ========================================================================= */
  617. /*****************************************************************************/
  618. /* ------------------------- vcb structures -------------------------------- */
  619. /*****************************************************************************/
  620.  
  621. /*****************************************************************************/
  622. /* common vcb header                                                         */
  623. /*****************************************************************************/
  624. struct appc_hdr
  625. {
  626.   unsigned short opcode;
  627.   unsigned char  opext;
  628.   unsigned char  reserv2;
  629.   unsigned short primary_rc;
  630.   unsigned long  secondary_rc;
  631. };
  632.  
  633.  
  634. /*****************************************************************************/
  635. /* ACTS: activate/deactivate session vcbs                                    */
  636. /*****************************************************************************/
  637.  
  638. typedef struct activate_session
  639. {
  640.   unsigned short opcode;                  /* verb operation code             */
  641.   unsigned char  reserv2[2];              /* reserved                        */
  642.   unsigned short primary_rc;              /* primary return code             */
  643.   unsigned long  secondary_rc;            /* secondary return code           */
  644.   unsigned char  reserv3[8];              /* reserved                        */
  645.   unsigned char  lu_alias[8];             /* local LU alias                  */
  646.   unsigned char  plu_alias[8];            /* partner LU alias                */
  647.   unsigned char  mode_name[8];            /* mode name                       */
  648.   unsigned char  fqplu_name[17];          /* fully qualified partner LU name */
  649.   unsigned char  polarity;                /* polarity                        */
  650.   unsigned char  session_id[8];           /* session id                      */
  651.   unsigned long  conv_group_id;           /* conversation group id           */
  652.   unsigned char  reserv4[1];              /* reserved                        */
  653.   unsigned char  type;                    /* activation type                 */
  654.   HANDLE         deactivation_event;      /* deactivation event              */
  655.   unsigned short * p_deactivation_status; /* deactivation completion status  */
  656.   unsigned char  reserv5[10];             /* reserved                        */
  657. }ACTIVATE_SESSION;
  658.  
  659. typedef struct deactivate_session
  660. {
  661.   unsigned short opcode;                  /* verb operation code             */
  662.   unsigned char  reserv2[2];              /* reserved                        */
  663.   unsigned short primary_rc;              /* primary return code             */
  664.   unsigned long  secondary_rc;            /* secondary return code           */
  665.   unsigned char  reserv3[8];              /* reserved                        */
  666.   unsigned char  lu_alias[8];             /* local LU alias                  */
  667.   unsigned char  session_id[8];           /* session identifier              */
  668.   unsigned char  plu_alias[8];            /* partner LU alias                */
  669.   unsigned char  mode_name[8];            /* mode name                       */
  670.   unsigned char  type;                    /* deactivation type               */
  671.   unsigned char  reserv4[3];              /* reserved                        */
  672.   unsigned short sense_data;              /* deactivation sense data         */
  673.   unsigned char  fqplu_name[17];          /* fully qualified partner LU name */
  674.   unsigned char  reserv5[17];             /* reserved                        */
  675. }DEACTIVATE_SESSION;
  676.  
  677.  
  678. /*****************************************************************************/
  679. /* control vcbs                                                              */
  680. /*****************************************************************************/
  681. struct tp_started
  682. {
  683.   unsigned short    opcode;
  684.   unsigned char     opext;
  685.   unsigned char     reserv2;
  686.   unsigned short    primary_rc;
  687.   unsigned long     secondary_rc;
  688.   unsigned char     lu_alias[8];
  689.   unsigned char     tp_id[8];
  690.   unsigned char     tp_name[64];
  691. #ifdef SYNCPT_SUPPORT                                                          
  692.   unsigned char     syncpoint_rqd;         /* present if opext & AP_EXTD_VCB */
  693. #endif                                                                 
  694. };
  695.  
  696.  
  697. /*****************************************************************************/
  698. /* WARNING: If you change this structure you must also change the            */
  699. /* receive_allocate_ex strucure                                              */
  700. /*****************************************************************************/
  701. struct receive_allocate
  702. {
  703.   unsigned short    opcode;
  704.   unsigned char     opext;
  705.   unsigned char     reserv2;
  706.   unsigned short    primary_rc;
  707.   unsigned long     secondary_rc;
  708.   unsigned char     tp_name[64];
  709.   unsigned char     tp_id[8];
  710.   unsigned long     conv_id;
  711.   unsigned char     sync_level;         /* AP_NONE                           */
  712.                                         /* AP_CONFIRM_SYNC_LEVEL             */
  713.                                         /* AP_SYNCPT                         */
  714.   unsigned char     conv_type;          /* AP_BASIC_CONVERSATION             */
  715.                                         /* AP_MAPPED_CONVERSATION            */
  716.   unsigned char     user_id[10];
  717.   unsigned char     lu_alias[8];
  718.   unsigned char     plu_alias[8];
  719.   unsigned char     mode_name[8];
  720.   unsigned char     reserv3[2];
  721.   unsigned long     conv_group_id;      /* conversation group id             */
  722.   unsigned char     fqplu_name[17];     /* fully qualified lu name           */
  723. #ifdef SYNCPT_SUPPORT                                                  
  724.   unsigned char     pip_incoming;       /* Supplied:                         */
  725.                                         /*   AP_NO:  TP does not accept PIP  */
  726.                                         /*           data                    */
  727.                                         /*   AP_YES: TP does accept PIP data */
  728.                                         /* Returned:                         */
  729.                                         /*   AP_NO:  PIP data not available  */
  730.                                         /*   AP_YES: PIP data available      */
  731.   unsigned char     syncpoint_rqd;      /* AP_NO                             */
  732.                                         /* AP_YES                            */
  733.   unsigned char     reserv4[3];                                        
  734. #else                                                                  
  735.   unsigned char     reserv4[5];
  736. #endif                                                                 
  737. };
  738.  
  739.  
  740. /*****************************************************************************/
  741. /* WARNING: If you change this structure you must also change the            */
  742. /* receive_allocate strucure (3669)                                          */
  743. /*****************************************************************************/
  744. struct receive_allocate_ex
  745. {
  746.   unsigned short   opcode;
  747.   unsigned char    opext;
  748.   unsigned char    format;
  749.   unsigned short   primary_rc;
  750.   unsigned long    secondary_rc;
  751.   unsigned char    tp_name[64];
  752.   unsigned char    tp_id[8];
  753.   unsigned long    conv_id;
  754.   unsigned char    sync_level;
  755.   unsigned char    conv_type;
  756.   unsigned char    user_id[10];
  757.   unsigned char    lu_alias[8];
  758.   unsigned char    plu_alias[8];
  759.   unsigned char    mode_name[8];
  760.   unsigned char    reserv3[2];
  761.   unsigned long    conv_group_id;
  762.   unsigned char    fqplu_name[17];
  763.   unsigned char    pip_incoming;
  764.   unsigned long    timeout;
  765.   unsigned char    password[10];
  766.   unsigned char    reserv5[2];
  767.   unsigned char    attach_id[8];
  768. };
  769.  
  770. struct receive_allocate_ex_end
  771. {
  772.   unsigned short   opcode;
  773.   unsigned char    reserv2[2];
  774.   unsigned short   primary_rc;
  775.   unsigned long    secondary_rc;
  776.   unsigned char    tp_name[64];
  777.   unsigned char    lu_alias[8];
  778.   unsigned char    reserved3[20];
  779. };
  780.  
  781.  
  782. struct tp_ended
  783. {
  784.   unsigned short    opcode;
  785.   unsigned char     opext;
  786.   unsigned char     reserv2;
  787.   unsigned short    primary_rc;
  788.   unsigned long     secondary_rc;
  789.   unsigned char     tp_id[8];
  790.   unsigned char     type;               /* AP_SOFT                           */
  791.                                         /* AP_HARD                           */
  792. };
  793.  
  794.  
  795. /*****************************************************************************/
  796. /* mapped conversation vcbs                                                  */
  797. /*****************************************************************************/
  798. struct mc_allocate
  799. {
  800.   unsigned short    opcode;
  801.   unsigned char     opext;
  802.   unsigned char     reserv2;
  803.   unsigned short    primary_rc;
  804.   unsigned long     secondary_rc;
  805.   unsigned char     tp_id[8];
  806.   unsigned long     conv_id;
  807.   unsigned char     reserv3;
  808.   unsigned char     sync_level;         /* AP_NONE                           */
  809.                                         /* AP_CONFIRM_SYNC_LEVEL             */
  810.                                         /* AP_SYNCPT                         */
  811.   unsigned char     reserv4[2];
  812.   unsigned char     rtn_ctl;            /* AP_WHEN_SESSION_ALLOCATED         */
  813.                                         /* AP_IMMEDIATE                      */
  814.                                         /* AP_WHEN_SESSION_FREE              */
  815.                                         /* AP_WHEN_CONWINNER_ALLOCATED       */
  816.                                         /* AP_WHEN_CONV_GROUP_ALLOCATED      */
  817.   unsigned char     reserv5;
  818.   unsigned long     conv_group_id;      /* conversation group id             */
  819.   unsigned long     sense_data;         /* alloc failure sense data          */
  820.   unsigned char     plu_alias[8];
  821.   unsigned char     mode_name[8];
  822.   unsigned char     tp_name[64];
  823.   unsigned char     security;           /* AP_NONE                           */
  824.                                         /* AP_SAME                           */
  825.                                         /* AP_PGM                            */
  826.                                         /* AP_PROXY_NONE                     */
  827.                                         /* AP_PROXY_SAME                     */
  828.                                         /* AP_PROXY_PGM                      */
  829.   unsigned char     reserv6[11];
  830.   unsigned char     pwd[10];
  831.   unsigned char     user_id[10];
  832.   unsigned short    pip_dlen;
  833.   unsigned char far *pip_dptr;
  834.   unsigned char     reserv7;            /*CPIC* reserved for NS/2 compat.    */
  835.   unsigned char     fqplu_name[17];     /*CPIC* fully qualified PLU name     */
  836.   unsigned char     reserv8[8];         /*CPIC* reduced this from 26 to 8    */
  837. #ifdef WIN32
  838.   LPWSTR            proxy_user;         /* present if opext&AP_EXTD_VCB      */
  839.   LPWSTR            proxy_domain;       /* present if opext&AP_EXTD_VCB      */
  840.   unsigned char     reserv9[16];        /* present if opext&AP_EXTD_VCB      */
  841. #endif
  842. };
  843.  
  844.  
  845. struct mc_confirm
  846. {
  847.   unsigned short    opcode;
  848.   unsigned char     opext;
  849.   unsigned char     reserv2;
  850.   unsigned short    primary_rc;
  851.   unsigned long     secondary_rc;
  852.   unsigned char     tp_id[8];
  853.   unsigned long     conv_id;
  854.   unsigned char     rts_rcvd;           /* AP_NO                             */
  855.                                         /* AP_YES                            */
  856. };
  857.  
  858.  
  859. struct mc_confirmed
  860. {
  861.   unsigned short    opcode;
  862.   unsigned char     opext;
  863.   unsigned char     reserv2;
  864.   unsigned short    primary_rc;
  865.   unsigned long     secondary_rc;
  866.   unsigned char     tp_id[8];
  867.   unsigned long     conv_id;
  868. };
  869.  
  870.  
  871. struct mc_deallocate
  872. {
  873.   unsigned short    opcode;
  874.   unsigned char     opext;
  875.   unsigned char     reserv2;
  876.   unsigned short    primary_rc;
  877.   unsigned long     secondary_rc;
  878.   unsigned char     tp_id[8];
  879.   unsigned long     conv_id;
  880.   unsigned char     reserv3;
  881.   unsigned char     dealloc_type;       /* AP_SYNC_LEVEL                     */
  882.                                         /* AP_FLUSH                          */
  883.                                         /* AP_CONFIRM_TYPE                   */
  884.                                         /* AP_ABEND                          */
  885.                                         /* AP_TP_NOT_AVAIL_RETRY             */
  886.                                         /* AP_TP_NOT_AVAIL_NO_RETRY          */
  887.                                         /* AP_TPN_NOT_RECOGNIZED             */
  888.                                         /* AP_PIP_DATA_NOT_ALLOWED           */
  889.                                         /* AP_PIP_DATA_INCORRECT             */
  890.                                         /* AP_RESOURCE_FAILURE_NO_RETRY      */
  891.                                         /* AP_CONV_TYPE_MISMATCH             */
  892.                                         /* AP_SYNC_LVL_NOT_SUPPORTED         */
  893.                                         /* AP_SECURITY_PARAMS_INVALID        */
  894.   unsigned char     reserv4[2];
  895.   unsigned char     reserv5[4];
  896. #ifdef SYNCPT_SUPPORT                                                   
  897.   void       (WINAPI *callback)();      /* present if opext&AP_EXTD_VCB      */
  898.   void             *correlator;         /* present if opext&AP_EXTD_VCB      */
  899.   unsigned char     reserv6[4];         /* present if opext&AP_EXTD_VCB      */
  900. #endif                                                                 
  901. };
  902.  
  903.  
  904. struct mc_flush
  905. {
  906.   unsigned short    opcode;
  907.   unsigned char     opext;
  908.   unsigned char     reserv2;
  909.   unsigned short    primary_rc;
  910.   unsigned long     secondary_rc;
  911.   unsigned char     tp_id[8];
  912.   unsigned long     conv_id;
  913. };
  914.  
  915.  
  916. struct mc_get_attributes
  917. {
  918.   unsigned short    opcode;
  919.   unsigned char     opext;
  920.   unsigned char     reserv2;
  921.   unsigned short    primary_rc;
  922.   unsigned long     secondary_rc;
  923.   unsigned char     tp_id[8];
  924.   unsigned long     conv_id;
  925.   unsigned char     reserv3;
  926.   unsigned char     sync_level;         /* AP_NONE                           */
  927.                                         /* AP_CONFIRM_SYNC_LEVEL             */
  928.                                         /* AP_SYNCPT                         */
  929.   unsigned char     mode_name[8];
  930.   unsigned char     net_name[8];
  931.   unsigned char     lu_name[8];
  932.   unsigned char     lu_alias[8];
  933.   unsigned char     plu_alias[8];
  934.   unsigned char     plu_un_name[8];
  935.   unsigned char     reserv4[2];
  936.   unsigned char     fqplu_name[17];
  937.   unsigned char     reserv5;
  938.   unsigned char     user_id[10];
  939.   unsigned long     conv_group_id;      /* conversation group id             */
  940.   unsigned char     conv_corr_len;      /* conversation correlator lgth      */
  941.   unsigned char     conv_corr[8];       /* conversation correlator           */
  942.   unsigned char     reserv6[13];
  943. #ifdef SYNCPT_SUPPORT                                                    
  944.   unsigned char     luw_id[26];          /* present if opext&AP_EXTD_VCB     */
  945.   unsigned char     sess_id[8];          /* present if opext&AP_EXTD_VCB     */
  946. #endif                                                                 
  947. };
  948.  
  949.  
  950. struct mc_prepare_to_receive
  951. {
  952.   unsigned short    opcode;
  953.   unsigned char     opext;
  954.   unsigned char     reserv2;
  955.   unsigned short    primary_rc;
  956.   unsigned long     secondary_rc;
  957.   unsigned char     tp_id[8];
  958.   unsigned long     conv_id;
  959.   unsigned char     ptr_type;           /* AP_SYNC_LEVEL                     */
  960.                                         /* AP_FLUSH                          */
  961.                                         /* AP_CONFIRM_TYPE                   */
  962.   unsigned char     locks;              /* AP_SHORT                          */
  963.                                         /* AP_LONG                           */
  964. };
  965.  
  966.  
  967. struct mc_receive_and_post
  968. {
  969.   unsigned short    opcode;
  970.   unsigned char     opext;
  971.   unsigned char     reserv2;
  972.   unsigned short    primary_rc;
  973.   unsigned long     secondary_rc;
  974.   unsigned char     tp_id[8];
  975.   unsigned long     conv_id;
  976.   unsigned short    what_rcvd;          /* AP_NONE                           */
  977.                                         /* AP_DATA                           */
  978.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  979.                                         /* AP_CONFIRM_SEND                   */
  980.                                         /* AP_CONFIRM_DEALLOCATE             */
  981.   unsigned char     rtn_status;         /* AP_NO                             */
  982.                                         /* AP_YES                            */
  983.   unsigned char     reserv4;
  984.   unsigned char     rts_rcvd;           /* AP_NO                             */
  985.                                         /* AP_YES                            */
  986.   unsigned char     reserv5;
  987.   unsigned short    max_len;
  988.   unsigned short    dlen;
  989.   unsigned char far *dptr;
  990.   unsigned char far *sema;
  991.   unsigned char     reserv6;
  992. };
  993.  
  994.  
  995. struct mc_receive_and_wait
  996. {
  997.   unsigned short    opcode;
  998.   unsigned char     opext;
  999.   unsigned char     reserv2;
  1000.   unsigned short    primary_rc;
  1001.   unsigned long     secondary_rc;
  1002.   unsigned char     tp_id[8];
  1003.   unsigned long     conv_id;
  1004.   unsigned short    what_rcvd;          /* AP_NONE                           */
  1005.                                         /* AP_DATA                           */
  1006.                                         /* AP_SEND                           */
  1007.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  1008.                                         /* AP_CONFIRM_SEND                   */
  1009.                                         /* AP_CONFIRM_DEALLOCATE             */
  1010.   unsigned char     rtn_status;         /* AP_NO                             */
  1011.                                         /* AP_YES                            */
  1012.   unsigned char     reserv4;
  1013.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1014.                                         /* AP_YES                            */
  1015.   unsigned char     reserv5;
  1016.   unsigned short    max_len;
  1017.   unsigned short    dlen;
  1018.   unsigned char far *dptr;
  1019.   unsigned char     reserv6[5];
  1020. };
  1021.  
  1022.  
  1023. struct mc_receive_immediate
  1024. {
  1025.   unsigned short    opcode;
  1026.   unsigned char     opext;
  1027.   unsigned char     reserv2;
  1028.   unsigned short    primary_rc;
  1029.   unsigned long     secondary_rc;
  1030.   unsigned char     tp_id[8];
  1031.   unsigned long     conv_id;
  1032.   unsigned short    what_rcvd;          /* AP_NONE                           */
  1033.                                         /* AP_DATA                           */
  1034.                                         /* AP_SEND                           */
  1035.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  1036.                                         /* AP_CONFIRM_SEND                   */
  1037.                                         /* AP_CONFIRM_DEALLOCATE             */
  1038.   unsigned char     rtn_status;         /* AP_NO                             */
  1039.                                         /* AP_YES                            */
  1040.   unsigned char     reserv4;
  1041.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1042.                                         /* AP_YES                            */
  1043.   unsigned char     reserv5;
  1044.   unsigned short    max_len;
  1045.   unsigned short    dlen;
  1046.   unsigned char far *dptr;
  1047.   unsigned char     reserv6[5];
  1048. };
  1049.  
  1050.  
  1051. struct mc_request_to_send
  1052. {
  1053.   unsigned short    opcode;
  1054.   unsigned char     opext;
  1055.   unsigned char     reserv2;
  1056.   unsigned short    primary_rc;
  1057.   unsigned long     secondary_rc;
  1058.   unsigned char     tp_id[8];
  1059.   unsigned long     conv_id;
  1060. };
  1061.  
  1062.  
  1063. struct mc_send_conversation                                            
  1064. {                                                                      
  1065.   unsigned short    opcode;                                            
  1066.   unsigned char     opext;                                             
  1067.   unsigned char     reserv2;                                           
  1068.   unsigned short    primary_rc;                                        
  1069.   unsigned long     secondary_rc;                                      
  1070.   unsigned char     tp_id[8];                                          
  1071.   unsigned char     reserv3[8];                                        
  1072.   unsigned char     rtn_ctl;            /* AP_WHEN_SESSION_ALLOCATED         */
  1073.                                         /* AP_IMMEDIATE                      */
  1074.                                         /* AP_WHEN_SESSION_FREE              */
  1075.                                         /* AP_WHEN_CONWINNER_ALLOCATED       */
  1076.                                         /* AP_WHEN_CONV_GROUP_ALLOCATED      */
  1077.   unsigned char     reserv4;                                           
  1078.   unsigned long     conv_group_id;      /* conversation group id             */
  1079.   unsigned long     sense_data;         /* alloc failure sense data          */
  1080.   unsigned char     plu_alias[8];                                      
  1081.   unsigned char     mode_name[8];                                      
  1082.   unsigned char     tp_name[64];                                       
  1083.   unsigned char     security;           /* AP_NONE                           */
  1084.                                         /* AP_SAME                           */
  1085.                                         /* AP_PGM                            */
  1086.   unsigned char     reserv5[11];                                       
  1087.   unsigned char     pwd[10];                                           
  1088.   unsigned char     user_id[10];                                       
  1089.   unsigned short    pip_dlen;                                          
  1090.   unsigned char far *pip_dptr;                                         
  1091.   unsigned char     reserv6;                                           
  1092.   unsigned char     fqplu_name[17];                                    
  1093.   unsigned char     reserv7[8];                                        
  1094.   unsigned short    dlen;                                              
  1095.   unsigned char far *dptr;                                             
  1096. };                                                                     
  1097.  
  1098.  
  1099. struct mc_send_data
  1100. {
  1101.   unsigned short    opcode;
  1102.   unsigned char     opext;
  1103.   unsigned char     reserv2;
  1104.   unsigned short    primary_rc;
  1105.   unsigned long     secondary_rc;
  1106.   unsigned char     tp_id[8];
  1107.   unsigned long     conv_id;
  1108.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1109.                                         /* AP_YES                            */
  1110. #ifdef SYNCPT_SUPPORT                                                  
  1111.   unsigned char     data_type;           /* type of data to be sent          */
  1112.                                          /* AP_APPLICATION                   */
  1113.                                          /* AP_USER_CONTROL_DATA             */
  1114.                                          /* AP_PS_HEADER                     */
  1115. #else                                                                  
  1116.   unsigned char     reserv3;
  1117. #endif                                                                 
  1118.   unsigned short    dlen;
  1119.   unsigned char far *dptr;
  1120.   unsigned char     type;               /* AP_SEND_DATA_FLUSH                */
  1121.                                         /* AP_SEND_DATA_CONFIRM              */
  1122.                                         /* AP_SEND_DATA_P_TO_R_FLUSH         */
  1123.                                         /* AP_SEND_DATA_P_TO_R_SYNC_LEVEL    */
  1124.                                         /* AP_SEND_DATA_P_TO_R_CONFIRM  *SYNC*/
  1125.                                         /* AP_SEND_DATA_DEALLOC_FLUSH        */
  1126.                                         /* AP_SEND_DATA_DEALLOC_SYNC_LEVEL   */
  1127.                                         /* AP_SEND_DATA_DEALLOC_CONFIRM *SYNC*/
  1128.                                         /* AP_SEND_DATA_DEALLOC_ABEND        */
  1129.   unsigned char     reserv4;
  1130. };
  1131.  
  1132.  
  1133. struct mc_send_error
  1134. {
  1135.   unsigned short    opcode;
  1136.   unsigned char     opext;
  1137.   unsigned char     reserv2;
  1138.   unsigned short    primary_rc;
  1139.   unsigned long     secondary_rc;
  1140.   unsigned char     tp_id[8];       
  1141.   unsigned long     conv_id;
  1142.   unsigned char     rts_rcvd;            /* AP_NO                            */
  1143.                                          /* AP_YES                           */
  1144. #ifdef SYNCPT_SUPPORT                                                  
  1145.   unsigned char     err_type;            /* type of error                    */
  1146.                                          /* AP_PROG                          */
  1147.                                          /* AP_BACKOUT_NO_RESYNC             */
  1148.                                          /* AP_BACKOUT_RESYNC                */
  1149. #else                                                                  
  1150.   unsigned char     reserv3;
  1151. #endif                                                                 
  1152.   unsigned char     err_dir;             /* AP_RCV_DIR_ERROR                 */
  1153.                                          /* AP_SEND_DIR_ERROR                */
  1154.   unsigned char     reserv4;
  1155.   unsigned short    log_dlen;                                          
  1156.   unsigned char far *log_dptr;                                         
  1157. };
  1158.  
  1159. struct mc_test_rts
  1160. {
  1161.   unsigned short    opcode;
  1162.   unsigned char     opext;
  1163.   unsigned char     reserv2;
  1164.   unsigned short    primary_rc;
  1165.   unsigned long     secondary_rc;
  1166.   unsigned char     tp_id[8];
  1167.   unsigned long     conv_id;
  1168.   unsigned char     reserv3;
  1169. };
  1170.  
  1171. struct mc_test_rts_and_post                                            
  1172. {                                                                      
  1173.   unsigned short    opcode;                                            
  1174.   unsigned char     opext;                                             
  1175.   unsigned char     reserv2;                                           
  1176.   unsigned short    primary_rc;                                        
  1177.   unsigned long     secondary_rc;                                      
  1178.   unsigned char     tp_id[8];                                          
  1179.   unsigned long     conv_id;                                           
  1180.   unsigned char     reserv3;                                           
  1181.   unsigned long     handle;                                            
  1182. };                                                                     
  1183.  
  1184. #ifdef WIN32                                                           
  1185. struct mc_post_on_receipt                                              
  1186. {                                                                      
  1187.   unsigned short        opcode;                                        
  1188.   unsigned char         opext;                                         
  1189.   unsigned char         reserv1;                                       
  1190.   unsigned short        primary_rc;                                    
  1191.   unsigned long         secondary_rc;                                  
  1192.   unsigned char         tp_id[8];                                      
  1193.   unsigned long         conv_id;                                       
  1194.   unsigned short        reserv2;                                       
  1195.   unsigned char         reserv3;                                       
  1196.   unsigned char         reserv4;                                       
  1197.   unsigned short        max_len;                                       
  1198.   unsigned short        reserv5;                                       
  1199.   unsigned char far *   reserv6;                                       
  1200.   unsigned char         reserv7[5];                                    
  1201.   unsigned long         sema;                                          
  1202. };                                                                     
  1203. #endif                                                                 
  1204.  
  1205. struct mc_receive_log_data                                             
  1206. {                                                                      
  1207.   unsigned short        opcode;                                        
  1208.   unsigned char         opext;                                         
  1209.   unsigned char         reserv1;                                       
  1210.   unsigned short        primary_rc;                                    
  1211.   unsigned long         secondary_rc;                                  
  1212.   unsigned char         tp_id[8];                                      
  1213.   unsigned long         conv_id;                                       
  1214.   unsigned short        log_dlen;                                      
  1215.   unsigned char far *   log_dptr;                                      
  1216. };                                                                     
  1217.  
  1218. /*****************************************************************************/
  1219. /* basic conversation vcbs                                                   */
  1220. /*****************************************************************************/
  1221. struct allocate
  1222. {
  1223.   unsigned short    opcode;
  1224.   unsigned char     opext;
  1225.   unsigned char     reserv2;
  1226.   unsigned short    primary_rc;
  1227.   unsigned long     secondary_rc;
  1228.   unsigned char     tp_id[8];
  1229.   unsigned long     conv_id;
  1230.   unsigned char     conv_type;          /* AP_BASIC_CONVERSATION             */
  1231.                                         /* AP_MAPPED_CONVERSATION            */
  1232.   unsigned char     sync_level;         /* AP_NONE                           */
  1233.                                         /* AP_CONFIRM_SYNC_LEVEL             */
  1234.                                         /* AP_SYNCPT                         */
  1235.   unsigned char     reserv3[2];
  1236.   unsigned char     rtn_ctl;            /* AP_WHEN_SESSION_ALLOCATED         */
  1237.                                         /* AP_IMMEDIATE                      */
  1238.                                         /* AP_WHEN_SESSION_FREE              */
  1239.                                         /* AP_WHEN_CONWINNER_ALLOCATED       */
  1240.                                         /* AP_WHEN_CONV_GROUP_ALLOCATED      */
  1241.   unsigned char     reserv4;
  1242.   unsigned long     conv_group_id;      /* conversation group id             */
  1243.   unsigned long     sense_data;         /* alloc failure sense data          */
  1244.   unsigned char     plu_alias[8];
  1245.   unsigned char     mode_name[8];
  1246.   unsigned char     tp_name[64];
  1247.   unsigned char     security;           /* AP_NONE                           */
  1248.                                         /* AP_SAME                           */
  1249.                                         /* AP_PGM                            */
  1250.                                         /* AP_PROXY_NONE                     */
  1251.                                         /* AP_PROXY_SAME                     */
  1252.                                         /* AP_PROXY_PGM                      */
  1253.   unsigned char     reserv5[11];
  1254.   unsigned char     pwd[10];
  1255.   unsigned char     user_id[10];
  1256.   unsigned short    pip_dlen;
  1257.   unsigned char far *pip_dptr;
  1258.   unsigned char     reserv7;            /*CPIC* for NS/2 compatability       */
  1259.   unsigned char     fqplu_name[17];     /*CPIC* fully qualified PLU name     */
  1260.   unsigned char     reserv8[8];         /*CPIC* reduced this from 26 to 8    */
  1261. #ifdef WIN32
  1262.   LPWSTR            proxy_user;         /* present if opext&AP_EXTD_VCB      */
  1263.   LPWSTR            proxy_domain;       /* present if opext&AP_EXTD_VCB      */
  1264.   unsigned char     reserv9[16];        /* present if opext&AP_EXTD_VCB      */
  1265. #endif
  1266. };
  1267.  
  1268.  
  1269. struct confirm
  1270. {
  1271.   unsigned short    opcode;
  1272.   unsigned char     opext;
  1273.   unsigned char     reserv2;
  1274.   unsigned short    primary_rc;
  1275.   unsigned long     secondary_rc;
  1276.   unsigned char     tp_id[8];
  1277.   unsigned long     conv_id;
  1278.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1279.                                         /* AP_YES                            */
  1280. };
  1281.  
  1282.  
  1283. struct confirmed
  1284. {
  1285.   unsigned short    opcode;
  1286.   unsigned char     opext;
  1287.   unsigned char     reserv2;
  1288.   unsigned short    primary_rc;
  1289.   unsigned long     secondary_rc;
  1290.   unsigned char     tp_id[8];
  1291.   unsigned long     conv_id;
  1292. };
  1293.  
  1294.  
  1295. struct deallocate
  1296. {
  1297.   unsigned short    opcode;
  1298.   unsigned char     opext;
  1299.   unsigned char     reserv2;
  1300.   unsigned short    primary_rc;
  1301.   unsigned long     secondary_rc;
  1302.   unsigned char     tp_id[8];
  1303.   unsigned long     conv_id;
  1304.   unsigned char     reserv3;
  1305.   unsigned char     dealloc_type;       /* AP_SYNC_LEVEL                     */
  1306.                                         /* AP_FLUSH                          */
  1307.                                         /* AP_CONFIRM_TYPE                   */
  1308.                                         /* AP_ABEND_PROG                     */
  1309.                                         /* AP_ABEND_SVC                      */
  1310.                                         /* AP_ABEND_TIMER                    */
  1311.                                         /* AP_TP_NOT_AVAIL_RETRY             */
  1312.                                         /* AP_TP_NOT_AVAIL_NO_RETRY          */
  1313.                                         /* AP_TPN_NOT_RECOGNIZED             */
  1314.                                         /* AP_PIP_DATA_NOT_ALLOWED           */
  1315.                                         /* AP_PIP_DATA_INCORRECT             */
  1316.                                         /* AP_RESOURCE_FAILURE_NO_RETRY      */
  1317.                                         /* AP_CONV_TYPE_MISMATCH             */
  1318.                                         /* AP_SYNC_LVL_NOT_SUPPORTED         */
  1319.                                         /* AP_SECURITY_PARAMS_INVALID        */
  1320.   unsigned short    log_dlen;
  1321.   unsigned char far *log_dptr;
  1322. #ifdef SYNCPT_SUPPORT                                                  
  1323.   void       (WINAPI *callback)();      /* present if opext&AP_EXTD_VCB      */
  1324.   void             *correlator;         /* present if opext&AP_EXTD_VCB      */
  1325.   unsigned char     reserv6[4];         /* present if opext&AP_EXTD_VCB      */
  1326. #endif                                                                 
  1327. };
  1328.  
  1329.  
  1330. struct flush
  1331. {
  1332.   unsigned short    opcode;
  1333.   unsigned char     opext;
  1334.   unsigned char     reserv2;
  1335.   unsigned short    primary_rc;
  1336.   unsigned long     secondary_rc;
  1337.   unsigned char     tp_id[8];
  1338.   unsigned long     conv_id;
  1339. };
  1340.  
  1341.  
  1342. struct get_attributes
  1343. {
  1344.   unsigned short    opcode;
  1345.   unsigned char     opext;
  1346.   unsigned char     reserv2;
  1347.   unsigned short    primary_rc;
  1348.   unsigned long     secondary_rc;
  1349.   unsigned char     tp_id[8];
  1350.   unsigned long     conv_id;
  1351.   unsigned char     reserv3;
  1352.   unsigned char     sync_level;         /* AP_NONE                           */
  1353.                                         /* AP_CONFIRM_SYNC_LEVEL             */
  1354.                                         /* AP_SYNCPT                         */
  1355.   unsigned char     mode_name[8];
  1356.   unsigned char     net_name[8];
  1357.   unsigned char     lu_name[8];
  1358.   unsigned char     lu_alias[8];
  1359.   unsigned char     plu_alias[8];
  1360.   unsigned char     plu_un_name[8];
  1361.   unsigned char     reserv4[2];
  1362.   unsigned char     fqplu_name[17];
  1363.   unsigned char     reserv5;
  1364.   unsigned char     user_id[10];
  1365.   unsigned long     conv_group_id;      /* conversation group id             */
  1366.   unsigned char     conv_corr_len;      /* conversation correlator length    */
  1367.   unsigned char     conv_corr[8];       /* conversation correlator           */
  1368.   unsigned char     reserv6[13];
  1369. #ifdef SYNCPT_SUPPORT                                                  
  1370.   unsigned char     luw_id[26];          /* present if opext&AP_EXTD_VCB     */
  1371.   unsigned char     sess_id[8];          /* present if opext&AP_EXTD_VCB     */
  1372. #endif                                                                 
  1373. };
  1374.  
  1375.  
  1376. struct prepare_to_receive
  1377. {
  1378.   unsigned short    opcode;
  1379.   unsigned char     opext;
  1380.   unsigned char     reserv2;
  1381.   unsigned short    primary_rc;
  1382.   unsigned long     secondary_rc;
  1383.   unsigned char     tp_id[8];
  1384.   unsigned long     conv_id;
  1385.   unsigned char     ptr_type;           /* AP_SYNC_LEVEL                     */
  1386.                                         /* AP_FLUSH                          */
  1387.                                         /* AP_CONFIRM_TYPE                   */
  1388.   unsigned char     locks;              /* AP_SHORT                          */
  1389.                                         /* AP_LONG                           */
  1390. };
  1391.  
  1392.  
  1393. struct receive_and_post
  1394. {
  1395.   unsigned short    opcode;
  1396.   unsigned char     opext;
  1397.   unsigned char     reserv2;
  1398.   unsigned short    primary_rc;
  1399.   unsigned long     secondary_rc;
  1400.   unsigned char     tp_id[8];
  1401.   unsigned long     conv_id;
  1402.   unsigned short    what_rcvd;          /* AP_NONE                           */
  1403.                                         /* AP_DATA                           */
  1404.                                         /* AP_DATA_COMPLETE                  */
  1405.                                         /* AP_DATA_INCOMPLETE                */
  1406.                                         /* AP_SEND                           */
  1407.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  1408.                                         /* AP_CONFIRM_SEND                   */
  1409.                                         /* AP_CONFIRM_DEALLOCATE             */
  1410.   unsigned char     rtn_status;         /* AP_NO                             */
  1411.                                         /* AP_YES                            */
  1412.   unsigned char     fill;               /* AP_BUFFER                         */
  1413.                                         /* AP_LL                             */
  1414.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1415.                                         /* AP_YES                            */
  1416.   unsigned char     reserv4;
  1417.   unsigned short    max_len;
  1418.   unsigned short    dlen;
  1419.   unsigned char far *dptr;
  1420.   unsigned char far *sema;
  1421.   unsigned char     reserv5;
  1422. };
  1423.  
  1424.  
  1425. struct receive_and_wait
  1426. {
  1427.   unsigned short    opcode;
  1428.   unsigned char     opext;
  1429.   unsigned char     reserv2;
  1430.   unsigned short    primary_rc;
  1431.   unsigned long     secondary_rc;
  1432.   unsigned char     tp_id[8];
  1433.   unsigned long     conv_id;
  1434.   unsigned short    what_rcvd;          /* AP_NONE                           */
  1435.                                         /* AP_DATA                           */
  1436.                                         /* AP_DATA_COMPLETE                  */
  1437.                                         /* AP_DATA_INCOMPLETE                */
  1438.                                         /* AP_SEND                           */
  1439.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  1440.                                         /* AP_CONFIRM_SEND                   */
  1441.                                         /* AP_CONFIRM_DEALLOCATE             */
  1442.   unsigned char     rtn_status;         /* AP_NO                             */
  1443.                                         /* AP_YES                            */
  1444.   unsigned char     fill;               /* AP_BUFFER                         */
  1445.                                         /* AP_LL                             */
  1446.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1447.                                         /* AP_YES                            */
  1448.   unsigned char     reserv4;
  1449.   unsigned short    max_len;
  1450.   unsigned short    dlen;
  1451.   unsigned char far *dptr;
  1452.   unsigned char     reserv5[5];
  1453. };
  1454.  
  1455.  
  1456. struct receive_immediate
  1457. {
  1458.   unsigned short    opcode;
  1459.   unsigned char     opext;
  1460.   unsigned char     reserv2;
  1461.   unsigned short    primary_rc;
  1462.   unsigned long     secondary_rc;
  1463.   unsigned char     tp_id[8];
  1464.   unsigned long     conv_id;
  1465.   unsigned short    what_rcvd;          /* AP_NONE                           */
  1466.                                         /* AP_DATA                           */
  1467.                                         /* AP_DATA_COMPLETE                  */
  1468.                                         /* AP_DATA_INCOMPLETE                */
  1469.                                         /* AP_SEND                           */
  1470.                                         /* AP_CONFIRM_WHAT_RECEIVED          */
  1471.                                         /* AP_CONFIRM_SEND                   */
  1472.                                         /* AP_CONFIRM_DEALLOCATE             */
  1473.   unsigned char     rtn_status;         /* AP_NO                             */
  1474.                                         /* AP_YES                            */
  1475.   unsigned char     fill;               /* AP_BUFFER                         */
  1476.                                         /* AP_LL                             */
  1477.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1478.                                         /* AP_YES                            */
  1479.   unsigned char     reserv4;
  1480.   unsigned short    max_len;
  1481.   unsigned short    dlen;
  1482.   unsigned char far *dptr;
  1483.   unsigned char     reserv5[5];
  1484. };
  1485.  
  1486.  
  1487. struct request_to_send
  1488. {
  1489.   unsigned short    opcode;
  1490.   unsigned char     opext;
  1491.   unsigned char     reserv2;
  1492.   unsigned short    primary_rc;
  1493.   unsigned long     secondary_rc;
  1494.   unsigned char     tp_id[8];
  1495.   unsigned long     conv_id;
  1496. };
  1497.  
  1498.  
  1499. struct send_conversation                                               
  1500. {                                                                      
  1501.   unsigned short    opcode;                                            
  1502.   unsigned char     opext;                                             
  1503.   unsigned char     reserv2;                                           
  1504.   unsigned short    primary_rc;                                        
  1505.   unsigned long     secondary_rc;                                      
  1506.   unsigned char     tp_id[8];                                          
  1507.   unsigned char     reserv3[8];                                        
  1508.   unsigned char     rtn_ctl;            /* AP_WHEN_SESSION_ALLOCATED         */
  1509.                                         /* AP_IMMEDIATE                      */
  1510.                                         /* AP_WHEN_SESSION_FREE              */
  1511.                                         /* AP_WHEN_CONWINNER_ALLOCATED       */
  1512.                                         /* AP_WHEN_CONV_GROUP_ALLOCATED      */
  1513.   unsigned char     reserv4;                                           
  1514.   unsigned long     conv_group_id;      /* conversation group id             */
  1515.   unsigned long     sense_data;         /* allocation failure sense data     */
  1516.   unsigned char     plu_alias[8];                                      
  1517.   unsigned char     mode_name[8];                                      
  1518.   unsigned char     tp_name[64];                                       
  1519.   unsigned char     security;           /* AP_NONE                           */
  1520.                                         /* AP_SAME                           */
  1521.                                         /* AP_PGM                            */
  1522.   unsigned char     reserv5[11];                                       
  1523.   unsigned char     pwd[10];                                           
  1524.   unsigned char     user_id[10];                                       
  1525.   unsigned short    pip_dlen;                                          
  1526.   unsigned char far *pip_dptr;                                         
  1527.   unsigned char     reserv6;                                           
  1528.   unsigned char     fqplu_name[17];                                    
  1529.   unsigned char     reserv7[8];                                        
  1530.   unsigned short    dlen;                                              
  1531.   unsigned char far *dptr;                                             
  1532. };                                                                     
  1533.  
  1534.  
  1535. struct send_data
  1536. {
  1537.   unsigned short    opcode;
  1538.   unsigned char     opext;
  1539.   unsigned char     reserv2;
  1540.   unsigned short    primary_rc;
  1541.   unsigned long     secondary_rc;
  1542.   unsigned char     tp_id[8];
  1543.   unsigned long     conv_id;
  1544.   unsigned char     rts_rcvd;            /* AP_NO                            */
  1545.                                          /* AP_YES                           */
  1546. #ifdef SYNCPT_SUPPORT                                                  
  1547.   unsigned char     data_type;           /* type of data to be sent          */
  1548.                                          /* AP_APPLICATION                   */
  1549.                                          /* AP_USER_CONTROL_DATA             */
  1550.                                          /* AP_PS_HEADER                     */
  1551. #else                                                                  
  1552.   unsigned char     reserv3;
  1553. #endif                                                                 
  1554.   unsigned short    dlen;
  1555.   unsigned char far *dptr;
  1556.   unsigned char type;                   /* AP_SEND_DATA_FLUSH                */
  1557.                                         /* AP_SEND_DATA_CONFIRM              */
  1558.                                         /* AP_SEND_DATA_P_TO_R_FLUSH         */
  1559.                                         /* AP_SEND_DATA_P_TO_R_SYNC_LEVEL    */
  1560.                                         /* AP_SEND_DATA_P_TO_R_CONFIRM       */
  1561.                                         /* AP_SEND_DATA_DEALLOC_FLUSH        */
  1562.                                         /* AP_SEND_DATA_DEALLOC_SYNC_LEVEL   */
  1563.                                         /* AP_SEND_DATA_DEALLOC_CONFIRM      */
  1564.                                         /* AP_SEND_DATA_DEALLOC_ABEND        */
  1565.   unsigned char     reserv4;
  1566. };
  1567.  
  1568.  
  1569. struct send_error
  1570. {
  1571.   unsigned short    opcode;
  1572.   unsigned char     opext;
  1573.   unsigned char     reserv2;
  1574.   unsigned short    primary_rc;
  1575.   unsigned long     secondary_rc;
  1576.   unsigned char     tp_id[8];
  1577.   unsigned long     conv_id;
  1578.   unsigned char     rts_rcvd;           /* AP_NO                             */
  1579.                                         /* AP_YES                            */
  1580.   unsigned char     err_type;           /* AP_PROG                           */
  1581.                                         /* AP_SVC                            */
  1582.                                         /* AP_BACKOUT_NO_RESYNC              */
  1583.                                         /* AP_BACKOUT_RESYNC                 */
  1584.   unsigned char     err_dir;            /* AP_RCV_DIR_ERROR                  */
  1585.                                         /* AP_SEND_DIR_ERROR                 */
  1586.   unsigned char     reserv3;
  1587.   unsigned short    log_dlen;
  1588.   unsigned char far *log_dptr;
  1589. };
  1590.  
  1591.  
  1592. struct test_rts
  1593. {
  1594.   unsigned short    opcode;
  1595.   unsigned char     opext;
  1596.   unsigned char     reserv2;
  1597.   unsigned short    primary_rc;
  1598.   unsigned long     secondary_rc;
  1599.   unsigned char     tp_id[8];
  1600.   unsigned long     conv_id;
  1601.   unsigned char     reserv3;
  1602. };
  1603.  
  1604. struct test_rts_and_post                                               
  1605. {                                                                      
  1606.   unsigned short    opcode;                                            
  1607.   unsigned char     opext;                                             
  1608.   unsigned char     reserv2;                                           
  1609.   unsigned short    primary_rc;                                        
  1610.   unsigned long     secondary_rc;                                      
  1611.   unsigned char     tp_id[8];                                          
  1612.   unsigned long     conv_id;                                           
  1613.   unsigned char     reserv3;                                           
  1614.   unsigned long     handle;                                            
  1615. };                                                                     
  1616.  
  1617. #ifdef WIN32                                                           
  1618. struct post_on_receipt                                                 
  1619. {                                                                      
  1620.   unsigned short        opcode;                                        
  1621.   unsigned char         opext;                                         
  1622.   unsigned char         reserv1;                                       
  1623.   unsigned short        primary_rc;                                    
  1624.   unsigned long         secondary_rc;                                  
  1625.   unsigned char         tp_id[8];                                      
  1626.   unsigned long         conv_id;                                       
  1627.   unsigned short        reserv2;                                       
  1628.   unsigned char         fill;                                          
  1629.   unsigned char         reserv4;                                       
  1630.   unsigned short        max_len;                                       
  1631.   unsigned short        reserv5;                                       
  1632.   unsigned char far *   reserv6;                                       
  1633.   unsigned char         reserv7[5];                                    
  1634.   unsigned long         sema;                                          
  1635. };                                                                     
  1636. #endif                                                                 
  1637.  
  1638. struct receive_log_data                                                
  1639. {                                                                      
  1640.   unsigned short        opcode;                                        
  1641.   unsigned char         opext;                                         
  1642.   unsigned char         reserv1;                                       
  1643.   unsigned short        primary_rc;                                    
  1644.   unsigned long         secondary_rc;                                  
  1645.   unsigned char         tp_id[8];                                      
  1646.   unsigned long         conv_id;                                       
  1647.   unsigned short        log_dlen;                                      
  1648.   unsigned char far *   log_dptr;                                      
  1649. };                                                                     
  1650.  
  1651.  
  1652. /*****************************************************************************/
  1653. /* type independent vcbs                                                     */
  1654. /*****************************************************************************/
  1655. typedef struct luw_id_overlay                                          
  1656. {                                                                      
  1657.   unsigned char     fqlu_name_len;                                     
  1658.   unsigned char     fqlu_name[17];                                     
  1659.   unsigned char     instance[6];                                       
  1660.   unsigned char     sequence[2];                                       
  1661. } LUW_ID_OVERLAY;                                                      
  1662.                                                                        
  1663. struct get_tp_properties                                               
  1664. {                                                                      
  1665.   unsigned short    opcode;                                            
  1666. #ifdef SYNCPT_SUPPORT                                                  
  1667.   unsigned char     opext;                                             
  1668.   unsigned char     reserv2;                                           
  1669. #else                                                                  
  1670.   unsigned char     reserv2[2];                                        
  1671. #endif                                                                 
  1672.   unsigned short    primary_rc;                                        
  1673.   unsigned long     secondary_rc;                                      
  1674.   unsigned char     tp_id[8];                                          
  1675.   unsigned char     tp_name[64];                                       
  1676.   unsigned char     lu_alias[8];                                       
  1677.   unsigned char     luw_id[26];         /* Logical Unit of Work id           */ 
  1678.   unsigned char     fqlu_name[17];      /* fully qualified LU name           */
  1679.   unsigned char     reserv3[10];                                       
  1680.   unsigned char     user_id[10];                                       
  1681. #ifdef SYNCPT_SUPPORT                                                  
  1682.   unsigned char     prot_luw_id[26];    /* present if opext & AP_EXTD        */
  1683. #endif                                                                 
  1684. };                                                                     
  1685.  
  1686. #ifdef SYNCPT_SUPPORT                                                  
  1687. struct set_tp_properties                                               
  1688. {                                                                      
  1689.   unsigned short    opcode;                                            
  1690.   unsigned char     opext;                                             
  1691.   unsigned char     reserv2;                                           
  1692.   unsigned short    primary_rc;                                        
  1693.   unsigned long     secondary_rc;                                      
  1694.   unsigned char     tp_id[8];                                          
  1695.   unsigned char     set_prot_id;        /* AP_NO, AP_YES                     */
  1696.   unsigned char     new_prot_id;        /* AP_NO, AP_YES                     */
  1697.   unsigned char     prot_id[26];                                       
  1698.   unsigned char     set_unprot_id;      /* AP_NO, AP_YES                     */
  1699.   unsigned char     new_unprot_id;      /* AP_NO, AP_YES                     */
  1700.   unsigned char     unprot_id[26];                                     
  1701.   unsigned char     set_user_id;        /* AP_NO, AP_YES                     */
  1702.   unsigned char     reserv3;                                           
  1703.   unsigned char     user_id[10];                                       
  1704.   unsigned char     reserv4[10];                                       
  1705. };                                                                     
  1706.                                                                        
  1707. struct get_lu_status                                                   
  1708. {                                                                      
  1709.   unsigned short    opcode;                                            
  1710.   unsigned char     opext;                                             
  1711.   unsigned char     reserv2;                                           
  1712.   unsigned short    primary_rc;                                        
  1713.   unsigned long     secondary_rc;                                      
  1714.   unsigned char     tp_id[8];                                          
  1715.   unsigned char     plu_alias[8];                                      
  1716.   unsigned short    active_sess;                                       
  1717.   unsigned char     zero_sess;          /* AP_NO, AP_YES                     */
  1718.   unsigned char     local_only;         /* AP_NO, AP_YES                     */
  1719.   unsigned char     syncpoint;          /* AP_NO, AP_YES                     */
  1720.   unsigned char     pool_member;        /* AP_NO, AP_YES                     */
  1721.   unsigned char     reserv3[4];                                        
  1722. };                                                                     
  1723. #endif                                                                 
  1724.  
  1725. struct get_type
  1726. {
  1727.   unsigned short    opcode;
  1728.   unsigned char     opext;
  1729.   unsigned char     reserv2;
  1730.   unsigned short    primary_rc;
  1731.   unsigned long     secondary_rc;
  1732.   unsigned char     tp_id[8];
  1733.   unsigned long     conv_id;
  1734.   unsigned char     conv_type;          /* AP_BASIC_CONVERSATION             */
  1735.                                         /* AP_MAPPED_CONVERSATION            */
  1736. };
  1737.  
  1738.  
  1739. struct get_state
  1740. {
  1741.   unsigned short    opcode;
  1742.   unsigned char     opext;
  1743.   unsigned char     reserv2;
  1744.   unsigned short    primary_rc;
  1745.   unsigned long     secondary_rc;
  1746.   unsigned char     tp_id[8];
  1747.   unsigned long     conv_id;
  1748.   unsigned char     conv_state;                             /* AP_RESET etc. */
  1749. };
  1750.  
  1751.  
  1752. /* 2PC - New verb: when DLL is handling transaction interfaces with DTC,     */
  1753. /* support explicit enlistment at TP's request.                              */
  1754.  
  1755. struct enlist
  1756. {
  1757.   unsigned short    opcode;
  1758.   unsigned char     opext;
  1759.   unsigned char     reserv2;
  1760.   unsigned short    primary_rc;
  1761.   unsigned long     secondary_rc;
  1762.   unsigned char     tp_id[8];
  1763.   unsigned long     conv_id;
  1764.   unsigned long     tran_id;                                   /* DTC TranId */
  1765. };                                                                      /*2PC*/
  1766.  
  1767.  
  1768.  
  1769. /************************************************************************IBM1*/
  1770. /* Add typedefs for OS/2 ES compatability.                              *IBM1*/
  1771. /************************************************************************IBM1*/
  1772. typedef struct tp_started            TP_STARTED;
  1773. typedef struct receive_allocate      RECEIVE_ALLOCATE;
  1774. typedef struct receive_allocate_ex   RECEIVE_ALLOCATE_EX;
  1775. typedef struct receive_allocate_ex_end RECEIVE_ALLOCATE_EX_END;
  1776. typedef struct tp_ended              TP_ENDED;
  1777. typedef struct mc_allocate           MC_ALLOCATE;
  1778. typedef struct mc_confirm            MC_CONFIRM;
  1779. typedef struct mc_confirmed          MC_CONFIRMED;
  1780. typedef struct mc_deallocate         MC_DEALLOCATE;
  1781. typedef struct mc_flush              MC_FLUSH;
  1782. typedef struct mc_get_attributes     MC_GET_ATTRIBUTES;
  1783. typedef struct mc_prepare_to_receive MC_PREPARE_TO_RECEIVE;
  1784. typedef struct mc_receive_and_post   MC_RECEIVE_AND_POST;
  1785. typedef struct mc_receive_and_wait   MC_RECEIVE_AND_WAIT;
  1786. typedef struct mc_receive_immediate  MC_RECEIVE_IMMEDIATE;
  1787. typedef struct mc_request_to_send    MC_REQUEST_TO_SEND;
  1788. typedef struct mc_send_conversation  MC_SEND_CONVERSATION;
  1789. typedef struct mc_send_data          MC_SEND_DATA;
  1790. typedef struct mc_send_error         MC_SEND_ERROR;
  1791. typedef struct mc_test_rts           MC_TEST_RTS;
  1792. typedef struct mc_test_rts_and_post  MC_TEST_RTS_AND_POST;             /*RPRP*/
  1793. #ifdef WIN32                                                           /*APOR*/
  1794. typedef struct mc_post_on_receipt    MC_POST_ON_RECEIPT;               /*APOR*/
  1795. #endif                                                                 /*APOR*/
  1796. typedef struct mc_receive_log_data   MC_RECEIVE_LOG_DATA;              /*RELD*/
  1797. typedef struct allocate              ALLOCATE;
  1798. typedef struct confirm               CONFIRM;
  1799. typedef struct confirmed             CONFIRMED;
  1800. typedef struct deallocate            DEALLOCATE;
  1801. typedef struct flush                 FLUSH;
  1802. typedef struct get_attributes        GET_ATTRIBUTES;
  1803. typedef struct prepare_to_receive    PREPARE_TO_RECEIVE;
  1804. typedef struct receive_and_post      RECEIVE_AND_POST;
  1805. typedef struct receive_and_wait      RECEIVE_AND_WAIT;
  1806. typedef struct receive_immediate     RECEIVE_IMMEDIATE;
  1807. typedef struct request_to_send       REQUEST_TO_SEND;
  1808. typedef struct send_conversation     SEND_CONVERSATION;
  1809. typedef struct send_data             SEND_DATA;
  1810. typedef struct send_error            SEND_ERROR;
  1811. typedef struct test_rts              TEST_RTS;
  1812. typedef struct test_rts_and_post     TEST_RTS_AND_POST;                /*RPRP*/
  1813. #ifdef WIN32                                                           /*APOR*/
  1814. typedef struct post_on_receipt       POST_ON_RECEIPT;                  /*APOR*/
  1815. #endif                                                                 /*APOR*/
  1816. typedef struct receive_log_data      RECEIVE_LOG_DATA;                 /*RELD*/
  1817. typedef struct get_tp_properties     GET_TP_PROPERTIES;
  1818. typedef struct get_type              GET_TYPE;
  1819. #ifdef SYNCPT_SUPPORT                                                  
  1820. typedef struct get_lu_status         GET_LU_STATUS;
  1821. typedef struct set_tp_properties     SET_TP_PROPERTIES;
  1822. #endif
  1823.  
  1824. /* ========================================================================= */
  1825. /*****************************************************************************/
  1826. /* ---------------------- APPC function prototypes ------------------------- */
  1827. /*****************************************************************************/
  1828.  
  1829. #ifdef WIN32                                                            /*W32*/
  1830.  #ifndef WINSNA                                                       /*WSNA2*/
  1831.   extern void pascal APPC(long);                                        /*W32*/
  1832.  #endif                                                               /*WSNA2*/
  1833. extern void pascal APPC_P(long);                                        /*W32*/
  1834. extern void pascal APPC_C(long);                                        /*W32*/
  1835. #else                                                                   /*W32*/
  1836.  #ifndef WINSNA                                                       /*WSNA2*/
  1837.   extern void pascal far _loadds APPC(long);                           /*1.1X*/
  1838.  #endif                                                               /*WSNA2*/
  1839. extern void pascal far _loadds APPC_P(long);                           /*1.1P*/
  1840. extern void pascal far _loadds APPC_C(long);
  1841. #endif                                                                  /*W32*/
  1842.  
  1843.  
  1844. /*****************************************************************************/
  1845. /* WinSNA function prototypes                                          *WSNA2*/
  1846. /*****************************************************************************/
  1847. #ifdef WINSNA
  1848.  
  1849.  
  1850. /*---------------------------------------------------------------------------*/
  1851. /* IOCP - Structure and function prototype                                   */
  1852. /*---------------------------------------------------------------------------*/
  1853. typedef struct
  1854. {
  1855.   HANDLE       APPC_CompletionPort;
  1856.   DWORD        APPC_NumberOfBytesTransferred;
  1857.   DWORD        APPC_CompletionKey;
  1858.   LPOVERLAPPED APPC_pOverlapped;
  1859.  
  1860. } APPC_IOCP_INFO;
  1861.  
  1862. extern HANDLE WINAPI WinAsyncAPPCIOCP(APPC_IOCP_INFO*, long);
  1863.  
  1864. /*---------------------------------------------------------------------------*/
  1865. /* Windows APPC Extension Return Codes.                                              */
  1866. /*---------------------------------------------------------------------------*/
  1867.  
  1868. #define WAPPCALREADY         0xF000   /* An async call is already outstanding */
  1869. #define WAPPCINVALID         0xF001   /* Async Task Id is invalid             */
  1870. #define WAPPCCANCEL          0xF002   /* Blocking call was cancelled          */
  1871. #define WAPPCSYSNOTREADY     0xF003   /* Underlying subsystem not started     */
  1872. #define WAPPCVERNOTSUPPORTED 0xF004   /* Application version not supported    */
  1873.  
  1874.  
  1875. /*----------------------------------------------------------------------------*/
  1876. /* Api structre definitions                                                   */
  1877. /*----------------------------------------------------------------------------*/
  1878. #define WAPPCDESCRIPTION_LEN    127
  1879.  
  1880. typedef struct tagWAPPCDATA
  1881. {
  1882.   WORD    wVersion;
  1883.   char    szDescription[WAPPCDESCRIPTION_LEN+1];
  1884. } WAPPCDATA, * PWAPPCDATA, FAR * LPWAPPCDATA;
  1885.  
  1886.  
  1887.  extern void    WINAPI APPC(long);
  1888.  extern HANDLE  WINAPI WinAsyncAPPC( HWND, long);
  1889.  extern HANDLE  WINAPI WinAsyncAPPCEx( HANDLE, long);                  /*EVNT*/
  1890.  extern BOOL    WINAPI WinAPPCCleanup(void);
  1891.  extern BOOL    WINAPI WinAPPCIsBlocking(void);
  1892.  extern int     WINAPI WinAPPCCancelAsyncRequest( HANDLE );
  1893.  extern BOOL    WINAPI WinAPPCCancelBlockingCall(void);
  1894.  extern int     WINAPI WinAPPCStartup(WORD, LPWAPPCDATA);
  1895.  extern FARPROC WINAPI WinAPPCSetBlockingHook(FARPROC);
  1896.  extern BOOL    WINAPI WinAPPCUnhookBlockingHook(void);
  1897.  extern int     WINAPI GetAppcReturnCode (struct appc_hdr FAR * vpb,   /*GRC */
  1898.                                           UINT        buffer_length,
  1899.                                           unsigned char FAR * buffer_addr);
  1900.  
  1901.  #define WIN_APPC_ASYNC_COMPLETE_MESSAGE "WinAsyncAPPC"
  1902.  
  1903.  
  1904. #endif
  1905.  
  1906.  
  1907. /*************************************************************************W32*/
  1908. /* for Win32 environment, restore original packing mode                  *W32*/
  1909. /*************************************************************************W32*/
  1910. #ifdef WIN32                                                            /*W32*/
  1911.                                                                         /*W32*/
  1912. #pragma pack()                                                          /*W32*/
  1913.                                                                         /*W32*/
  1914. #endif                                                                  /*W32*/
  1915.  
  1916. #ifdef __cplusplus
  1917. }
  1918. #endif
  1919.  
  1920. /*****************************************************************************/
  1921. /* End ifndef APPC_C_INCLUDED *DSP2*                                         */
  1922. /*****************************************************************************/
  1923. #pragma option pop /*P_O_Pop*/
  1924. #endif
  1925.  
  1926. /* winappc.h */
  1927.