delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/09/02/03:50:48

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <COL101-W9EA32BAF40B73065A5C40E65F0@phx.gbl>
From: Jay <jay DOT krell AT cornell DOT edu>
To: <robert AT mckay DOT com>, <cygwin AT cygwin DOT com>
Subject: RE: Running 64bit processes from 32bit Cygwin
Date: Tue, 2 Sep 2008 07:49:59 +0000
In-Reply-To: <1220310319.16119.ezmlm@cygwin.com>
References: <1220310319 DOT 16119 DOT ezmlm AT cygwin DOT com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m827ok12024603

  [Robert]  Can anyone tell me for sure that it's impossible to run a 64bit 
  [Robert]  windows process from 32bit Cygwin? Or rather.. is it possible to spawn 
  [Robert]  a 64bit process from Cygwin and have it not be trapped inside WoW64 
  [Robert]  emulation? It seems as though once you're inside WOW64, you can't 
  [Robert]  readily escape from it? I wonder if it would be possible to ask the 
  [Robert]  explorer process to spawn something for you (possibly via a com 
  [Robert]  message?) rather than using WinExec(). If so a utility to facilitate 
  [Robert]  such process spawning would be a very useful addition to Cygwin. 
 
 
 32bit processes can launch 64 bit processes, and vice versa. 
 You are not trapped in emulation. 
 Simply via the normal CreateProcess, or system(), or ShellExecute().
 There's no need to ask Explorer to do it for you. Except...
 There is wierdness though in that 32bit processes cannot usually 
  see the 64bit system directory. They can run 64bit .exes anywhere
  else, but under native %windir%\system32 is wierd.
  Vista adds something like %windir%\sysnative (search the web).

e.g.:
 cd \ 
 copy %windir%\system32\cmd.exe cmd64.exe 
 copy %windir%\syswow64\cmd.exe cmd32.exe 
 They can each run each other: 
 .\cmd32  
 .\cmd64 
 .\cmd32 
 notepad => runs 32bit notepad 
 .\cmd64 
 notepad => runs 64bit notepad 


 IF this is your problem, you merely need to make a 64bit 
 executable "in between" that you run, that then runs the 64bit 
 PowerShell. It'd be a very small simple program.  
 I have to install PowerShell to check. 

 Or use the APIs that temporarily turn off mucking with paths.  
   Wow64DisableWow64FsRedirection  

 and then system("notepad.exe") from a 32bit app should launch 64bit notepad.  
 And hope that system() doesn't try to LoadLibrary anything in the parent process, 
 under same influence of turning off redirection that is meant to only affect 
 finding the .exe. This whole redirection thing..instead of there being 
 \windows\system64, but I guess too much code hardcodes system32 and 
 so it is a great porting convenience.. 

 WinExec is an old function there for compatibility. 
 You shouldn't use it. 

  - Jay 

--
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