Hi, Adding Windows CE attaching support, I saw that the DebugActiveProcess call was failing with "invalid handle". It turns out that on Windows CE, we can only call DebugActiveProcess if we have an open handle to the process we're attaching to. This patch simply reverses the order of the DebugActiveProcess, OpenProcess calls, so that OpenProcess is done first. As a side effect, if OpenProcess fails, we don't need to undo the DebugActiveProcess with DebugActiveProcessStop any more. Tested on i686-pc-cygwin and arm-wince-mingw32ce. Cheers, Pedro Alves