Wrong Session ID

Todd Chester 646 Reputation points
2024-02-10T02:44:23.0033333+00:00

Windows 11, 22H2 Pro Cobian Reflector 2.6.00 I am run a Pre-Event from Cobian Reflector https://www.cobiansoft.com/cobianbackup.html https://forum.cobiansoft.com/download/file.php?id=1042 In my program, I have several informational popups given to the user. They show up from the command line, but not when run from Reflector. I call my pop ups using WTSSendMessageA https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea And I retrieve my Session ID with WTSEnumerateSessionsA https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratesessionsa While my program is running, I have verified that WTSEnumerateSessionsA matches what wmic says it is, which “1”. And they match.

wmic process where "name='raku.exe'" get SessionId SessionID 1 Problem. I get no pop up unless I manually over-ride the Session ID to “0”. <Editorial comment> AAAAAAAAHHHHHHHHHHHH !!!!! </editorial comment>

What the heck ??????

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Todd Chester 646 Reputation points
    2024-02-10T07:32:43.8733333+00:00

    Figured it out. I created a Sission ID override in my WTSSendMessageA call. Is doing so, I had to tighten up my variable type declarations. Sission ID is a 32 bit unsigned integer (cardinal). I had assigned a -1 to it at some point. raku, instead of erroring out, decided to "coerce" it to its two's compliment. I got rid of the -1 and the coercing and now all is well. So, I was my problem all along. Well sort of. raku should has error out with a type mismatch, but I still should have know better.

    0 comments No comments