0

I try to use ehllapi Query session status (22) but receive unexpected result. Here is my code in C#:

public class EhllapiFunc
{
    [DllImport("PCSHLL32.dll")]
    public static extern UInt32 hllapi(out UInt32 Func, StringBuilder Data, out UInt32 Length, out UInt32 RetC);
}
public class EhllapiWrapper
{
    public static UInt32 QuerySessionStatus(ref string sessionId)
    {
         StringBuilder Data = new StringBuilder();
         Data.Append(sessionId);
         Data.Append(' ', 19);
         UInt32 rc=0, f=22, l=20;
         UInt32 r = EhllapiFunc.hllapi(out f, Data, out l, out rc);
         sessionId = Data.ToString();
         return r;
    }
}

When I execute code like this:

string result = "A";
UInt32 resultCode = EhllapiWrapper.QuerySessionStatus(ref result);

I receive only session id like 'A'. Or If I provide empty result string, then I also receive 'A'. Of course before I connected to PS. All return codes equals 0 (success). But at documentation [1]: https://www.ibm.com/docs/en/personal-communications/5.9?topic=programming-ehllapi-functions#HDRFUNC22 are a lot more informations returned from this function

Anyone has any idea?

0 Answers0