We need to run the 32-bit version of the remote desktop client on 64 bit Vista, because part of our product integrates with it, and communicates with the terminal server side app via the virtual channel. The integration loads some third party 32-bit drivers, and it is not possible to load a 32-bit dll in a 64-bit process.
Normally it is quite easy to run the 32 bit version of a windows application from the command line, e.g. run window:
C:\Windows\SysWOW64\Notepad.exe
You can tell that the process is 32-bit by checking in task monitor\processes as it will have a *32 next to the filename.
However, the remote desktop client (mstsc.exe) does not want to play ball. It always runs the 64-bit version from C:\Windows\System32\mstsc.exe regardless of how I start it (run window, 32-bit cmd windows etc). I've tried writing a 32-bit C++ program to create it (normally child processes are also 32-bit) but this did not work.
I also tried calling:
Wow64DisableWow64FsRedirection
Wow64RevertWow64FsRedirection
before and after starting mstsc.exe but this did not help either.
Anyone know a way around this?
[Edit] I've done some further investigation with process monitor, and it seems that the 32-bit version of mstsc does start first, but then this creates a second 64 bit process and the 32 bit versions closes.
Your question is very confused (1). Every executable on the system is compiled either as a 32-bit, or as a 64-bit executable. If you have a 64-bit executable, then it doesn't matter how you invoke it: from a 32-bit command window, from "Run" menu, or from another 32-bit program; it will always run as a 64-bit process.
You can check whether the executable is 32 or 64-bit one by looking for x64 in the output of dumpbin /HEADERS mstsc.exe
.
You need to download and install a 32-bit version of mstsc.exe
. In fact, I believe mstsc.exe
is largely independent of installation, so you might be able to simply copy it from a 32-bit system and just run it.
UPDATE:
eran points out that invoking 32-bit mstsc.exe
directly does not solve the problem, because mstsc
detects that it is running on a 64-bit system and reinvokes the 64-bit version of itself. I do not know why it does that, or how to stop it from doing that. If you do, please edit this answer.
(1) Microsoft greatly helps this confusion by shipping many executables as both 32 and 64-bit versions, and magically remapping PATHs so one or the other is found; often at apparently the same pathname. But this is just "smoke and mirrors", in reality the pathname is always different.
I tried copying the version from SysWOW64 to my development machine and did a dumpbin /headers and confirm that it is 32 bit - John Sibly 2009-06-17 09:04
Have you tried an old version (say, from Windows 2000) yet?
If I copy over a version of this .MUI file and run again, it starts up but it leaves only the 64 bit version runnin - John Sibly 2009-06-17 16:03
Come to think of it, hooking IsWow64Process() to return 0 might work.