有下面两个api就可以了
Function Ulong GetCurrentProcessId() Library "kernel32.dll" Alias for "GetCurrentProcessId"
Function Ulong ProcessIdToSessionId(ulong uProcessid,ref ulong myid) Library "kernel32.dll" Alias for "ProcessIdToSessionId"
如果返回的myid为非0,就是在终端中运行的,每一个终端连上的时候会有一个不同的会话ID,你的授权站点加上这个就可以了
ProcessIdToSessionId(GetCurrentProcessId(),ref ll_session)
ll_session就是终端的会话ID,每个终端连接上去的时候都会唯一有个标识