Jump to content

How to check if a program runs unter terminal services?


Recommended Posts

Guest Franc Walter
Posted

Hello,

how can i check if a program is started under Terminal Services (or

Remote Desktop)?

Thanks,

franc

Guest Vera Noest [MVP]
Posted

Re: How to check if a program runs unter terminal services?

 

Check this:

 

How can my script / application detect if it is running in a Terminal

Services client session?

http://ts.veranoest.net/ts_faq_applications.htm#DetectRemoteSession

 

_________________________________________________________

Vera Noest

MCSE, CCEA, Microsoft MVP - Terminal Server

TS troubleshooting: http://ts.veranoest.net

___ please respond in newsgroup, NOT by private email ___

 

Franc Walter <francwalter@gmx.de> wrote on 29 mar 2008 in

microsoft.public.windows.terminal_services:

> Hello,

> how can i check if a program is started under Terminal Services

> (or Remote Desktop)?

> Thanks,

> franc

Guest Franc Walter
Posted

Re: How to check if a program runs unter terminal services?

 

Thank you Vera, that works:

 

BOOL bIsRemoteSession = GetSystemMetrics( SM_REMOTESESSION );

 

By the way, the GetSystemMetrics is in user32.dll

 

Yours,

franc

Guest Franc Walter
Posted

Re: How to check if a program runs unter terminal services?

 

And is there a way to prevent that a programm asks the user32.dll about

GetSystemMetrics( SM_REMOTESESSION )?

Guest Vera Noest [MVP]
Posted

Re: How to check if a program runs unter terminal services?

 

I have no idea if/how to do that.

Just curious, but why would you want to prevent this?

_________________________________________________________

Vera Noest

MCSE, CCEA, Microsoft MVP - Terminal Server

TS troubleshooting: http://ts.veranoest.net

___ please respond in newsgroup, NOT by private email ___

 

Franc Walter <francwalter@gmx.de> wrote on 31 mar 2008 in

microsoft.public.windows.terminal_services:

> And is there a way to prevent that a programm asks the

> user32.dll about GetSystemMetrics( SM_REMOTESESSION )?

Guest ThomasT.
Posted

Re: How to check if a program runs unter terminal services?

 

Some programs use this function to verify for not allowing to run under

shared environment

like TS for licensing purpose. Probably he wants to bypass this check to

make the software

can run under a remote session.

:-)

 

"Vera Noest [MVP]" <vera.noest@remove-this.hem.utfors.se> wrote in message

news:Xns9A72DC5394711veranoesthemutforsse@207.46.248.16...

>I have no idea if/how to do that.

> Just curious, but why would you want to prevent this?

> _________________________________________________________

> Vera Noest

> MCSE, CCEA, Microsoft MVP - Terminal Server

> TS troubleshooting: http://ts.veranoest.net

> ___ please respond in newsgroup, NOT by private email ___

>

> Franc Walter <francwalter@gmx.de> wrote on 31 mar 2008 in

> microsoft.public.windows.terminal_services:

>

>> And is there a way to prevent that a programm asks the

>> user32.dll about GetSystemMetrics( SM_REMOTESESSION )?

Guest Vera Noest [MVP]
Posted

Re: How to check if a program runs unter terminal services?

 

Yes, that were my thoughts as well, Thomas, but I wasn't as brave

as you and didn't dare to ask in plain text if this was the reason

:-)

_________________________________________________________

Vera Noest

MCSE, CCEA, Microsoft MVP - Terminal Server

TS troubleshooting: http://ts.veranoest.net

*----------- Please reply in newsgroup -------------*

 

"ThomasT." <ThomasT@nospam.nospam> wrote on 31 mar 2008:

> Some programs use this function to verify for not allowing to

> run under shared environment

> like TS for licensing purpose. Probably he wants to bypass this

> check to make the software

> can run under a remote session.

>:-)

>

> "Vera Noest [MVP]" <vera.noest@remove-this.hem.utfors.se> wrote

> in message

> news:Xns9A72DC5394711veranoesthemutforsse@207.46.248.16...

>>I have no idea if/how to do that.

>> Just curious, but why would you want to prevent this?

>> _________________________________________________________

>> Vera Noest

