http://bugs.winehq.org/show_bug.cgi?id=10961
Summary: application made using a compiler/embedder fails to start Product: Wine Version: CVS/GIT Platform: All OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: a.sappia@ngi.it
Created an attachment (id=9898) --> (http://bugs.winehq.org/attachment.cgi?id=9898) EXE with embedded resources
I'm facing with an application made with http://www.bambalam.se/bamcompile/
it embed php code inside the .exe and then use the static-embedded php interpreter to exec that code.
On windows I've this app (it's a launcher for another application) working fine, while on wine (current git at time of writing, it hangs with
fixme:mixer:ALSA_MixerInit No master control found on MPU-401 UART, disabling mixer fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored
Fatal error: wb_create_window(): Error creating window in launcher.php on line 1
launcher.php is one of the resources embedded in the exe
I don't know if this is really a msvcrt issue
Attached the exe file (it's freely available on the net tought)
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #1 from Vitaliy Margolen vitaliy@kievinfo.com 2007-12-29 22:02:15 --- Have you tries "wine start loader.exe" ? If that works, then it's the old good console window problem.
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #2 from Alessandro a.sappia@ngi.it 2007-12-30 16:21:34 --- Created an attachment (id=9930) --> (http://bugs.winehq.org/attachment.cgi?id=9930) trace+file output
trace obtained with WINEDEBUG=trace+file wine loader.exe
http://bugs.winehq.org/show_bug.cgi?id=10961
Alessandro a.sappia@ngi.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |a.sappia@ngi.it
--- Comment #3 from Alessandro a.sappia@ngi.it 2007-12-30 16:23:50 --- (In reply to comment #1)
Have you tries "wine start loader.exe" ? If that works, then it's the old good console window problem.
as you see in the attachment there's something in the CreateFile path which brings to an INVALID_HANDLE
I tried also the "wine start loader.exe " as you suggest, but same effect.
I think it's not depending on missing console, but in how those exe ask for creation of files.
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #4 from Alessandro a.sappia@ngi.it 2007-12-30 18:24:21 --- my fault, the files are correctly created...
but when php(win32) tries to create a window it can't
http://bugs.winehq.org/show_bug.cgi?id=10961
Kirill K. Smirnov lich@math.spbu.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lich@math.spbu.ru
--- Comment #5 from Kirill K. Smirnov lich@math.spbu.ru 2007-12-30 20:21:30 --- There are few embedded dlls in this file: php_socket.dll and php_winbinder.dll. As far as I understand, the main executable extracts them into currect directory and loads. But I can see only images extracted.
I tried to get them by myself using ResHacker and ResourceEditor. I got them, but they do not look like valid dll files (no MZ signature). ResHacker warned me that they are compressed. I do not know how DLL files are represented as a resources, but I suspect there is something wrong...
http://bugs.winehq.org/show_bug.cgi?id=10961
Alessandro a.sappia@ngi.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|wine-msvcrt |wine-user
--- Comment #6 from Alessandro a.sappia@ngi.it 2007-12-30 22:11:09 --- --- snip from a test --- trace:win:WIN_CreateWindowEx "Hello world!" L"wbMainWnd" ex=00000000 style=12ca0008 2048,2048 480x320 parent=(nil) menu=(nil) inst=(nil) params=(nil) trace:win:dump_window_styles style: WS_VISIBLE WS_CLIPCHILDREN WS_CAPTION WS_SYSMENU WS_MINIMIZEBOX 00000008 trace:win:dump_window_styles exstyle: warn:win:create_window_handle error 6 creating window --- end snip from a test ---
corrected the component, as CreateWindowExA is in by user32.dll
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #7 from Alessandro a.sappia@ngi.it 2007-12-30 22:36:03 --- Check comment 6
Apart from the exe I attached here I tried to use the Hello World example included in WinBinder (that what's used in that app) step to reproduce the log from comment 6
1) download php 4 from www.php.net 2) extract php somewhere 3) add php path (where you extracted it) to windows path (HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\Path) 4) go inside the php directory 5) download http://winbinder.org/files/WinBinder-0.46.0.tgz 6) extract it 7) copy binaries/php4/ext/php_winbinder.dll to extensions dir inside the php directory 8) copy php.ini-dist to php.ini 9) edit php.ini set extension_dir to the path (windows style) of your extensions dir (where you copied php_winbinder.dll to) e.g. extension_dir = "c:\php\extensions";
10) go inside the directory where you unpacked WinBinder 11) cd phpcode/examples 12) WINEDEBUG=win wine php minimal.phpw
(This will show an hello world example on windows, but fails on wine)
There you find also the source code of WinBinder ^^
I hope this will move to the bug I see. :-P
(In reply to comment #5)
There are few embedded dlls in this file: php_socket.dll and php_winbinder.dll. As far as I understand, the main executable extracts them into currect directory and loads. But I can see only images extracted.
I tried to get them by myself using ResHacker and ResourceEditor. I got them, but they do not look like valid dll files (no MZ signature). ResHacker warned me that they are compressed. I do not know how DLL files are represented as a resources, but I suspect there is something wrong...
Those dll are compressed by the http://www.bambalam.se/bamcompile/ but I moved deep investigating and I've found that it's not "bambalam" making it wrong, but something else
BTW, the files he need are created in windows\temp (name php.<random_chars> after the decompression
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #8 from Alessandro a.sappia@ngi.it 2007-12-31 12:00:29 --- Futher investigation brought me to this : php_winbinder.dll create an hAppIstance on init using
file WinBinder-0.46.0/csource/core/wb/wb_winsys.c : line 86 [code] hAppInstance = GetModuleHandle(NULL); [/code]
when creating window this hAppInstance is passed to
file WinBinder-0.46.0/csource/core/wb/wb_window.c : line 183 [code] CreateWindowEx( dwExStyle, pszClass, szWindowName, dwStyle ? dwStyle : DEFAULT_WIN_STYLE, xPos == WBC_CENTER ? xPos : (xPos < 0 ? CW_USEDEFAULT : xPos), yPos == WBC_CENTER ? yPos : (yPos < 0 ? CW_USEDEFAULT : yPos), nWidth <= 0 ? CW_USEDEFAULT : nWidth, nHeight <= 0 ? CW_USEDEFAULT : nHeight, pwboParent ? pwboParent->hwnd : NULL, NULL, hAppInstance, NULL); [/code]
but hAppInstance is set to 0x0 on wine, while on winXP i get a real pointer to the handle.
am I wrong ?
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #9 from Alessandro a.sappia@ngi.it 2007-12-31 18:39:46 --- ok, my search ha stopped I really don't know where to search
I did a small test app Taking the bare minimum from WinBinder source code, to see if i can repeat it thru it, but the test apps works.
...
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #10 from Kirill K. Smirnov lich@math.spbu.ru 2008-01-01 16:17:52 --- It is not an hInstance problem.
[code] CreateWindowEx( dwExStyle, pszClass, szWindowName, dwStyle ? dwStyle : DEFAULT_WIN_STYLE, xPos == WBC_CENTER ? xPos : (xPos < 0 ? CW_USEDEFAULT : xPos), yPos == WBC_CENTER ? yPos : (yPos < 0 ? CW_USEDEFAULT : yPos), nWidth <= 0 ? CW_USEDEFAULT : nWidth, nHeight <= 0 ? CW_USEDEFAULT : nHeight, pwboParent ? pwboParent->hwnd : NULL, NULL, hAppInstance, NULL); [/code]
Here, as I saw in the trace log, zero is passed as pszClass, and this is invalid. There is definitely problem with registering window class.
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #11 from Alessandro a.sappia@ngi.it 2008-01-02 07:25:52 --- (In reply to comment #10)
It is not an hInstance problem.
Here, as I saw in the trace log, zero is passed as pszClass, and this is invalid. There is definitely problem with registering window class.
well, on win32 it works fine the pszClass is correctly set under win32. (test made compiling php with debug, php_winbinder.dll with debug and doing trace on it)
http://bugs.winehq.org/show_bug.cgi?id=10961
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |download
--- Comment #12 from Austin English austinenglish@gmail.com 2008-06-09 16:25:28 --- Still present in git.
http://bugs.winehq.org/show_bug.cgi?id=10961
--- Comment #13 from Austin English austinenglish@gmail.com 2008-12-07 18:21:38 --- Still present in 1.1.10
http://bugs.winehq.org/show_bug.cgi?id=10961
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #14 from Austin English austinenglish@gmail.com 2009-01-18 03:47:31 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=10961
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #15 from Austin English austinenglish@gmail.com 2010-07-18 01:25:22 --- Seems fine in 1.2.
http://bugs.winehq.org/show_bug.cgi?id=10961
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Alexandre Julliard julliard@winehq.org 2010-07-30 12:54:56 --- Closing bugs fixed in 1.3.0.
http://bugs.winehq.org/show_bug.cgi?id=10961
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other
--- Comment #17 from Austin English austinenglish@gmail.com 2012-02-23 15:23:17 CST --- Removing deprecated 'All' Platform.