delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/27/11:17:28

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Cesar Strauss <cestrauss AT gmail DOT com>
Subject: Incorrect use of IsWow64Process in Cygwin sources
Date: Sun, 27 Apr 2008 12:16:35 -0300
Lines: 25
Message-ID: <fv25ck$t36$1@ger.gmane.org>
Mime-Version: 1.0
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: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019