Hallo,
some java program in the Xilinx webpack suite is started as a batch file from a perl script. When the batch should be executed, the perl script looks for the $COMSPEC variable and starts the batch like:
Call kernel32.CreateProcessA(40c82e0c "c:\command.com",40c8fee4\ "c:\command.com /c I:\xilinx\bin\nt\ChipView.bat -f magcom.vm6"...
Pointing $COMSPEC to the winelib wcmd processor doesn't work as expected, as CreateProcess tries to execute wcmd as windows executable, as CeateProcess is called like:
Call kernel32.CreateProcessA(40c8248f\ "h:/tmp/wine/compile/wine/programs/wcmd/wcmd",40c8ff1c\ "h:\tmp\wine\compile\wine\programs\wcmd\wcmd /c\ I:\xilinx\bin\nt\ChipView.bat -f magcom.vm6",...
I there any way to use winelib-wcmd in this situation?
Bye
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
Pointing $COMSPEC to the winelib wcmd processor doesn't work as expected, as CreateProcess tries to execute wcmd as windows executable, as CeateProcess is called like:
Call kernel32.CreateProcessA(40c8248f\ "h:/tmp/wine/compile/wine/programs/wcmd/wcmd",40c8ff1c\ "h:\tmp\wine\compile\wine\programs\wcmd\wcmd /c\ I:\xilinx\bin\nt\ChipView.bat -f magcom.vm6",...
If you simply set COMSPEC to "wcmd.exe" it should work I think (assuming wcmd.exe.so is in your WINEDLLPATH of course).
"Alexandre" == Alexandre Julliard julliard@winehq.com writes:
Alexandre> Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes: >> Pointing $COMSPEC to the winelib wcmd processor doesn't work as >> expected, as CreateProcess tries to execute wcmd as windows >> executable, as CeateProcess is called like: >> >> Call kernel32.CreateProcessA(40c8248f\ >> "h:/tmp/wine/compile/wine/programs/wcmd/wcmd",40c8ff1c\ >> "h:\tmp\wine\compile\wine\programs\wcmd\wcmd /c\ >> I:\xilinx\bin\nt\ChipView.bat -f magcom.vm6",...
Alexandre> If you simply set COMSPEC to "wcmd.exe" it should work I Alexandre> think (assuming wcmd.exe.so is in your WINEDLLPATH of Alexandre> course).
Probably I forget something, but it doesn't work for me:
echo $COMSPEC
wcmd.exe (I added an echo command to winewrapper) WINEDLLPATH /home/bon/tmp/wine/compile/wine/dlls:/home/bon/tmp/wine/compile/wine/programs
088fccb8:Call kernel32.CreateProcessA(40c8248f "wcmd.exe",40c87f04 "wcmd.exe /c I:\xilinx\bin\nt\ChipView.bat -f magcom .vm6",405c6c3c,405c6c3c,00000001,00000000,00000000,00000000,405c6bf8,405c6be8) ret=405feddd trace:dosfs:DOSFS_GetFullName L"wcmd.exe" (last=1) trace:dosfs:DOSFS_FindUnixName /home/bon/work/projekte/elab/magcomp,L"wcmd.exe" trace:dosfs:DOSFS_OpenDir "/home/bon/work/projekte/elab/magcomp" warn:dosfs:DOSFS_FindUnixName L"wcmd.exe" not found in '/home/bon/work/projekte/elab/magcomp' 088fccb8:Ret kernel32.CreateProcessA() retval=00000000 ret=405feddd
ls -l /home/bon/tmp/wine/compile/wine/programs/wcmd.exe.so
lrwxrwxrwx 1 bon users 16 Sep 8 01:58 /home/bon/tmp/wine/compile/wine/programs/wcmd.exe.so -> wcmd/wcmd.exe.so
Any hints?
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
echo $COMSPEC
wcmd.exe (I added an echo command to winewrapper) WINEDLLPATH /home/bon/tmp/wine/compile/wine/dlls:/home/bon/tmp/wine/compile/wine/programs
088fccb8:Call kernel32.CreateProcessA(40c8248f "wcmd.exe",40c87f04 "wcmd.exe /c I:\xilinx\bin\nt\ChipView.bat -f magcom .vm6",405c6c3c,405c6c3c,00000001,00000000,00000000,00000000,405c6bf8,405c6be8)
The app is passing COMSPEC as application name to CreateProcess, so my suggestion won't work, you have to make COMSPEC a full path. Setting it to "c:\windows\system\wcmd.exe" should work.
"Alexandre" == Alexandre Julliard julliard@winehq.com writes:
Alexandre> Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes: >> > echo $COMSPEC wcmd.exe (I added an echo command to winewrapper) >> WINEDLLPATH >> /home/bon/tmp/wine/compile/wine/dlls:/home/bon/tmp/wine/compile/wine/programs >> >> 088fccb8:Call kernel32.CreateProcessA(40c8248f "wcmd.exe",40c87f04 >> "wcmd.exe /c I:\xilinx\bin\nt\ChipView.bat -f magcom >> .vm6",405c6c3c,405c6c3c,00000001,00000000,00000000,00000000,405c6bf8,405c6be8)
Alexandre> The app is passing COMSPEC as application name to Alexandre> CreateProcess, so my suggestion won't work, you have to make Alexandre> COMSPEC a full path. Setting it to Alexandre> "c:\windows\system\wcmd.exe" should work.
It works with a winelib executable, when COMSPEC points to the real file. As our present built system creates .exe.so files, comspec must specify this existing .exe.so file (or the .exe.so file must be renamed to an .exe file). Just as a reference for others...
Bye
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
It works with a winelib executable, when COMSPEC points to the real file. As our present built system creates .exe.so files, comspec must specify this existing .exe.so file (or the .exe.so file must be renamed to an .exe file). Just as a reference for others...
You shouldn't need to rename the file or point to the .exe.so. Unless you have changed the loadorder, a .exe loaded from the system directory should match the .exe.so, just like it does for dlls even if the file itself doesn't exist.
So a CreateProcess of %systemdir%\wcmd.exe should launch wcmd.exe.so, just like a LoadLibrary of %systemdir%\user32.dll will load user32.dll.so, even if you don't have a real user32.dll file in there. If it doesn't do this there's a bug somewhere.