>> MCSE, CCEA, Microsoft MVP - Terminal Server

>> TS troubleshooting: http://ts.veranoest.net

>> ___ please respond in newsgroup, NOT by private email ___

>>

>> Franc Walter <francwalter@gmx.de> wrote on 31 mar 2008 in

>> microsoft.public.windows.terminal_services:

>>

>>> And is there a way to prevent that a programm asks the

>>> user32.dll about GetSystemMetrics( SM_REMOTESESSION )?

Guest ThomasT.
Posted

Re: How to check if a program runs unter terminal services?

 

Ha ha ha, because you are a celebrity here, in these newsgroups and on the

net

but I'm not ;-), nobody know who am I, although I have been in these groups

since 2001 :-)

 

 

"Vera Noest [MVP]" <Vera.Noest@remove-this.hem.utfors.se> wrote in message

news:Xns9A758ED126D8Fveranoesthemutforsse@207.46.248.16...

> Yes, that were my thoughts as well, Thomas, but I wasn't as brave

> as you and didn't dare to ask in plain text if this was the reason

> :-)

> _________________________________________________________

> Vera Noest

> MCSE, CCEA, Microsoft MVP - Terminal Server

> TS troubleshooting: http://ts.veranoest.net

> *----------- Please reply in newsgroup -------------*

>

> "ThomasT." <ThomasT@nospam.nospam> wrote on 31 mar 2008:

>

>> Some programs use this function to verify for not allowing to

>> run under shared environment

>> like TS for licensing purpose. Probably he wants to bypass this

>> check to make the software

>> can run under a remote session.

>>:-)

>>

>> "Vera Noest [MVP]" <vera.noest@remove-this.hem.utfors.se> wrote

>> in message

>> news:Xns9A72DC5394711veranoesthemutforsse@207.46.248.16...

>>>I have no idea if/how to do that.

>>> Just curious, but why would you want to prevent this?

>>> _________________________________________________________

>>> Vera Noest

>>> MCSE, CCEA, Microsoft MVP - Terminal Server

>>> TS troubleshooting: http://ts.veranoest.net

>>> ___ please respond in newsgroup, NOT by private email ___

>>>

>>> Franc Walter <francwalter@gmx.de> wrote on 31 mar 2008 in

>>> microsoft.public.windows.terminal_services:

>>>

>>>> And is there a way to prevent that a programm asks the

>>>> user32.dll about GetSystemMetrics( SM_REMOTESESSION )?

Guest Franc Walter
Posted

Re: How to check if a program runs unter terminal services?

 

Vera Noest [MVP] schrieb:

> I have no idea if/how to do that.

> Just curious, but why would you want to prevent this?

>

 

Yes, it's just like Thomas said:

there is a program, that needs a (very expensive) supplement-license

(only for the printing-engine) if it runs under TS.

So i have to use UltraVNC, but TS is more comfortable, therefore i am

looking for a trick to avoid this check.

Thank you anyway, Vera.

 

Regards, franc

Guest ThomasT.
Posted

Re: How to check if a program runs unter terminal services?

 

There is a way to do that, you have to use injecting technic to

inject your code into memory space of the program and check

if the function is called, but it required a good skill

 

"Franc Walter" <francwalter@gmx.de> wrote in message

news:47f628df$0$4759$9b4e6d93@newsspool3.arcor-online.net...

> Vera Noest [MVP] schrieb:

>> I have no idea if/how to do that.

>> Just curious, but why would you want to prevent this?

>>

>

> Yes, it's just like Thomas said:

> there is a program, that needs a (very expensive) supplement-license (only

> for the printing-engine) if it runs under TS.

> So i have to use UltraVNC, but TS is more comfortable, therefore i am

> looking for a trick to avoid this check.

> Thank you anyway, Vera.

>

> Regards, franc

Guest Franc Walter
Posted

Re: How to check if a program runs unter terminal services?

 

ThomasT. schrieb:

> There is a way to do that, you have to use injecting technic to

> inject your code into memory space of the program and check

> if the function is called, but it required a good skill...

 

which i don't have :-) - i will use UltraVNC...

But thank you, Thomas!

 

regards, franc

×
×
  • Create New...