Is 32bit ConPTY/OpenConsole supposed to work on 64bit Windows? #20391
|
I've been looking at getting ConPTY from nuget rather than using the variant bundled with windows for the terminal I maintain, but I've run into an issue: the 32bit version of conpty doesn't seem to work on 64bit Windows. 64bit ConPTY and OpenConsole work fine with a 64bit build of my terminal - I can launch cmd in a PTY, or j4james' games that use soft-fonts and it all works properly. But the 32bit ConPTY and OpenConsole alongside a 32bit build of my terminal not so much. CreateProcess doesn't report an error, but when my terminal goes to wait on the process its already dead. I spent a while trying to figure out where my bug is, but then I noticed that the 32bit version of OpenConsole doesn't seem to work either - it just exits immediately. Is this expected behaviour? Or is there something special that needs to be done for 32bit ConPTY to work on 64bit Windows? If its just incompatible then I guess I'll adjust 32bit builds of my terminal to go straight to the implementation provided by kernel32 if it detects its running on 64bit windows. |
Replies: 1 comment 6 replies
|
Ok, so. The console host (openconsole) needs to match the kernel architecture and the conpty shim (conpty.dll) needs to match the application architecture. We have build rules in the NuGet package that should add all required architectures to the final build directory, but I am certain that for reasons1 they don't always work. If you deploy a 32-bit terminal, it needs to come with a 32-bit openconsole for 32-bit kernels and a 64-bit openconsole for when you are running under WOW64 on 64-bit kernels. We talk about this in one (?) of the props files in the package (here), but could stand to make it clearer in the README. Sorry about the complication! Footnotes
|

Ah! Those are directory names. Keep
openconsole.exebut put the arch-specific ones inx64andx86.(Technically, you could keep the "same architecture as my application" one in the root folder and only put the "foreign architecture" ones in folders, but it may make it less clear rather than more clear!)