Commit c26f54c38ca66f32773f630a36b672e49c7d775a

Authored by Perry Werneck
1 parent 4215ba24

Ajustes para #1 - Pesquisando retornos HLLAPI.

src/include/pw3270/hllapi.h
@@ -57,15 +57,48 @@ extern "C" { @@ -57,15 +57,48 @@ extern "C" {
57 #define HLLAPI_CMD_GETREVISION 2000 /**< Get lib3270 revision */ 57 #define HLLAPI_CMD_GETREVISION 2000 /**< Get lib3270 revision */
58 58
59 59
60 - /* Result codes */ 60 + /* Standard Return Codes - http://ps-2.kev009.com/tl/techlib/manuals/adoclib/3270hcon/hconugd/retrncod.htm#C20819C058kmar */
  61 +
  62 + // 00 Either the function was successfully executed, or there were no host updates since the last call was issued.
61 #define HLLAPI_STATUS_SUCCESS 0 /**< Good return code */ 63 #define HLLAPI_STATUS_SUCCESS 0 /**< Good return code */
  64 +
  65 + // 01 Either the presentation space short session ID was invalid, or the application is not connected.
62 #define HLLAPI_STATUS_DISCONNECTED 1 /**< The presentation space was not valid or not connected. */ 66 #define HLLAPI_STATUS_DISCONNECTED 1 /**< The presentation space was not valid or not connected. */
  67 +
  68 + // 02 A parameter error occurred.
63 #define HLLAPI_STATUS_BAD_PARAMETER 2 /**< An incorrect option was specified. */ 69 #define HLLAPI_STATUS_BAD_PARAMETER 2 /**< An incorrect option was specified. */
  70 +
  71 + // 04 The execution of the function was inhibited because the target presentation space was busy.
  72 + // For example, X or XSYSTEM is displayed in the OIA for the 3270 terminal emulation.
64 #define HLLAPI_STATUS_TIMEOUT 4 /**< Timeout */ 73 #define HLLAPI_STATUS_TIMEOUT 4 /**< Timeout */
  74 +
  75 + // 05 The execution of the function was inhibited for some reason other than the reasons stated in return code 4.
65 #define HLLAPI_STATUS_KEYBOARD_LOCKED 5 /**< The keyboard is locked. */ 76 #define HLLAPI_STATUS_KEYBOARD_LOCKED 5 /**< The keyboard is locked. */
66 - #define HLLAPI_STATUS_UNAVAILABLE 11 /**< Resource unavailable at this time */ 77 +
  78 + // 06 A data error occurred due to specification of an invalid parameter (for example, a length error causing truncation).
  79 + // 07 The specified presentation space position was invalid.
  80 + // 08 No prerequisite function was issued.
  81 +
  82 + // 09 A system error occurred.
67 #define HLLAPI_STATUS_SYSTEM_ERROR 9 /**< A system error occurred */ 83 #define HLLAPI_STATUS_SYSTEM_ERROR 9 /**< A system error occurred */
68 84
  85 + // 10 The function number is not supported by the emulation program.
  86 + #define HLLAPI_STATUS_UNSUPPORTED 10
  87 +
  88 + // 11 The resource that you requested is unavailable (for example, too many attempts have been made to connect to the same presentation space (PS) or another application is connected to the PS).
  89 + #define HLLAPI_STATUS_UNAVAILABLE 11 /**< Resource unavailable at this time */
  90 +
  91 + // 20 Invalid keystroke caused by ESC= option.
  92 + // 21 OIA was updated.
  93 + // 22 PS was updated.
  94 + // 23 Both OIA and PS were updated.
  95 + // 24 Either the string was not found, or the presentation space is unformatted.
  96 + // 25 Keystrokes were not available on input queue.
  97 + // 26 A host event occurred. See QUERY HOST UPDATE (24) for details.
  98 + // 28 Field length was 0.
  99 + // 31 Keystroke queue overflow. Keystrokes were lost.
  100 +
  101 +
69 #define HLLAPI_STATUS_WAITING HLLAPI_STATUS_TIMEOUT 102 #define HLLAPI_STATUS_WAITING HLLAPI_STATUS_TIMEOUT
70 103
71 #ifdef WIN32 104 #ifdef WIN32
src/plugins/hllapi/hllapi.c
@@ -102,7 +102,10 @@ HLLAPI_API_CALL hllapi(LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc) @@ -102,7 +102,10 @@ HLLAPI_API_CALL hllapi(LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc)
102 } 102 }
103 103
104 trace("hllapi(%d) failed",*func); 104 trace("hllapi(%d) failed",*func);
105 - return invalid_request(buffer, length, rc); 105 +
  106 + *rc = HLLAPI_STATUS_UNSUPPORTED;
  107 + return *rc;
  108 +
106 } 109 }
107 110
108 static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc) 111 static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc)