create rdp session on new desktop

Forum for discussion about user-mode development.
Post Reply
kobip
Posts: 4
Joined: Sun Sep 06, 2015 12:29 pm

Sun Sep 06, 2015 12:44 pm

Hi,
I'm trying to develop a program in c# which suppose to create new invisible desktop and there spawn mstsc.exe with configuration file in order to connect to remote internet explorer which ive published from windows machine using remoteapp.

when i spawn the mstsc in my original desktop it works fine and it connects to the internet explorer but when i spawn this programatically in the new desktop it spawn the mstsc process but stay stuck on connecting to <machine name> and i cant interact with the remoteapp.

my flow:
1. createdesktop
2. ConvertStringSecurityDescriptorToSecurityDescriptor - low integrity level
3. GetSecurityDescriptorSacl
4. SetSecurityInfo - to the new desktop handle
5. create explorer process on the new desktop
6. setthreaddesktop to the new desktop handle
7. create process "mstsc <conf file>" in the new desktop

what im missing?
why my new desktop doesn't work like my original desktop?
why when im running explorer in my new desktop i dont see the wallpaper and my user desktop? in only see the file explorer


thanks.
User avatar
TETYYSs
Posts: 98
Joined: Fri Jun 28, 2013 6:51 pm

Sun Sep 06, 2015 8:03 pm

Well, the only difference I'm seeing is that your hidden desktop is... hidden. Obviously, MS made sure that RDP would run only on active desktops.
kobip
Posts: 4
Joined: Sun Sep 06, 2015 12:29 pm

Mon Sep 07, 2015 1:11 pm

even if i switch to this desktop using SwitchDesktop() the mstsc still stuck. so the problem is not the hidden desktop. i think that im missing something in the preparation of the new desktop but cant figure out what missing.
User avatar
TETYYSs
Posts: 98
Joined: Fri Jun 28, 2013 6:51 pm

Tue Sep 08, 2015 2:01 pm

kobip wrote:even if i switch to this desktop using SwitchDesktop() the mstsc still stuck
This is after you created it in hidden desktop? what if you create desktop switch to it and launch mstsc?
kobip
Posts: 4
Joined: Sun Sep 06, 2015 12:29 pm

Wed Sep 09, 2015 1:25 pm

tried this still the mstsc dont connect successfully. it show only black screen and the title is "connectig to <pc name>"
User avatar
TETYYSs
Posts: 98
Joined: Fri Jun 28, 2013 6:51 pm

Thu Sep 10, 2015 1:17 pm

I can't a difference between this and connecting to machine normally. I think you don't launch mstsc propertly.
User avatar
Brock
Posts: 213
Joined: Wed Apr 28, 2010 3:13 am
Location: Valparaiso, Florida USA
Contact:

Thu Sep 10, 2015 8:30 pm

Since you haven't posted your code it is pure guessing on our part. Have you tried filling in STARTUPINFO.lpDesktop when launching mstsc in the new desktop?
Accept nothing less than STATUS_SUCCESS
kobip
Posts: 4
Joined: Sun Sep 06, 2015 12:29 pm

Tue Sep 29, 2015 9:38 am

I'm using this library: www.codeproject.com/Articles/7666/Desktop-Switching for desktop creation and for process spawning.
this library have createprocess method which already sets the lpDesktop to the new desktop so i dont think that this is the problem.
Post Reply