Query Sessions – Function 10
This function returns the number of Host screen sessions that are active, and a string containing information on each of the Host screen sessions. Host printer sessions are not supported.
Prerequisite function
None.
Function call
WinHLLAPI(QUERYSESSIONS,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String String buffer to hold the information string. Must be defined as 12*(number of active Host sessions) bytes.
Data Length 12*(number of active Host sessions).
Return parameters
Parameter Description
Data String 12-byte fields (one for each active Host 3270 session) with session information, in the following format:
Byte 1 Short name session ID.
Bytes 2-9 Long name session ID.
Byte 10 Session Type (“H” for Host, “P” for personal computer).
Bytes 11-12 Size of the presentation space expressed as a binary number (not ASCII).
Data Length The number of active Host 3270 screen sessions.
Return code
Code Description
WHLLOK Call successful.
WHLLPARAMETERERROR Data Length is invalid.
WHLLSYSERROR The function failed due to a system error.
Remarks
The return value of Data Length is set when the Return Code is 0 or 2. If you receive a Return Code of 2, use Data Length to recalculate the necessary value for the size of Data String (and the value for Data Length on the call).
Depending on the Session parameter specified the presentation size will vary thus:
Code Description
CFGSIZE The size of presentation space configured by the user.
NOCFGSIZE The current size of the presentation space at the time the call is issued.