X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Cesar Strauss Subject: Incorrect use of IsWow64Process in Cygwin sources Date: Sun, 27 Apr 2008 12:16:35 -0300 Lines: 25 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.12 (X11/20080227) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Please consider the following snippet from src/winsup/cygwin/wincap.cc (wincapc::init): BOOL is_wow64_proc = FALSE; if (IsWow64Process (GetCurrentProcess (), &is_wow64_proc)) wow64 = is_wow64_proc; else { ((wincaps *)this->caps)->needs_count_in_si_lpres2 = false; ((wincaps *)this->caps)->has_restricted_stack_args = false; } If I understood correctly, the "else" block is meant to be executed on 32 bit systems, so that those flags are reset on Vista 32. But you are testing the return value of IsWow64Process, which is only an indication that the function succeeded. For instance, it always returns true on my 32 bit system (Windows XP Home Edition). The correct return value is in the is_wow64_proc flag, you should use it. The relevant MSDN page documenting IsWow64Process is: http://msdn2.microsoft.com/en-us/library/ms684139(VS.85).aspx Regards, Cesar -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/