Search code examples
c#dllimport

EHLLAPI function Query sessions (10) doesn't work at all on Passport Rocket emulator


I'm trying to use ehllapi on Passport Rocket emulator. And query sessions function doesn't work at all. It just returns zero and empty data. Could someone help me with it? Other functions, like query cursor position, work fine. Example of code

public class EhllapiFunc
{
    [DllImport(@"C:\Rocket EHLLAPI\PCSHLL32.dll")]
    public static extern uint hllapi(out uint Func, StringBuilder Data, out uint Length, out uint RetC);
}

public class EHLLAPI
{
    public uint QuerySessions()
    {
        var querySessions = 10u;
        var length = 16 * 1u;
        var data = new StringBuilder(new string(' ', (int)length));
        var res = EhllapiFunc.hllapi(out querySessions, data, out length, out var rcod);
        return res;
    }
}

Preconditions. Before calling this function I call Connect (1) function. Query sessions always returns 0, and empty data even when you're not connected to presentation space! Length is also zero. And the last parameter is also set to 0.


Solution

  • Try running with admin rights.