0

I'm attempting to use psexec to spawn a process on a remote machine (for automated testing purposes) and noticed that the spawned process wasn't correctly responding to a message (WM_GETOBJECT, but that's another question entirely). I opened spy++ in an attempt to see why, but I couldn't log any messages going to my process' window. The window properties also indicated that the "Windows Proc" for the window was "Unavailable":

"Windows Proc" for the window is "Unavailable".

I think this is a behavior of Windows services since psexec uses an embedded service on the remote machine to launch the requested application. I was logged onto both machines with the same credentials so I don't believe it is a user security issue but rather a service-related behavior.

As a sanity check I wrote a quick standalone server and client to execute a program remotely and everything worked as expected: the Window Proc was no longer "unavailable" and I could spy on messages.

I used the normal Windows Calculator (calc) for all my tests, i.e.:

psexec.exe -i \\other-machine calc

My question: Can someone confirm, explain, and/or cite why I can't see message queues of processes spawned off services? Also is there a workaround to this? I'd rather use psexec than my custom solution. Bonus if you can also explain why WM_GETOBJECT doesn't return my custom UI Automation provider in this situation as well, as that's my original problem.

Patrick Quirk
  • 21,498
  • 1
  • 51
  • 85
  • Since psexec uses a Windows Service to launch the executable, you might be running into [Session 0 Isolation](http://www.coretechnologies.com/WindowsServices/FAQ.html#WhatIsSession0Isolation). Is your application started in Session 0? Maybe Spy++ has trouble accessing it. – CoreTech Oct 03 '12 at 15:09
  • I'm running on XP so I don't believe that's an issue for me. To check anyways, I enabled the "Session ID" column in Task Manager and it showed "0" for calc. However all other applications/services for SYSTEM or my user login are in session 0 as well. – Patrick Quirk Oct 03 '12 at 15:40

0 Answers0