Bug 2369

Summary: SeamlessRDP sometimes displays the shapes of cmd.exe
Product: ThinLinc Reporter: Peter Åstrand <astrand@cendio.se>
Component: | rdesktop (deprecated)Assignee: Henrik Andersson <hean01@cendio.se>
Status: CLOSED FIXED QA Contact: Bugzilla mail exporter <bugzilla-qa@cendio.se>
Severity: Normal    
Priority: P2 Keywords: astrand_tester
Version: trunk   
Target Milestone: 4.0.0   
Hardware: PC   
OS: Linux   
Acceptance Criteria:

Description From cendio 2007-02-22 09:33:48
SeamlessRDP sometimes displays the shapes of the cmd.exe that is used to start
the application. I've only seen this on Windows 2000, and only one time. I've
not been able to reproduce this.
------- Comment #1 From cendio 2007-02-22 09:43:17 -------
If you give an invalid command, quite often, you will be able to see the cmd
window. It's not "stale" in this case, though, since it's still running, since
it's the program that gives the popup dialog with the error message. 

Perhaps one workaround could be to ignore Windows with the title
------- Comment #2 From cendio 2008-04-02 10:07:16 -------
SeamlessRDP has been adopted to ignore windows with class ConsoleWindowClass
during enumeration (that it, on reconnects). As I understand it, though, this
bug is not about reconnects. 
------- Comment #3 From cendio 2012-06-11 07:29:35 -------
tl-run-winapp-seamless uses cmd to bootstrap start of program as
cmd /c start <program>, On Windows2008 R2 the cmd windows does not
dissapear at all and this bug is reproducable every time.

The cmd window is stale, no content is rendered just a black window.
------- Comment #4 From cendio 2012-09-07 07:20:33 -------
The problem with stale cmd window ii windows2008r2 is fixed upstream in
commit r1668,so the need of removing our bootstrap of application using
cmd /c start <command> is not longer important.
------- Comment #5 From cendio 2012-09-07 07:24:24 -------
Fixed in commit r25753.

Tester should test running a cmd with and without subprocess
agains both 2008R2 and a WinXP.

-A -s "c:\Program Files\ThinLinc\WTS-Tools\seamlesrdpshell.exe cmd"
-A -s "c:\Program Files\ThinLinc\WTS-Tools\seamlesrdpshell.exe cmd.exe /k start
-A -s "c:\Program Files\ThinLinc\WTS-Tools\seamlesrdpshell.exe cmd /c start
------- Comment #6 From cendio 2012-11-05 14:24:56 -------
(In reply to comment #5)
> Fixed in commit r25753.
> Tester should test running a cmd with and without subprocess
> agains both 2008R2 and a WinXP.
> -A -s "c:\Program Files\ThinLinc\WTS-Tools\seamlesrdpshell.exe cmd"

Should be:

-A -s "c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe cmd"

Result: cmd.exe is started but never displayed on the client side.
tl-run-winapp-seamless "hangs". Is this really intented behaviour?

> -A -s "c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe cmd.exe /k start
> notepad"

Result: "Running a seamless console window is not supported"

> -A -s "c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe cmd /c start
> notepad"

Works. However, bug 4145 unfortunately happens all the time... 

Wrt the problem above: It it caused by a too simplistic check in

+       /* Prevent start of a stand alone console window which is not
supported. */
+       if ( (!strncmp(cmdline,"cmd ",4) || !strncmp(cmdline,"cmd.exe",7)) &&
+            !strstr(cmdline," /c ")) {
+               message("Running a seamless console window is not supported.");
+               goto unhook;
+       }
------- Comment #7 From cendio 2012-11-05 14:50:56 -------
(In reply to comment #6)
> -A -s "c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe cmd"

In addition to this case, there are several other ways to fool the current
logic, for example:

-A -s 'c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe "cmd"'

Besides, it's not really cmd.exe that is the problem, but rather console
applications in general. This also fails:

-A -s 'c:\Program Files\ThinLinc\WTSTools\seamlessrdpshell.exe powershell'

So to do this "for real", I guess we need to either:

1) Check the subsystem type before launching the application


2) After launching it, check if it was a console application, and if so,
terminate it. Not very elegant. 

There are some information here:


Anyway, if I understand this correctly:

* This is not a regression

* The main problem ("SeamlessRDP sometimes displays the shapes of cmd.exe") has
been fixed. 

...then as I understand it, the check is basically just a helpful error check,
so perhaps it doesn't need to be perfect right now. Ie, perhaps fix later?
------- Comment #8 From cendio 2012-11-05 15:36:51 -------
The problem with detecting cmd.exe has been moved to bug 4458. Closing.