This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Running 64bit processes from 32bit Cygwin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]