What is your session ID?

Questions about Cobian Reflector
Post Reply
Todd
Posts: 183
Joined: 01 Nov 2021, 23:30

What is your session ID?

Post by Todd »

Hi Cobian,

My pop ups from my pre-events are not showing when run from Reflector.

I am using WTSSendMessageA
https://learn.microsoft.com/en-us/windo ... ndmessagea
for the pop up and WTSEnumerateSessionsA
https://stackoverflow.com/questions/746 ... i#74674303
for the required Session ID.

When my popups do not appear , it is usually that I am running the wrong SessionsID (typically it is suppose to be 0 or 1). WTSEnumerateSessionsA is suppose to figure it out for me.

Do you know what SessionID your tasks running pre-events under?
Many thanks,
-T
User avatar
cobian
Site Admin
Posts: 4608
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: What is your session ID?

Post by cobian »

If running as a service , session 0. As an application, it depends of the user: 1, 2.. etc
--
Luis Cobian
Cobian Backup's creator
Todd
Posts: 183
Joined: 01 Nov 2021, 23:30

Re: What is your session ID?

Post by Todd »

cobian wrote: 07 Feb 2024, 02:06 If running as a service , session 0. As an application, it depends of the user: 1, 2.. etc
I am running Reflector as an Application. Checking my program's Session ID with wmic:
wmic process where "name='raku.exe'" get ProcessID,SessionID,CommandLine
CommandLine ProcessId SessionId
"C:\Rakudo\bin\raku.exe" K:\Windows\NtUtil\CobianWrapper.pl6 --rotates 4 --backup_path [BACKUP]\MyDocsBackup\backup1 8492 1
says the Session ID is "1", which matches the value returned from WTSEnumerateSessionsA.

I get my WTSSendMessageA popups when running as a pre-event by over-riding my sessin ID to "0".

Do you have any idea what is causing this?

Many thanks,
-T
Todd
Posts: 183
Joined: 01 Nov 2021, 23:30

Re: What is your session ID?

Post by Todd »

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.

> my uint16 $x = -1
65535
Last edited by Todd on 11 Feb 2024, 23:13, edited 1 time in total.
User avatar
cobian
Site Admin
Posts: 4608
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: What is your session ID?

Post by cobian »

:OK
--
Luis Cobian
Cobian Backup's creator
Post Reply