home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / wincpic.h < prev    next >
Text File  |  1998-04-25  |  36KB  |  700 lines

  1. /* wincpic.h */
  2. /* Copyright Data Connection Ltd. 1992 */
  3. /* Copyright (c) 1992, Microsoft Corporation.  All rights reserved.          */
  4. /*****************************************************************************/
  5. /* CPI-Communications constants and function prototypes file                 */
  6. /*****************************************************************************/
  7.  
  8. #ifndef CMCH_INCLUDED
  9. #define CMCH_INCLUDED
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. /*****************************************************************************/
  16. /* Ensure the correct packing of structures                                  */
  17. /*****************************************************************************/
  18. #ifdef WIN32
  19.   #pragma pack(4)
  20. #endif
  21.  
  22. /*****************************************************************************/
  23. /* Type Definitions                                                          */
  24. /*****************************************************************************/
  25.  
  26.  
  27. #ifdef DOS5
  28. #define CM_INT32 signed long int
  29. #define CM_ENTRY extern void pascal far _loadds
  30. #define CM_PTR   far *
  31. #endif
  32.  
  33. #ifdef WINDOWS
  34. #define WINSNA
  35. #define CM_INT32 signed long int
  36. #define CM_ENTRY extern void pascal far _loadds
  37. #define CM_PTR   far *
  38. #endif
  39.  
  40. #ifdef WIN32
  41. #define WINSNA
  42. #ifdef SET_UNALIGNED_ACCESS_FOR_THUNK
  43. #define CM_INT32 signed long int UNALIGNED
  44. #else
  45. #define CM_INT32 signed long int
  46. #endif
  47. #define CM_ENTRY extern void WINAPI
  48. #define CM_PTR   *
  49. #define CM_EVENT_HANDLE HANDLE
  50. #endif
  51.  
  52. typedef CM_INT32 CM_CONVERSATION_STATE;
  53. typedef CM_INT32 CM_CONVERSATION_TYPE;
  54. typedef CM_INT32 CM_DATA_RECEIVED_TYPE;
  55. typedef CM_INT32 CM_DEALLOCATE_TYPE;
  56. typedef CM_INT32 CM_ERROR_DIRECTION;
  57. typedef CM_INT32 CM_FILL;
  58. typedef CM_INT32 CM_PREPARE_TO_RECEIVE_TYPE;
  59. typedef CM_INT32 CM_RECEIVE_TYPE;
  60. typedef CM_INT32 CM_REQUEST_TO_SEND_RECEIVED;
  61. typedef CM_INT32 CM_RETURN_CODE;
  62. typedef CM_INT32 CM_RETURN_CONTROL;
  63. typedef CM_INT32 CM_SEND_TYPE;
  64. typedef CM_INT32 CM_STATUS_RECEIVED;
  65. typedef CM_INT32 CM_SYNC_LEVEL;
  66. typedef CM_INT32 CM_END_TYPE;
  67. typedef CM_INT32 CM_PROCESSING_MODE;
  68.  
  69. typedef CM_INT32 XC_CONVERSATION_SECURITY_TYPE;
  70. typedef CM_INT32 XC_TP_NAME_TYPE;
  71.  
  72. /**STRUCT+********************************************************************/
  73. /* Side information struct used by xcmssi to define side information         */
  74. /*****************************************************************************/
  75. typedef struct side_info_entry
  76. {
  77.   unsigned char   sym_dest_name[8];            /* symbolic destination name  */
  78.   unsigned char   partner_LU_name[17];         /* fully Q'd PLU name         */
  79.   unsigned char   reserved[3];                 /* future expansion ??        */
  80.   XC_TP_NAME_TYPE TP_name_type;                /* set to XC_APPLICATION_TP   */
  81.                                                /*  or to XC_SNA_SERVICE_TP   */
  82.   unsigned char   TP_name[64];                 /* TP name                    */
  83.   unsigned char   mode_name[8];                /* mode name                  */
  84.   XC_CONVERSATION_SECURITY_TYPE
  85.                   conversation_security_type;  /* set to XC_SECURITY_NONE    */
  86.                                                /*  or to XC_SECURITY_SAME    */
  87.                                                /*  or to XC_SECURITY_PROGRAM */
  88.   unsigned char   security_user_ID[8];         /* user_ID                    */
  89.   unsigned char   security_password[8];        /* password                   */
  90. } SIDE_INFO;
  91. /**STRUCT-********************************************************************/
  92.  
  93.  
  94. /*****************************************************************************/
  95. /* Constant Definitions                                                      */
  96. /*****************************************************************************/
  97.  
  98. /*****************************************************************************/
  99. /* Values for the conversation_state                                         */
  100. /*****************************************************************************/
  101. #define CM_INITIALIZE_STATE              (CM_CONVERSATION_STATE) 2
  102. #define CM_SEND_STATE                    (CM_CONVERSATION_STATE) 3
  103. #define CM_RECEIVE_STATE                 (CM_CONVERSATION_STATE) 4
  104. #define CM_SEND_PENDING_STATE            (CM_CONVERSATION_STATE) 5
  105. #define CM_CONFIRM_STATE                 (CM_CONVERSATION_STATE) 6
  106. #define CM_CONFIRM_SEND_STATE            (CM_CONVERSATION_STATE) 7
  107. #define CM_CONFIRM_DEALLOCATE_STATE      (CM_CONVERSATION_STATE) 8
  108.  
  109. #define CM_DEFER_RECEIVE_STATE           (CM_CONVERSATION_STATE) 9
  110. #define CM_DEFER_DEALLOCATE_STATE        (CM_CONVERSATION_STATE) 10
  111. #define CM_SYNC_POINT_STATE              (CM_CONVERSATION_STATE) 11
  112. #define CM_SYNC_POINT_SEND_STATE         (CM_CONVERSATION_STATE) 12
  113. #define CM_SYNC_POINT_DEALLOCATE_STATE   (CM_CONVERSATION_STATE) 13
  114. #define CM_INITIALIZE_INCOMING_STATE     (CM_CONVERSATION_STATE) 14
  115.  
  116. /*****************************************************************************/
  117. /* Values for the conversation_type                                          */
  118. /*****************************************************************************/
  119. #define CM_BASIC_CONVERSATION   (CM_CONVERSATION_TYPE) 0
  120. #define CM_MAPPED_CONVERSATION  (CM_CONVERSATION_TYPE) 1
  121.  
  122.  
  123. /*****************************************************************************/
  124. /* Values for data_received                                                  */
  125. /*****************************************************************************/
  126. #define CM_NO_DATA_RECEIVED          (CM_DATA_RECEIVED_TYPE) 0
  127. #define CM_DATA_RECEIVED             (CM_DATA_RECEIVED_TYPE) 1
  128. #define CM_COMPLETE_DATA_RECEIVED    (CM_DATA_RECEIVED_TYPE) 2
  129. #define CM_INCOMPLETE_DATA_RECEIVED  (CM_DATA_RECEIVED_TYPE) 3
  130.  
  131.  
  132. /*****************************************************************************/
  133. /* Values for the deallocate_type                                            */
  134. /*****************************************************************************/
  135. #define CM_DEALLOCATE_SYNC_LEVEL  (CM_DEALLOCATE_TYPE) 0
  136. #define CM_DEALLOCATE_FLUSH       (CM_DEALLOCATE_TYPE) 1
  137. #define CM_DEALLOCATE_CONFIRM     (CM_DEALLOCATE_TYPE) 2
  138. #define CM_DEALLOCATE_ABEND       (CM_DEALLOCATE_TYPE) 3
  139.  
  140.  
  141. /*****************************************************************************/
  142. /* Values for the error_direction                                            */
  143. /*****************************************************************************/
  144. #define CM_RECEIVE_ERROR  (CM_ERROR_DIRECTION) 0
  145. #define CM_SEND_ERROR     (CM_ERROR_DIRECTION) 1
  146.  
  147.  
  148. /*****************************************************************************/
  149. /* Values for fill type                                                      */
  150. /*****************************************************************************/
  151. #define CM_FILL_LL      (CM_FILL) 0
  152. #define CM_FILL_BUFFER  (CM_FILL) 1
  153.  
  154.  
  155. /*****************************************************************************/
  156. /* Values for specify_processing_mode                                        */
  157. /*****************************************************************************/
  158. #define CM_BLOCKING                    (CM_PROCESSING_MODE) 0
  159. #define CM_NON_BLOCKING                (CM_PROCESSING_MODE) 1
  160.  
  161.  
  162. /*****************************************************************************/
  163. /* Values for prepare_to_receive_type                                        */
  164. /*****************************************************************************/
  165. #define CM_PREP_TO_RECEIVE_SYNC_LEVEL  (CM_PREPARE_TO_RECEIVE_TYPE) 0
  166. #define CM_PREP_TO_RECEIVE_FLUSH       (CM_PREPARE_TO_RECEIVE_TYPE) 1
  167. #define CM_PREP_TO_RECEIVE_CONFIRM     (CM_PREPARE_TO_RECEIVE_TYPE) 2
  168.  
  169.  
  170. /*****************************************************************************/
  171. /* Values for the receive_type                                               */
  172. /*****************************************************************************/
  173. #define CM_RECEIVE_AND_WAIT   (CM_RECEIVE_TYPE) 0
  174. #define CM_RECEIVE_IMMEDIATE  (CM_RECEIVE_TYPE) 1
  175.  
  176.  
  177. /*****************************************************************************/
  178. /* Values for request_to_send_received                                       */
  179. /*****************************************************************************/
  180. #define CM_REQ_TO_SEND_NOT_RECEIVED  (CM_REQUEST_TO_SEND_RECEIVED) 0
  181. #define CM_REQ_TO_SEND_RECEIVED      (CM_REQUEST_TO_SEND_RECEIVED) 1
  182.  
  183. /*****************************************************************************/
  184. /* Values for return_code (including CPI-RR value, which start at 100)       */
  185. /*****************************************************************************/
  186. #define CM_OK                            (CM_RETURN_CODE) 0
  187. #define CM_ALLOCATE_FAILURE_NO_RETRY     (CM_RETURN_CODE) 1
  188. #define CM_ALLOCATE_FAILURE_RETRY        (CM_RETURN_CODE) 2
  189. #define CM_CONVERSATION_TYPE_MISMATCH    (CM_RETURN_CODE) 3
  190. #define CM_PIP_NOT_SPECIFIED_CORRECTLY   (CM_RETURN_CODE) 5
  191. #define CM_SECURITY_NOT_VALID            (CM_RETURN_CODE) 6
  192. #define CM_SYNC_LVL_NOT_SUPPORTED_LU     (CM_RETURN_CODE) 7
  193. #define CM_SYNC_LVL_NOT_SUPPORTED_PGM    (CM_RETURN_CODE) 8
  194. #define CM_TPN_NOT_RECOGNIZED            (CM_RETURN_CODE) 9
  195.  
  196. #define CM_SYNC_LEVEL_NOT_SUPPORTED_LU   (CM_RETURN_CODE) 7
  197. #define CM_SYNC_LEVEL_NOT_SUPPORTED_PGM  (CM_RETURN_CODE) 8
  198. #define CM_TPN_NOT_RECOGNISED            (CM_RETURN_CODE) 9
  199.  
  200. #define CM_TP_NOT_AVAILABLE_NO_RETRY     (CM_RETURN_CODE) 10
  201. #define CM_TP_NOT_AVAILABLE_RETRY        (CM_RETURN_CODE) 11
  202. #define CM_DEALLOCATED_ABEND             (CM_RETURN_CODE) 17
  203. #define CM_DEALLOCATED_NORMAL            (CM_RETURN_CODE) 18
  204. #define CM_PARAMETER_ERROR               (CM_RETURN_CODE) 19
  205. #define CM_PRODUCT_SPECIFIC_ERROR        (CM_RETURN_CODE) 20
  206. #define CM_PROGRAM_ERROR_NO_TRUNC        (CM_RETURN_CODE) 21
  207. #define CM_PROGRAM_ERROR_PURGING         (CM_RETURN_CODE) 22
  208. #define CM_PROGRAM_ERROR_TRUNC           (CM_RETURN_CODE) 23
  209. #define CM_PROGRAM_PARAMETER_CHECK       (CM_RETURN_CODE) 24
  210. #define CM_PROGRAM_STATE_CHECK           (CM_RETURN_CODE) 25
  211. #define CM_RESOURCE_FAILURE_NO_RETRY     (CM_RETURN_CODE) 26
  212. #define CM_RESOURCE_FAILURE_RETRY        (CM_RETURN_CODE) 27
  213. #define CM_UNSUCCESSFUL                  (CM_RETURN_CODE) 28
  214. #define CM_DEALLOCATED_ABEND_SVC         (CM_RETURN_CODE) 30
  215. #define CM_DEALLOCATED_ABEND_TIMER       (CM_RETURN_CODE) 31
  216. #define CM_SVC_ERROR_NO_TRUNC            (CM_RETURN_CODE) 32
  217. #define CM_SVC_ERROR_PURGING             (CM_RETURN_CODE) 33
  218. #define CM_SVC_ERROR_TRUNC               (CM_RETURN_CODE) 34
  219.  
  220. #define CM_OPERATION_INCOMPLETE          (CM_RETURN_CODE) 35
  221. #define CM_SYSTEM_EVENT                  (CM_RETURN_CODE) 36
  222. #define CM_OPERATION_NOT_ACCEPTED        (CM_RETURN_CODE) 37
  223.  
  224. #define CM_TAKE_BACKOUT                  (CM_RETURN_CODE) 100
  225. #define CM_DEALLOCATED_ABEND_BO          (CM_RETURN_CODE) 130
  226. #define CM_DEALLOCATED_ABEND_SVC_BO      (CM_RETURN_CODE) 131
  227. #define CM_DEALLOCATED_ABEND_TIMER_BO    (CM_RETURN_CODE) 132
  228. #define CM_RESOURCE_FAIL_NO_RETRY_BO     (CM_RETURN_CODE) 133
  229. #define CM_RESOURCE_FAILURE_RETRY_BO     (CM_RETURN_CODE) 134
  230. #define CM_DEALLOCATED_NORMAL_BO         (CM_RETURN_CODE) 135
  231.  
  232. /*****************************************************************************/
  233. /* Values for return_control                                                 */
  234. /*****************************************************************************/
  235. #define CM_WHEN_SESSION_ALLOCATED  (CM_RETURN_CONTROL) 0
  236. #define CM_IMMEDIATE               (CM_RETURN_CONTROL) 1
  237.  
  238.  
  239. /*****************************************************************************/
  240. /* Values for the send_type                                                  */
  241. /*****************************************************************************/
  242. #define CM_BUFFER_DATA               (CM_SEND_TYPE) 0
  243. #define CM_SEND_AND_FLUSH            (CM_SEND_TYPE) 1
  244. #define CM_SEND_AND_CONFIRM          (CM_SEND_TYPE) 2
  245. #define CM_SEND_AND_PREP_TO_RECEIVE  (CM_SEND_TYPE) 3
  246. #define CM_SEND_AND_DEALLOCATE       (CM_SEND_TYPE) 4
  247.  
  248.  
  249. /*****************************************************************************/
  250. /* Values for status_received                                                */
  251. /*****************************************************************************/
  252. #define CM_NO_STATUS_RECEIVED        (CM_STATUS_RECEIVED) 0
  253. #define CM_SEND_RECEIVED             (CM_STATUS_RECEIVED) 1
  254. #define CM_CONFIRM_RECEIVED          (CM_STATUS_RECEIVED) 2
  255. #define CM_CONFIRM_SEND_RECEIVED     (CM_STATUS_RECEIVED) 3
  256. #define CM_CONFIRM_DEALLOC_RECEIVED  (CM_STATUS_RECEIVED) 4
  257.  
  258. #define CM_TAKE_COMMIT               (CM_STATUS_RECEIVED) 5
  259. #define CM_TAKE_COMMIT_SEND          (CM_STATUS_RECEIVED) 6
  260. #define CM_TAKE_COMMIT_DEALLOCATE    (CM_STATUS_RECEIVED) 7
  261.  
  262. /*****************************************************************************/
  263. /* Values for the sync_level                                                 */
  264. /*****************************************************************************/
  265. #define CM_NONE     (CM_SYNC_LEVEL) 0
  266. #define CM_CONFIRM  (CM_SYNC_LEVEL) 1
  267.  
  268. /*****************************************************************************/
  269. /* Values for maximum sizes of strings and buffers                           */
  270. /*****************************************************************************/
  271. #define CM_CID_SIZE   (8)         /* conversation ID           */
  272. #define CM_CTX_SIZE   (32)        /* context ID                */
  273. #define CM_LD_SIZE    (512)       /* log data                  */
  274. #define CM_MN_SIZE    (8)         /* mode name                 */
  275. #define CM_PLN_SIZE   (17)        /* partner LU name           */
  276. #define CM_PW_SIZE    (10)        /* password                  */
  277. #define CM_SDN_SIZE   (8)         /* symbolic destination name */
  278. #define CM_TPN_SIZE   (64)        /* TP name                   */
  279. #define CM_UID_SIZE   (10)        /* userid ID                 */
  280.  
  281. /*****************************************************************************/
  282. /* Values for the conversation_security_type (NS/2 compatible)               */
  283. /*****************************************************************************/
  284. #define XC_SECURITY_NONE     (XC_CONVERSATION_SECURITY_TYPE) 0
  285. #define XC_SECURITY_SAME     (XC_CONVERSATION_SECURITY_TYPE) 1
  286. #define XC_SECURITY_PROGRAM  (XC_CONVERSATION_SECURITY_TYPE) 2
  287.  
  288.  
  289. /*****************************************************************************/
  290. /* Values for the TP_name_type (NS/2 compatible)                             */
  291. /*****************************************************************************/
  292. #define XC_APPLICATION_TP  (XC_TP_NAME_TYPE) 0
  293. #define XC_SNA_SERVICE_TP  (XC_TP_NAME_TYPE) 1
  294.  
  295.  
  296. /*****************************************************************************/
  297. /* Function prototypes for CPIC call routines                                */
  298. /*****************************************************************************/
  299.  
  300. /* Accept_Conversation */
  301. CM_ENTRY cmaccp(unsigned char CM_PTR,               /* conversation_ID       */
  302.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  303.  
  304. /* Allocate */
  305. CM_ENTRY cmallc(unsigned char CM_PTR,               /* conversation_ID       */
  306.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  307.  
  308. /* Cancel_Conversation */
  309. CM_ENTRY cmcanc(unsigned char CM_PTR,               /* conversation_ID       */
  310.                 CM_INT32 CM_PTR);                   /* return_code     *WSNA1*/
  311.  
  312. /* Confirm */
  313. CM_ENTRY cmcfm(unsigned char CM_PTR,                /* conversation_ID       */
  314.                CM_REQUEST_TO_SEND_RECEIVED CM_PTR,  /* request_to_send_rec.. */
  315.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  316.  
  317. /* Confirmed */
  318. CM_ENTRY cmcfmd(unsigned char CM_PTR,               /* conversation_ID       */
  319.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  320.  
  321. /* Deallocate */
  322. CM_ENTRY cmdeal(unsigned char CM_PTR,               /* conversation_ID       */
  323.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  324.  
  325. /* Extract_Conversation_State */
  326. CM_ENTRY cmecs(unsigned char CM_PTR,                /* conversation_ID       */
  327.                CM_CONVERSATION_STATE CM_PTR,        /* conversation_state    */
  328.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  329.  
  330. /* Extract_Conversation_Type */
  331. CM_ENTRY cmect(unsigned char CM_PTR,                /* conversation_ID       */
  332.                CM_CONVERSATION_TYPE CM_PTR,         /* conversation type     */
  333.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  334.  
  335. /* Extract_Mode_Name */
  336. CM_ENTRY cmemn(unsigned char CM_PTR,                /* conversation_ID       */
  337.                unsigned char CM_PTR,                /* mode_name             */
  338.                CM_INT32 CM_PTR,                     /* mode_name_length      */
  339.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  340.  
  341. /* Extract_Partner_LU_Name */
  342. CM_ENTRY cmepln(unsigned char CM_PTR,               /* conversation_ID       */
  343.                 unsigned char CM_PTR,               /* partner_LU_name       */
  344.                 CM_INT32 CM_PTR,                    /* partner_LU_name_len.. */
  345.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  346.  
  347. /* Extract_Sync_Level */
  348. CM_ENTRY cmesl(unsigned char CM_PTR,                /* conversation_ID       */
  349.                CM_SYNC_LEVEL CM_PTR,                /* sync_level            */
  350.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  351.  
  352. /* Extract_TP_Name */
  353. CM_ENTRY cmetpn(unsigned char CM_PTR,               /* conversation_ID       */
  354.                 unsigned char CM_PTR,               /* TP_name               */
  355.                 CM_INT32 CM_PTR,                    /* TP_name_length        */
  356.                 CM_INT32 CM_PTR);                   /* return_code     *WSNA1*/
  357.  
  358. /* Flush */
  359. CM_ENTRY cmflus(unsigned char CM_PTR,               /* conversation_ID       */
  360.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  361.  
  362. /* Initialize_Conversation */
  363. CM_ENTRY cminit(unsigned char CM_PTR,               /* conversation_ID       */
  364.                 unsigned char CM_PTR,               /* sym_dest_name         */
  365.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  366.  
  367. /* Prepare_To_Receive */
  368. CM_ENTRY cmptr(unsigned char CM_PTR,                /* conversation_ID       */
  369.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  370.  
  371. /* Receive */
  372. CM_ENTRY cmrcv(unsigned char CM_PTR,                /* conversation_ID       */
  373.                unsigned char CM_PTR,                /* buffer                */
  374.                CM_INT32 CM_PTR,                     /* requested_length      */
  375.                CM_DATA_RECEIVED_TYPE CM_PTR,        /* data_received         */
  376.                CM_INT32 CM_PTR,                     /* received_length       */
  377.                CM_STATUS_RECEIVED CM_PTR,           /* status_received       */
  378.                CM_REQUEST_TO_SEND_RECEIVED CM_PTR,  /* request_to_send_rec.. */
  379.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  380.  
  381. /* Request_To_Send */
  382. CM_ENTRY cmrts(unsigned char CM_PTR,                /* conversation_ID       */
  383.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  384.  
  385. /* Send */
  386. CM_ENTRY cmsend(unsigned char CM_PTR,               /* conversation_ID       */
  387.                 unsigned char CM_PTR,               /* buffer                */
  388.                 CM_INT32 CM_PTR,                    /* send_length           */
  389.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  390.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  391.  
  392. /* Send_Error */
  393. CM_ENTRY cmserr(unsigned char CM_PTR,               /* conversation_ID       */
  394.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  395.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  396.  
  397. /* Set_Conversation_Type */
  398. CM_ENTRY cmsct(unsigned char CM_PTR,                /* conversation_ID       */
  399.                CM_CONVERSATION_TYPE CM_PTR,         /* conversation_type     */
  400.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  401.  
  402. /* Set_Deallocate_Type */
  403. CM_ENTRY cmsdt(unsigned char CM_PTR,                /* conversation_ID       */
  404.                CM_DEALLOCATE_TYPE CM_PTR,           /* deallocate_type       */
  405.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  406.  
  407. /* Set_Error_Direction */
  408. CM_ENTRY cmsed(unsigned char CM_PTR,                /* conversation_ID       */
  409.                CM_ERROR_DIRECTION CM_PTR,           /* error_direction       */
  410.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  411.  
  412. /* Set_Fill */
  413. CM_ENTRY cmsf(unsigned char CM_PTR,                 /* conversation_ID       */
  414.               CM_FILL CM_PTR,                       /* fill                  */
  415.               CM_RETURN_CODE CM_PTR);               /* return_code           */
  416.  
  417. /* Set_Log_Data */
  418. CM_ENTRY cmsld(unsigned char CM_PTR,                /* conversation_ID       */
  419.                unsigned char CM_PTR,                /* log_data              */
  420.                CM_INT32 CM_PTR,                     /* log_data_length       */
  421.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  422.  
  423. /* Specify_Local_TP_Name */
  424. CM_ENTRY cmsltp(unsigned char CM_PTR,            /* TP name             */
  425.         CM_INT32 CM_PTR,             /* TP_name_length          */
  426.         CM_INT32 CM_PTR);            /* return_code     *WSNA1*/
  427.  
  428. /* Set_Processing_Mode */
  429. CM_ENTRY cmspm(unsigned char CM_PTR,                /* conversation_ID       */
  430.                CM_INT32 CM_PTR,                     /* processing mode       */
  431.                CM_INT32 CM_PTR);                    /* return_code     *WSNA1*/
  432.  
  433.  
  434. /* Set_Mode_Name */
  435. CM_ENTRY cmsmn(unsigned char CM_PTR,                /* conversation_ID       */
  436.                unsigned char CM_PTR,                /* mode_name             */
  437.                CM_INT32 CM_PTR,                     /* mode_name_length      */
  438.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  439.  
  440. /* Set_Partner_LU_Name */
  441. CM_ENTRY cmspln(unsigned char CM_PTR,               /* conversation_ID       */
  442.                 unsigned char CM_PTR,               /* partner_LU_name       */
  443.                 CM_INT32 CM_PTR,                    /* partner_LU_name_len.. */
  444.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  445.  
  446. /* Set_Prepare_To_Receive_Type */
  447. CM_ENTRY cmsptr(unsigned char CM_PTR,               /* conversation_ID       */
  448.                 CM_PREPARE_TO_RECEIVE_TYPE CM_PTR,  /* prepare_to_receive_.. */
  449.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  450.  
  451. /* Set_Receive_Type */
  452. CM_ENTRY cmsrt(unsigned char CM_PTR,                /* conversation_ID       */
  453.                CM_RECEIVE_TYPE CM_PTR,              /* receive_type          */
  454.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  455.  
  456. /* Set_Return_Control */
  457. CM_ENTRY cmsrc(unsigned char CM_PTR,                /* conversation_ID       */
  458.                CM_RETURN_CONTROL CM_PTR,            /* return_control        */
  459.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  460.  
  461. /* Set_Send_Type */
  462. CM_ENTRY cmsst(unsigned char CM_PTR,                /* conversation_ID       */
  463.                CM_SEND_TYPE CM_PTR,                 /* send_type             */
  464.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  465.  
  466. /* Set_Sync_Level */
  467. CM_ENTRY cmssl(unsigned char CM_PTR,                /* conversation_ID       */
  468.                CM_SYNC_LEVEL CM_PTR,                /* sync_level            */
  469.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  470.  
  471. /* Set_TP_name */
  472. CM_ENTRY cmstpn(unsigned char CM_PTR,               /* conversation_ID       */
  473.                 unsigned char CM_PTR,               /* TP_name               */
  474.                 CM_INT32 CM_PTR,                    /* TP_name_legth         */
  475.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  476.  
  477. /* Test_Request_To_Send_Received */
  478. CM_ENTRY cmtrts(unsigned char CM_PTR,               /* conversation_ID       */
  479.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  480.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  481.  
  482. /* Wait_For_Conversation */
  483. CM_ENTRY cmwait(unsigned char CM_PTR,               /* conversation_ID       */
  484.                 CM_INT32 CM_PTR,                    /* conversation ret code */
  485.                 CM_INT32 CM_PTR);                   /* return_code     *WSNA1*/
  486.  
  487. /*****************************************************************************/
  488. /* Function Prototypes for additional NS/2 compatible call routines          */
  489. /*****************************************************************************/
  490.  
  491. /* Delete_CPIC_Side_Information */
  492. CM_ENTRY xcmdsi(unsigned char CM_PTR,               /* key_lock              */
  493.                 unsigned char CM_PTR,               /* sym_dest_name         */
  494.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  495.  
  496. /* Extract_CPIC_Side_Information */
  497. CM_ENTRY xcmesi(CM_INT32 CM_PTR,                    /* entry_number          */
  498.                 unsigned char CM_PTR,                       /* sym_dest_name         */
  499.                 SIDE_INFO CM_PTR,                   /* side_info_entry       */
  500.                 CM_INT32 CM_PTR,                    /* side_info_length      */
  501.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  502.  
  503. /* Set_CPIC_Side_Information */
  504. CM_ENTRY xcmssi(unsigned char CM_PTR,               /* key_lock              */
  505.                 SIDE_INFO CM_PTR,                   /* side_info_entry       */
  506.                 CM_INT32 CM_PTR,                    /* side_info length      */
  507.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  508.  
  509. /* Extract_Conversation_Security_Type */
  510. CM_ENTRY xcecst(unsigned char CM_PTR,               /* conversation_ID       */
  511.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  512.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  513.  
  514. /* Extract_Conversation_User_ID */
  515. CM_ENTRY xcecsu(unsigned char CM_PTR,               /* conversation_ID       */
  516.                 unsigned char CM_PTR,               /* user_ID               */
  517.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  518.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  519.  
  520. /* Set_Conversation_Security_Password */
  521. CM_ENTRY xcscsp(unsigned char CM_PTR,               /* conversation_ID       */
  522.                 unsigned char CM_PTR,               /* password              */
  523.                 CM_INT32 CM_PTR,                    /* password_length       */
  524.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  525.  
  526. /* Set_Conversation_Security_Type */
  527. CM_ENTRY xcscst(unsigned char CM_PTR,               /* conversation_ID       */
  528.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  529.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  530.  
  531. /* Set_Conversation_Security_User_ID */
  532. CM_ENTRY xcscsu(unsigned char CM_PTR,               /* conversation_ID       */
  533.                 unsigned char CM_PTR,               /* user_ID               */
  534.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  535.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  536.  
  537.  
  538. /*****************************************************************************/
  539. /* Also have new prototypes with cm not xc                                   */
  540. /*****************************************************************************/
  541. /* Extract_Conversation_Security_Type */
  542. CM_ENTRY cmecst(unsigned char CM_PTR,               /* conversation_ID       */
  543.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  544.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  545.  
  546. /* Extract_Conversation_User_ID */
  547. CM_ENTRY cmecsu(unsigned char CM_PTR,               /* conversation_ID       */
  548.                 unsigned char CM_PTR,               /* user_ID               */
  549.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  550.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  551.  
  552. /* Set_Conversation_Security_Password */
  553. CM_ENTRY cmscsp(unsigned char CM_PTR,               /* conversation_ID       */
  554.                 unsigned char CM_PTR,               /* password              */
  555.                 CM_INT32 CM_PTR,                    /* password_length       */
  556.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  557.  
  558. /* Set_Conversation_Security_Type */
  559. CM_ENTRY cmscst(unsigned char CM_PTR,               /* conversation_ID       */
  560.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  561.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  562.  
  563. /* Set_Conversation_Security_User_ID */
  564. CM_ENTRY cmscsu(unsigned char CM_PTR,               /* conversation_ID       */
  565.                 unsigned char CM_PTR,               /* user_ID               */
  566.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  567.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  568.  
  569. #ifdef WINSNA
  570. /* Specify_Windows_Handle */
  571. CM_ENTRY xchwnd(HWND,                               /* Window HWND     *WSNA1*/
  572.                 CM_INT32 CM_PTR);                   /* return_code           */
  573. #endif
  574.  
  575. /*****************************************************************************/
  576. /* Function prototypes for undocumented NS/2 compatible call routines.  As   */
  577. /* these routines are undocumented the prototypes do not include any         */
  578. /* parameters.  These are needed to allow binary compatibility with NS/2     */
  579. /* CPI-C applications, with the proviso that only documented calls are       */
  580. /* actually used.                                                            */
  581. /*****************************************************************************/
  582.  
  583. CM_ENTRY allocate_memory();
  584. CM_ENTRY free_cpic_memory();
  585. CM_ENTRY icmssi();
  586.  
  587.  
  588. #ifdef WINSNA
  589. /*---------------------------------------------------------------------------*/
  590. /* Windows CPI-C Extention Return Codes.                                     */
  591. /*---------------------------------------------------------------------------*/
  592.  
  593. #define WCPICALREADY         0xF000   /* An async call is already outstanding */
  594. #define WCPICINVALID         0xF001   /* Async Task Id is invalid             */
  595. #define WCPICCANCEL          0xF002   /* Blocking call was cancelled          */
  596. #define WCPICSYSNOTREADY     0xF003   /* Underlying subsystem not started     */
  597. #define WCPICVERNOTSUPPORTED 0xF004   /* Application version not supported    */
  598.  
  599.  
  600. /*----------------------------------------------------------------------------*/
  601. /* Api structre definitions                                                   */
  602. /*----------------------------------------------------------------------------*/
  603. #define WCPICDESCRIPTION_LEN    127
  604.  
  605. typedef struct tagWCPICDATA {
  606.         WORD    wVersion;
  607.         char    szDescription[WCPICDESCRIPTION_LEN+1];
  608. } WCPICDATA, * PWCPICDATA, FAR * LPWCPICDATA;
  609.  
  610. /*****************************************************************************/
  611. /* ------------- Windows CPI-C function prototypes ------------------------- */
  612. /*****************************************************************************/
  613.  
  614. extern BOOL WINAPI    WinCPICCleanup(void);
  615. extern BOOL WINAPI    WinCPICIsBlocking(void);
  616. extern int WINAPI     WinCPICStartup(WORD, LPWCPICDATA );
  617. extern FARPROC WINAPI WinCPICSetBlockingHook( FARPROC );
  618. extern BOOL WINAPI    WinCPICUnhookBlockingHook(void);
  619. #ifdef WIN32
  620. extern VOID WINAPI    WinCPICSetEvent(unsigned char   CM_PTR,
  621.                                       CM_EVENT_HANDLE CM_PTR,
  622.                                       CM_RETURN_CODE CM_PTR);
  623. extern VOID WINAPI    WinCPICExtractEvent(unsigned char   CM_PTR,
  624.                                           CM_EVENT_HANDLE CM_PTR,
  625.                                           CM_RETURN_CODE CM_PTR);
  626. #endif
  627.  
  628. #define WIN_CPIC_ASYNC_COMPLETE_MESSAGE "WinAsyncCPI-C"
  629.  
  630. #endif
  631.  
  632. /*
  633.  * These macros allow you to write programs that are easier to read, since
  634.  * you can use the full name of the CPI-C call rather than its 6 character
  635.  * entry point.
  636.  *
  637.  * When porting code that uses these macros, you will have to ensure that
  638.  * the macros are defined on the target platform.
  639.  */
  640.  
  641. #ifdef READABLE_MACROS
  642.  
  643. #define Accept_Conversation(v1,v2)            cmaccp(v1,v2)
  644. #define Allocate(v1,v2)                       cmallc(v1,v2)
  645. #define Cancel_Conversation(v1,v2)            cmcanc(v1,v2)
  646. #define Confirm(v1,v2,v3)                     cmcfm(v1,v2,v3)
  647. #define Confirmed(v1,v2)                      cmcfmd(v1,v2)
  648. #define Deallocate(v1,v2)                     cmdeal(v1,v2)
  649. #define Extract_Conversation_Security_User_ID(v1,v2,v3,v4)  cmecsu(v1,v2,v3,v4)
  650. #define Extract_Conversation_Security_Type(v1,v2,v3) cmecst(v1,v2,v3)
  651. #define Extract_Mode_Name(v1,v2,v3,v4)        cmemn(v1,v2,v3,v4)
  652. #define Extract_Partner_LU_Name(v1,v2,v3,v4)  cmepln(v1,v2,v3,v4)
  653. #define Extract_Sync_Level(v1,v2,v3)          cmesl(v1,v2,v3)
  654. #define Extract_TP_Name(v1,v2,v3,v4)          cmetpn(v1,v2,v3,v4)
  655. #define Flush(v1,v2)                          cmflus(v1,v2)
  656. #define Initialize_Conversation(v1,v2,v3)     cminit(v1,v2,v3)
  657. #define Prepare_To_Receive(v1,v2)             cmptr(v1,v2)
  658. #define Receive(v1,v2,v3,v4,v5,v6,v7,v8)      cmrcv(v1,v2,v3,v4,v5,v6,v7,v8)
  659. #define Request_To_Send(v1,v2)                cmrts(v1,v2)
  660. #define Send_Error(v1,v2,v3)                  cmserr(v1,v2,v3)
  661. #define Set_Conversation_Type(v1,v2,v3)       cmsct(v1,v2,v3)
  662. #define Set_Deallocate_Type(v1,v2,v3)         cmsdt(v1,v2,v3)
  663. #define Set_Error_Direction(v1,v2,v3)         cmsed(v1,v2,v3)
  664. #define Send_Data(v1,v2,v3,v4,v5)             cmsend(v1,v2,v3,v4,v5)
  665. #define Set_Fill(v1,v2,v3)                    cmsf(v1,v2,v3)
  666. #define Set_Log_Data(v1,v2,v3,v4)             cmsld(v1,v2,v3,v4)
  667. #define Set_Mode_Name(v1,v2,v3,v4)            cmsmn(v1,v2,v3,v4)
  668. #define Set_Partner_LU_Name(v1,v2,v3,v4)      cmspln(v1,v2,v3,v4)
  669. #define Set_Prepare_To_Receive_Type(v1,v2,v3) cmsptr(v1,v2,v3)
  670. #define Set_Processing_Mode(v1,v2,v3)         cmspm(v1,v2,v3)
  671. #define Set_Receive_Type(v1,v2,v3)            cmsrt(v1,v2,v3)
  672. #define Set_Return_Control(v1,v2,v3)          cmsrc(v1,v2,v3)
  673. #define Set_Send_Type(v1,v2,v3)               cmsst(v1,v2,v3)
  674. #define Set_Sync_Level(v1,v2,v3)              cmssl(v1,v2,v3)
  675. #define Set_TP_Name(v1,v2,v3,v4)              cmstpn(v1,v2,v3,v4)
  676. #define Specify_Local_TP_Name(v1,v2,v3)       cmsltp(v1,v2,v3)
  677. #define Set_Conversation_Security_Password(v1,v2,v3,v4) cmscsp(v1,v2,v3,v4)
  678. #define Set_Conversation_Security_Type(v1,v2,v3) cmscst(v1,v2,v3)
  679. #define Set_Conversation_Security_User_ID(v1,v2,v3,v4) cmscsu(v1,v2,v3,v4)
  680. #define Test_Request_To_Send_Received(v1,v2,v3) cmtrts(v1,v2,v3)
  681. #define Wait_For_Conversation(v1,v2,v3)       cmwait(v1,v2,v3)
  682. #define Specify_Windows_Handle(v1,v2)         xchwnd(v1,v2)
  683.  
  684. #endif
  685.  
  686. #ifdef __cplusplus
  687. }
  688. #endif
  689.  
  690. /*****************************************************************************/
  691. /* Restore to default packing of structures                                  */
  692. /*****************************************************************************/
  693. #ifdef WIN32
  694.   #pragma pack()
  695. #endif
  696.  
  697. #endif
  698.  
  699. 
  700.