Debugging Wine C++ Runtime library Error on Ubuntu 18.04

Questions about Wine on Linux
Locked
gregory68
Newbie
Newbie
Posts: 2
Joined: Mon Jan 24, 2022 11:41 am

Debugging Wine C++ Runtime library Error on Ubuntu 18.04

Post by gregory68 »

Hi,

I'm using the lates Wine 7.0 on Ubuntu 18.04.
When running IxExplorer.exe application (installed from a Windows intaller):
wine /users/galileo101/gregory/.wine/drive_c/Program\ Files\ \(x86\)/Ixia/IxOS/9.12.2100.7/IxExplorer.exe

I received "Wine C++ Runtime library" message box error.
Screenshot-wine-c++-runtime-error.jpg

I then tried to debug the error and ran the application with the debug messages:
WINEDEBUG=+all wine /users/galileo101/gregory/.wine/drive_c/Program\ Files\ \(x86\)/Ixia/IxOS/9.12.2100.7/IxExplorer.exe

In the debug output I found the above error message:
3828042.603:0020:0024:trace:message:SPY_ExitMessage (00020040) L"Wine C++ Runtim" [000c] WM_SETTEXT returned 00000001
3828042.603:0020:0024:trace:msgbox:MSGBOX_OnInit L"Runtime error!\n\nProgram: C:\\Program Files (x86)\\Ixia\\IxOS\\9.12.2100.7\\IxExplorer.exe\nabnormal program termination\n\nPress OK to exit the program, or Cancel to start the Wine debugger.\n"


and also slightly before it the following messages sequence that ends with EXCEPTION_WINE_CXX_EXCEPTION message
that seems to lead to the abovementioned runtime error.

3828042.491:0020:0024:Call shell32.SHGetKnownFolderPath(003a3c68,00008000,00000000,0032f6a4) ret=0037c872
3828042.491:0020:0024:trace:shell:SHGetKnownFolderPath {bcbd3057-ca5c-4622-b42d-bc56db0ae516}, 0x00008000, 00000000, 0032F6A4
3828042.491:0020:0024:trace:shell:SHGetFolderPathAndSubDirW 00000000,0x806f,00000000,0,(null),0032EF08
3828042.491:0020:0024:Call KERNEL32.IsBadStringPtrW(0032e950,ffffffff) ret=03627324
3828042.491:0020:0024:Ret KERNEL32.IsBadStringPtrW() retval=00000000 ret=03627324
3828042.491:0020:0024:trace:shell:SHGetFolderPathAndSubDirW returning 0x80070057 (final path is L"")
3828042.491:0020:0024:trace:shell:SHGetKnownFolderPath Failed to get folder path, 0x80070057.
3828042.491:0020:0024:Ret shell32.SHGetKnownFolderPath() retval=80070057 ret=0037c872
3828042.491:0020:0024:Call ucrtbase._CxxThrowException(0032f408,003a8c70) ret=0037d90b
3828042.491:0020:0024:Call KERNEL32.RaiseException(e06d7363,00000001,00000003,0032f124) ret=70b57217
3828042.491:0020:0024:trace:seh:dispatch_exception code=e06d7363 flags=1 addr=7B010172 ip=7b010172 tid=0024
3828042.491:0020:0024:trace:seh:dispatch_exception info[0]=19930520
3828042.491:0020:0024:trace:seh:dispatch_exception info[1]=0032f408
3828042.491:0020:0024:trace:seh:dispatch_exception info[2]=003a8c70
3828042.491:0020:0024:warn:seh:dispatch_exception EXCEPTION_WINE_CXX_EXCEPTION exception (code=e06d7363) raised


Analyzing the above messages sequence I came to the following conclusions.

The EXCEPTION_WINE_CXX_EXCEPTION exception seems to be a consequence of the following error in Wine's SHGetFolderPathAndSubDirW function:
3828042.491:0020:0024:trace:shell:SHGetFolderPathAndSubDirW returning 0x80070057 (final path is L"")
3828042.491:0020:0024:trace:shell:SHGetKnownFolderPath Failed to get folder path, 0x80070057.


This function was called with "nFolder" input argument value 0x806f according to the shellpath.c source code https://github.com/wine-mirror/wine/blo ... hellpath.c
3828042.491:0020:0024:trace:shell:SHGetFolderPathAndSubDirW 00000000,0x806f,00000000,0,(null),0032EF08

The code in the function then sets folder variable to the 0x6f value.
DWORD folder = nFolder & CSIDL_FOLDER_MASK;

The folder variable is used as index to the CSIDL_Data array.
type = CSIDL_Data[folder].type;

which contains the following entry in the index 0x6f.

{ /* 0x6f */
&FOLDERID_UserProgramFilesCommon,
CSIDL_Type_Disallowed, /* FIXME */
NULL,
NULL,

KF_CATEGORY_PERUSER, /* category */
UserProgramFilesCommonW, /* name */
NULL, /* description */
&FOLDERID_UserProgramFiles, /* parent */
CommonW, /* relative path */
NULL, /* parsing */
NULL, /* tooltip */
NULL, /* localized */
NULL, /* icon */
NULL, /* security */
0, /* attributes */
0, /* flags */
&GUID_NULL /* typeid */
},


The above entry for UserProgramFilesCommonW path is marked as CSIDL_Type_Disallowed which finally causes SHGetFolderPathAndSubDirW function failure which in turn causes the EXCEPTION_WINE_CXX_EXCEPTION.

Now my question is whether my analysis is correct ? And if so what does it mean that the path is CSIDL_Type_Disallowed ?
Does it means that Wine does not support applications that call SHGetFolderPathAndSubDirW with this path ?

Thanks,

Gregory
Locked