home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / appccfg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  13.0 KB  |  175 lines

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /* Header: appccfg.h                                                         */
  5. /*                                                                           */
  6. /* (C) COPYRIGHT Data Connection Ltd 1993                                    */
  7. /* (C) COPYRIGHT Microsoft Corp.     1993                                    */
  8. /*                                                                           */
  9. /* Header for appccfg.c                                                      */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*  ----  14/05/93  CD  Initial coding                                       */
  13. /*****************************************************************************/
  14.  
  15.  
  16. /*****************************************************************************/
  17. /*                                                                           */
  18. /* HANDLE WINAPI GetAppcConfig( HANDLE hWnd, LPSTR pLocalLu, LPSTR pMode,    */
  19. /*                              LPINT pNumRemLu, INT iMaxRemLu, LPSTR pRemLu,*/
  20. /*                              LPINT pAsyncRetCode)                         */
  21. /*                                                                           */
  22. /* Parameters                                                                */
  23. /* ----------                                                                */
  24. /*                                                                           */
  25. /*  IN      hWnd      Handle of window to which completion is to be posted.  */
  26. /*                    If NULL no completion message will be posted but       */
  27. /*                    pAsyncRetCode must be valid. If hWnd is non-NULL it    */
  28. /*                    must be valid & pAsyncRetCode must be NULL.            */
  29. /*                                                                           */
  30. /*  IN      pLocalLU  Pointer to max 8 byte ASCII local LU name (should be 8 */
  31. /*                    ASCII blanks to request info on Remote LUs partnered   */
  32. /*                    to the default Local LU for this user. If none is      */
  33. /*                    configured then APPC_CFG_ERROR_NO_DEFAULT_LOCAL will   */
  34. /*                    be returned in the LPARAM).                            */
  35. /*                                                                           */
  36. /*  IN      pMode     Pointer to max 8 byte ASCII mode name (usually         */
  37. /*                    "QPCSUPP" for a 5250 emulator)                         */
  38. /*                                                                           */
  39. /*  IN/OUT  pNumRemLu Pointer to int to receive the number of Remote LUs     */
  40. /*                    available. (If more than MaxRemLu then only the first  */
  41. /*                    MaxRemLu of them will have been copied)                */
  42. /*                                                                           */
  43. /*  IN      iMaxRemLu Int giving the max number of Remote LU names the       */
  44. /*                    buffer can hold. (size of buffer in bytes / 9)         */
  45. /*                                                                           */
  46. /*  IN/OUT  pRemLu    Pointer to buffer to receive Remote LUs                */
  47. /*                    The data will be returned as an array of max 8 byte    */
  48. /*                    ASCII strings each followed by a terminating NULL      */
  49. /*                                                                           */
  50. /*  IN/OUT  pAsyncRetCode                                                    */
  51. /*                    Optional pointer to int to take the RetCode on         */
  52. /*                    completion of the async part of the call. Only         */
  53. /*                    required if hWnd is NULL. If the request is not        */
  54. /*                    accepted the value in AsyncRetCode is undefined.       */
  55. /*                    It the request was accepted then until the request is  */
  56. /*                    completed AsyncRetCode will contain the value          */
  57. /*                    APPC_CFG_PENDING. Final values are as in the LPARAM of */
  58. /*                    the completion message. If hWnd != NULL, pAsyncRetCode */
  59. /*                    must be NULL.                                          */
  60. /*                                                                           */
  61. /*                                                                           */
  62. /* Returns                                                                   */
  63. /* -------                                                                   */
  64. /*                                                                           */
  65. /* On Call                                                                   */
  66. /* -------                                                                   */
  67. /*  HANDLE  This VerbId will be returned in the WPARAM of any completion     */
  68. /*          message. (VerbId & APPC_CFG_SUCCESS) evaluates to TRUE if the    */
  69. /*          request was accepted.                                            */
  70. /*                                                                           */
  71. /*          If the above expression evaluates to FALSE then VerbId will      */
  72. /*          have one of the following values:                                */
  73. /*                                                                           */
  74. /*             APPC_CFG_ERROR_NO_APPC_INIT                                   */
  75. /*             APPC_CFG_ERROR_INVALID_HWND                                   */
  76. /*             APPC_CFG_ERROR_BAD_POINTER                                    */
  77. /*             APPC_CFG_ERROR_UNCLEAR_COMPLETION_MODE                        */
  78. /*             APPC_CFG_ERROR_TOO_MANY_REQUESTS                              */
  79. /*             APPC_CFG_ERROR_GENERAL_FAILURE                                */
  80. /*                                                                           */
  81. /*                                                                           */
  82. /*                                                                           */
  83. /* On Receipt of completion message                                          */
  84. /* --------------------------------                                          */
  85. /*  MSG     Equal to return from RegisterWindowMessage with                  */
  86. /*          WIN_APPC_CFG_COMPLETION_MSG passed as message name.              */
  87. /*                                                                           */
  88. /*  WPARAM  VerbId returned on the initiating call.                          */
  89. /*                                                                           */
  90. /*  LPARAM  Retcode which will be one of the following:                      */
  91. /*                                                                           */
  92. /*             APPC_CFG_SUCCESS_NO_DEFAULT_REMOTE                            */
  93. /*             APPC_CFG_SUCCESS_DEFAULT_REMOTE                               */
  94. /*                                                                           */
  95. /*             APPC_CFG_ERROR_NO_DEFAULT_LOCAL_LU                            */
  96. /*             APPC_CFG_ERROR_BAD_LOCAL_LU                                   */
  97. /*             APPC_CFG_ERROR_GENERAL_FAILURE                                */
  98. /*                                                                           */
  99. /*  (Retcode & APPC_CFG_ERROR)   evaluates to TRUE for an error retcode      */
  100. /*  (Retcode & APPC_CFG_SUCCESS) evaluates to TRUE for a success retcode     */
  101. /*                                                                           */
  102. /*                                                                           */
  103. /*                                                                           */
  104. /* Comments                                                                  */
  105. /* --------                                                                  */
  106. /*  This call attempts to get all the remote systems (partner LUs) which can */
  107. /*  be accessed by the logged on user with the given local LU and mode name. */
  108. /*  The final retcode also indicates if there is a default remote system     */
  109. /*  configured.                                                              */
  110. /*                                                                           */
  111. /*  Completion will either be signified by the posting of a completion       */
  112. /*  message or by the change of *pAsyncRetCode to a value other than         */
  113. /*  APPC_CFG_PENDING. The latter mechanism is intended for use by console    */
  114. /*  apps with no windows or on non-Windows platforms. Completion can then    */
  115. /*  be tested by code similar to the below:                                  */
  116. /*                                                                           */
  117. /*                while (*pAsyncRetCode == APPC_CFG_PENDING)                 */
  118. /*                {                                                          */
  119. /*                  sleep(250);                                              */
  120. /*                }                                                          */
  121. /*                                                                           */
  122. /*  Note that one of hWnd & pAsyncRetCode must be NULL and the other valid.  */
  123. /*  If this isn't the case APPC_CFG_ERROR_UNCLEAR_COMPLETION_MODE will be    */
  124. /*  returned.                                                                */
  125. /*                                                                           */
  126. /*  All strings are null terminated and are NOT space padded                 */
  127. /*                                                                           */
  128. /*  If the buffer is too short, the reported number of remote LU's available */
  129. /*  MAY be GREATER than the actual number. (This will only be the case where */
  130. /*  a particular Local Lu is configured at multiple nodes, and has the       */
  131. /*  remote on multiple nodes.) When the call is made again which a buffer    */
  132. /*  large enough to take all the remote LU, the reported number will be      */
  133. /*  correct.                                                                 */
  134. /*                                                                           */
  135. /*  ALL MEMORY TO WHICH POINTERS ARE PASSED MUST REMAIN VALID TILL A         */
  136. /*  COMPLETION MESSAGE IS RECEIVED                                           */
  137. /*                                                                           */
  138. /*  WinAPPCStartup MUST be called first                                      */
  139. /*                                                                           */
  140. /*****************************************************************************/
  141. /*****************************************************************************/
  142. /* Entry point prototype                                                     */
  143. /*****************************************************************************/
  144. extern HANDLE WINAPI GetAppcConfig( HANDLE hWnd, LPSTR pLocalLu, LPSTR pMode,
  145.                                  LPINT pNumRemLu, INT iMaxRemLu, LPSTR pRemLu,
  146.                                  LPINT pAsyncRetCode);
  147.  
  148. /*****************************************************************************/
  149. /* Completion Message Name                                                   */
  150. /*****************************************************************************/
  151. #define  WIN_APPC_CFG_COMPLETION_MSG "WinAppcCfg"
  152.  
  153. /*****************************************************************************/
  154. /* Test values                                                               */
  155. /*****************************************************************************/
  156. #define  APPC_CFG_SUCCESS                      0x1000
  157. #define  APPC_CFG_ERROR                        0x2000
  158. #define  APPC_CFG_PENDING                      0xFFFF
  159.  
  160. /*****************************************************************************/
  161. /* Retcodes                                                                  */
  162. /*****************************************************************************/
  163. #define  APPC_CFG_SUCCESS_NO_DEFAULT_REMOTE     (APPC_CFG_SUCCESS + 1)
  164. #define  APPC_CFG_SUCCESS_DEFAULT_REMOTE        (APPC_CFG_SUCCESS + 2)
  165.  
  166. #define  APPC_CFG_ERROR_NO_DEFAULT_LOCAL_LU     (APPC_CFG_ERROR + 1)
  167. #define  APPC_CFG_ERROR_BAD_LOCAL_LU            (APPC_CFG_ERROR + 2)
  168. #define  APPC_CFG_ERROR_GENERAL_FAILURE         (APPC_CFG_ERROR + 3)
  169. #define  APPC_CFG_ERROR_INVALID_HWND            (APPC_CFG_ERROR + 4)
  170. #define  APPC_CFG_ERROR_BAD_POINTER             (APPC_CFG_ERROR + 5)
  171. #define  APPC_CFG_ERROR_TOO_MANY_REQUESTS       (APPC_CFG_ERROR + 6)
  172. #define  APPC_CFG_ERROR_NO_APPC_INIT            (APPC_CFG_ERROR + 7)
  173. #define  APPC_CFG_ERROR_UNCLEAR_COMPLETION_MODE (APPC_CFG_ERROR + 8)
  174. #pragma option pop /*P_O_Pop*/
  175.