WinAppc.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:88k
源码类别:

模拟服务器

开发平台:

C/C++

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