http://bugs.winehq.org/show_bug.cgi?id=27324
Summary: Cossacks II (DotEmu version) refuses to start from its install directory (path too long?) Product: Wine Version: 1.3.21 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: gyebro69@gmail.com
Created an attachment (id=34947) --> (http://bugs.winehq.org/attachment.cgi?id=34947) plain terminal output
The Cossacks collection (available on DotEmu) contains all Cossacks games and their expansions. All but 2 of the games start correctly from the default installation directory.
Cossacks II: Napoleonic Wars and Battle for Europe throw an error dialogue on startup, claiming that certain audio files are missing. The error message: 'Class engine error: Unable to load sound: SOUND\INTERFACE\INTERF_ARMY1.WAV'
It took some time until I recognized that the problem has something to do with the path: after shortening the directory names by several characters, both games start fine.
Here is an example of one of the 'missing' files: C:\Program Files\DotEmu\All Cossacks And American Conquest Series\Cossacks II - Napoleonic Wars\SOUND\INTERFACE\INTERF_ARMY1.WAV
There is no such problem when starting the games in WinXP: they run correctly from their default install directory.
The same problem with Wine-0.9.33, 1.0.1, 1.2.3 and so on.
Fedora 14 32-bit
http://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #1 from GyB gyebro69@gmail.com 2011-05-28 22:01:17 CDT --- Created an attachment (id=34948) --> (http://bugs.winehq.org/attachment.cgi?id=34948) 7zipped +relay,+tid,+file,+msgbox debug log (uncompressed 30 MB)
http://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #2 from GyB gyebro69@gmail.com 2011-12-26 12:27:48 CST --- Still present as of wine-1.3.35-168-g5b93bb9.
I came across a bug report here, which describes a similar (if not the same) problem: bug #24192.
In my case Wine-1.3.21 returns the same error code as in bug #24192: 0021:warn:file:OpenFile (SOUND\INTERFACE\INTERF_ARMY1.WAV): return = HFILE_ERROR error= 123
I noticed that with a current Wine (1.3.35), the error code has changed, and now it is 3: 0009:warn:file:OpenFile (SOUND\INTERFACE\INTERF_ARMY1.WAV): return = HFILE_ERROR error= 3
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #3 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for 2 years. Is this still an issue in current (1.7.16 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #4 from Béla Gyebrószki gyebro69@gmail.com --- Still present in wine-1.7.34-36-g4493323
If I move the installed game from it's original install location, which is '/drive_c/Program Files/DotEmu/All Cossacks And American Conquest Series/Cossacks II - Battle For Europe' up one directory level: '/drive_c/Program Files/DotEmu/Cossacks II - Battle For Europe' ...then the game starts fine.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #5 from Béla Gyebrószki gyebro69@gmail.com --- Still present in wine-1.8-rc1-37-g1d19eb1.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #6 from Bruno Jesus 00cpxxx@gmail.com --- In GoG I have the Cossacks Anthology but it does not include Cossacks II. Maybe a +file log could show something.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #7 from Béla Gyebrószki gyebro69@gmail.com --- Created attachment 52865 --> https://bugs.winehq.org/attachment.cgi?id=52865 +file log
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #8 from Nikolay Sivov bunglehead@gmail.com --- This program uses OpenFile() function that has a limit of 128 characters per path. From the log:
--- trace:file:SearchPathW found L"C:\Program Files\DotEmu\All Cossacks And American Conquest Series\Cossacks II - Napoleonic Wars\SOUND\INTERFACE\INTERF_SELECT1.WAV" trace:file:OpenFile found "l\xdf3" ---
1\xdf3 <- most likely a garbage. SearchPathW was able to locate this sound resource, but was unable to store it in OFSTRUCT.szPathName[OFS_MAXPATHNAME], because OFS_MAXPATHNAME is 128, but you need 130 (if I counted it right) for this path.
In comment 4 you said it works if moved to shorter path, so I don't think there's anything to fix in Wine.
https://bugs.winehq.org/show_bug.cgi?id=27324
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #9 from super_man@post.com --- Does it work on windows? Where does that path limit come? How about a workaround that exceeds the limit and prints error message that default path max has been overrun. There is no way typical user would solve thiskind of error himself, moving game into shorter directories.
https://bugs.winehq.org/show_bug.cgi?id=27324
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |kernel32
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- Hi again, Béla. I missed that you said it works for you on Windows, could you double check path length there? Best as in many cases if someone wrote additional tests for this function, some tests we got now don't look reliable or full enough to me.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- It may not have been called from the app, there are some OpenFile calls left in wimm. These should probably be replaced.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #12 from Nikolay Sivov bunglehead@gmail.com --- That makes more sense, need +tid,+mmio,+file to confirm. And yes, OpenFile() should not be used internally, unless something depends on it at API level. That's a task for after 1.8 is out.
https://bugs.winehq.org/show_bug.cgi?id=27324
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|kernel32 |-unknown
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #13 from Béla Gyebrószki gyebro69@gmail.com --- Created attachment 52890 --> https://bugs.winehq.org/attachment.cgi?id=52890 +tid,+mmio,+file log
The game starts without errors in Windows XP, when installed in the same (default) install location.
https://bugs.winehq.org/show_bug.cgi?id=27324
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #14 from Bruno Jesus 00cpxxx@gmail.com --- Confirming in wine 1.8-rc1. The log shows exactly what Alexandre said.
002e:trace:mmio:MMIO_Open ("SOUND\INTERFACE\INTERF_ARMY1.WAV", (nil), 00010000, ansi); 002e:trace:mmio:MMIO_ParseExtA ("SOUND\INTERFACE\INTERF_ARMY1.WAV") 002e:trace:mmio:MMIO_SetBuffer (0x154f1b40 (nil) 8192 0) 002e:trace:mmio:mmioDosIOProc (0x154f1b40, 3, 0x52908460, 0x0); 002e:trace:file:OpenFile SOUND\INTERFACE\INTERF_ARMY1.WAV OF_READ OF_SHARE_COMPAT 002e:trace:file:OpenFile SOUND\INTERFACE\INTERF_ARMY1.WAV 0000 002e:trace:file:RtlGetFullPathName_U (L"SOUND\INTERFACE\INTERF_ARMY1.WAV" 520 0x33d8e8 0x33d8e4) 002e:trace:file:RtlDosPathNameToNtPathName_U (L"C:\Program Files\DotEmu\All Cossacks And American Conquest Series\Cossacks II - Napoleonic Wars\SOUND\INTERFACE\INTERF_ARMY1.WAV",0x33d6d8,(nil),(nil)) ... 002e:trace:file:SearchPathW found L"C:\Program Files\DotEmu\All Cossacks And American Conquest Series\Cossacks II - Napoleonic Wars\SOUND\INTERFACE\INTERF_ARMY1.WAV" 002e:trace:file:OpenFile found "\xc5\x1d\xca{\xf4\xdb3" 002e:trace:file:_lopen ("\xc5\x1d\xca{\xf4\xdb3",0000) 002e:trace:file:CreateFileW L"\00c5\001d\00ca{\00f4\00db3" GENERIC_READ FILE_SHARE_READ FILE_SHARE_WRITE creation 3 attributes 0x80 002e:trace:file:RtlDosPathNameToNtPathName_U (L"\00c5\001d\00ca{\00f4\00db3",0x33d9f8,(nil),(nil)) 002e:trace:file:RtlGetFullPathName_U (L"\00c5\001d\00ca{\00f4\00db3" 520 0x33d778 (nil)) 002e:warn:file:CreateFileW Unable to create file L"\00c5\001d\00ca{\00f4\00db3" (status c0000033) 002e:trace:file:CreateFileW returning 0xffffffff 002e:warn:file:OpenFile (SOUND\INTERFACE\INTERF_ARMY1.WAV): return = HFILE_ERROR error= 123
The code:
/************************************************************************** * mmioDosIOProc [internal] */ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, LPARAM lParam1, LPARAM lParam2) ... /* if filename NULL, assume open file handle in adwInfo[0] */ if (szFileName) { OFSTRUCT ofs; lpmmioinfo->adwInfo[0] = OpenFile(szFileName, &ofs, lpmmioinfo->dwFlags & 0xFFFF); } if (lpmmioinfo->adwInfo[0] == HFILE_ERROR) ret = MMIOERR_FILENOTFOUND; ...
https://bugs.winehq.org/show_bug.cgi?id=27324
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |winmm&mci
--- Comment #15 from Bruno Jesus 00cpxxx@gmail.com --- If comment 2 had received enough attention in the time it was posted this wouldn't have lasted so long ;-)
https://bugs.winehq.org/show_bug.cgi?id=27324
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #16 from winetest@luukku.com --- I could be totally wrong, I am not even trying to analyze the bug since many times it's quite difficult.
Comment 14 includes short trace. And it does include CreateFileW error.
And there is a recent commit related to it. See bug 41002. It also could be that the failure has happened already. But it could be worth to test.
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #17 from Béla Gyebrószki gyebro69@gmail.com --- (In reply to winetest from comment #16)
I could be totally wrong, I am not even trying to analyze the bug since many times it's quite difficult.
Comment 14 includes short trace. And it does include CreateFileW error.
And there is a recent commit related to it. See bug 41002. It also could be that the failure has happened already. But it could be worth to test.
No change as of yet.
wine-1.9.16-252-gcf22192
https://bugs.winehq.org/show_bug.cgi?id=27324
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #18 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occur with current wine(4.0-rc2)?
https://bugs.winehq.org/show_bug.cgi?id=27324
--- Comment #19 from Béla Gyebrószki gyebro69@gmail.com --- (In reply to joaopa from comment #18)
Does the bug still occur with current wine(4.0-rc2)?
Yes it does, I just tested in Wine 4.0-rc4.
https://bugs.winehq.org/show_bug.cgi?id=27324
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/blob/mast | |er/patches/winmm-Replace_Op | |enFile/0001-winmm-Use-_lope | |n-instead-of-OpenFile.patch
--- Comment #20 from Béla Gyebrószki gyebro69@gmail.com --- This bug is fixed in Wine-Staging 5.5 as a result of https://github.com/wine-staging/wine-staging/commit/f993930ee6d037916c5560b8...
https://bugs.winehq.org/show_bug.cgi?id=27324
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Resolution|--- |FIXED
--- Comment #21 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=5ee2ef52175c8bf506c4eb9a6...
https://bugs.winehq.org/show_bug.cgi?id=27324
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5ee2ef52175c8bf506c4eb9a67b | |de4cb72a93853
https://bugs.winehq.org/show_bug.cgi?id=27324
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #22 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.6.