As SHGetFolderPath does not have a linux equivalent, I haven't been able to get past this error as easily. Does anyone have any idea what could be amiss here?
I have reproduced this using wine 1.8 and a clean install of wine 2.0.2
Relevant code:
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) // putting this here so SUCCEEDED is definitely defined
void classname::functionname(CHAR* prefixpath)
{
TCHAR lpPath[MAX_USER_NAME_LEN] = {NULL};
cout << (void*)SHGetFolderPath << endl;
cout << (void*)SHGetFolderPathA << endl;
cout << CSIDL_COMMON_APPDATA << endl;
cout << lpPath << endl;
if (SUCCEEDED(SHGetFolderPath(0, CSIDL_COMMON_APPDATA, NULL, 0, lpPath)))
Output:
> wine nameofprogram.exe.so
Code: Select all
0x7defb820
0x7defb820
35
Segmentation fault (core dumped)
>gdb wine /tmp/nameofcore
Code: Select all
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from wine...Reading symbols from /usr/lib/debug/.build-id/04/7f2ad86868be8f73f32ac6f05512a4d07ce88f.debug...done.
done.
warning: core file may not match specified executable file.
[New LWP 15385]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by 'nameofprogram.exe.so
'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00000000 in ?? ()
#0 0x00000000 in ?? ()
#1 0x7ab84308 in nameofclass::nameoffunction (this=0xff8521e1,
prefixpath=0xff85099c "") at nameoffile:1678
...
> (gdb) frame 1
Code: Select all
#1 0x7ab84308 in nameofclass::nameoffunction (this=0xff8521e1,
prefixpath=0xff85099c "") at nameoffile:1678
1678 if (SUCCEEDED(SHGetFolderPath(0, CSIDL_COMMON_APPDATA, NULL, 0, lpPath)))