Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Wine error: Couldn't get desktop folder

I copied a wine prefix to a different user, and was then unable to start my application. I struggled to get the app to work, and started backtracking to see if I could get more info. I learned that even explorer.exe was not working in Wine. I don't control that at all! That's a built-in component of Wine. So if that doesn't work, I've really messed something up!

WINEPREFIX=/home/bgstack15/.wine WINEARCH=win64 wine explorer.exe

When explorer.exe doesn't work in wine, you KNOW you have a problem! Here is the output of the error message.

Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040be65).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:006b GS:0063
 EIP:0040be65 ESP:0078f7a0 EBP:0078fe68 EFLAGS:00010206(  R- --  I   - -P- )
 EAX:80070057 EBX:008a38c0 ECX:00000000 EDX:7149b720
 ESI:0089c980 EDI:0078f854
Stack dump:
0x0078f7a0:  0089cc48 00000000 00000000 0089ca88
0x0078f7b0:  00000000 00000000 00000280 00000018
0x0078f7c0:  0001005c 00000000 00400000 00000000
0x0078f7d0:  00000064 00891cc2 000000c4 00000000
0x0078f7e0:  7bc27600 688df3d0 00000000 00000000
0x0078f7f0:  008a1ffc 008a2004 01322014 0078f820
Backtrace:
=>0 0x0040be65 IShellFolder_Release+0x9(This=<internal error>) [Y:\include\shobjidl.h:1707] in explorer (0x0078fe68)
  1 0x0040be65 make_explorer_window+0x82a(params=<internal error>) [Y:\programs\explorer\explorer.c:372] in explorer (0x0078fe68)
  2 0x0040be65 wWinMain+0x995(hinstance=<couldn't compute location>, previnstance=<couldn't compute location>, cmdline=<couldn't compute location>, cmdshow=<couldn't compute location>) [Y:\programs\explorer\explorer.c:927] in explorer (0x0078fe68)
  3 0x00410568 wmain+0xa8(argc=<couldn't compute location>, argv=<couldn't compute location>) [Y:\dlls\msvcrt\crt_wwinmain.c:55] in explorer (0x0078fef8)
  4 0x004104b8 wmainCRTStartup+0x68() [Y:\dlls\msvcrt\crt_wmain.c:60] in explorer (0x0078ff30)
  5 0x7b6293e0 in kernel32 (+0x293e0) (0x0078ff48)
  6 0x7bc5ca37 in ntdll (+0x5ca37) (0x0078ff5c)
  7 0x7bc5d258 in ntdll (+0x5d258) (0x0078ffec)
0x0040be65 wWinMain+0x995 [Y:\programs\explorer\explorer.c:927] in explorer: movl   0x0(%ecx),%eax
Unable to access file 'Y:\programs\explorer\explorer.c'
Modules:
Module  Address         Debug info  Name (60 modules)
PE  00400000-0048f000   Dwarf-4         explorer
PE  00b40000-00d5f000   Deferred        rpcrt4
PE  016a0000-01b2c000   Deferred        ole32
PE  01b30000-01bb6000   Deferred        winex11
PE  01cb0000-020ec000   Deferred        actxprxy
PE  62500000-628ff000   Deferred        oleaut32
PE  63080000-630aa000   Deferred        zlib1
PE  64a80000-64ad8000   Deferred        win32u
PE  65680000-65900000   Deferred        msvcrt
PE  66080000-66180000   Deferred        shlwapi
PE  66640000-6665c000   Deferred        version
PE  667c0000-66809000   Deferred        shcore
PE  67500000-67552000   Deferred        imm32
PE  67bc0000-6805e000   Deferred        comctl32
PE  684c0000-68610000   Deferred        combase
PE  68880000-68d46000   Deferred        user32
PE  69840000-69938000   Deferred        advapi32
PE  6aac0000-6ada1000   Deferred        ucrtbase
PE  6bbc0000-6bc59000   Deferred        sechost
PE  6bc80000-6bcec000   Deferred        explorerframe
PE  6da80000-6dc9c000   Deferred        gdi32
PE  70d80000-70e23000   Deferred        uxtheme
PE  71400000-720ab000   Deferred        shell32
PE  7b000000-7b51a000   Deferred        kernelbase
PE  7b600000-7b757000   Dwarf-4         kernel32
PE  7bc00000-7beba000   Dwarf-4         ntdll
ELF 7d000000-7d005000   Deferred        <wine-loader>
ELF 7f416000-7f41e000   Deferred        libxfixes.so.3
ELF 7f41e000-7f42b000   Deferred        libxcursor.so.1
ELF 7f42b000-7f440000   Deferred        libxi.so.6
ELF 7f440000-7f445000   Deferred        libxcomposite.so.1
ELF 7f445000-7f454000   Deferred        libxrandr.so.2
ELF 7f454000-7f462000   Deferred        libxrender.so.1
ELF 7f462000-7f469000   Deferred        libxxf86vm.so.1
ELF 7f469000-7f46e000   Deferred        libxinerama.so.1
ELF 7f46e000-7f47d000   Deferred        libmd.so.0
ELF 7f47d000-7f494000   Deferred        libbsd.so.0
ELF 7f494000-7f49b000   Deferred        libxdmcp.so.6
ELF 7f49b000-7f4a0000   Deferred        libxau.so.6
ELF 7f4a0000-7f4ce000   Deferred        libxcb.so.1
ELF 7f4ce000-7f61f000   Deferred        libx11.so.6
ELF 7f61f000-7f635000   Deferred        libxext.so.6
ELF 7f64d000-7f6d7000   Deferred        winex11.so
ELF 7f6f7000-7f723000   Deferred        libexpat.so.1
ELF 7f723000-7f772000   Deferred        libfontconfig.so.1
ELF 7f772000-7f795000   Deferred        libbrotlicommon.so.1
ELF 7f795000-7f7b2000   Deferred        libz.so.1
ELF 7f7b2000-7f881000   Deferred        libfreetype.so.6
ELF 7f881000-7f986000   Deferred        libm.so.6
ELF 7fe0e000-7fe18000   Deferred        libuuid.so.1
ELF 7fe18000-7fe55000   Deferred        libpng16.so.16
ELF 7fe6d000-7ffe0000   Deferred        win32u.so
ELF f7c00000-f7e28000   Deferred        libc.so.6
ELF f7e2f000-f7ede000   Deferred        ntdll.so
ELF f7ee0000-f7ee5000   Deferred        libpthread.so.0
ELF f7ee5000-f7eea000   Deferred        libdl.so.2
ELF f7eea000-f7ef4000   Deferred        libgtk3-nocsd.so.0
ELF f7ef7000-f7f05000   Deferred        libbrotlidec.so.1
ELF f7f05000-f7f0a000   Dwarf           libwine.so.1
ELF f7f14000-f7f49000   Deferred        ld-linux.so.2
Threads:
process  tid      prio    name (all IDs are in hex)
00000020 start.exe
    00000024    0     
00000038 services.exe
    0000003c    0     
    00000040    0     wine_rpcrt4_server
    0000004c    0     wine_rpcrt4_io
    00000050    0     wine_threadpool_worker
    00000064    0     wine_rpcrt4_io
    00000084    0     wine_rpcrt4_io
    00000090    0     wine_rpcrt4_io
    000000b0    0     wine_rpcrt4_io
    000000d8    0     wine_threadpool_worker
    000000dc    0     wine_threadpool_worker
    000000e0    0     wine_threadpool_waitqueue
    00000114    0     wine_rpcrt4_io
00000044 svchost.exe
    00000048    0     
    00000054    0     
    00000058    0     wine_sechost_service
0000005c winedevice.exe
    00000060    0     
    00000068    0     
    0000006c    0     wine_sechost_service
    00000070    0     
    00000074    0     
    00000078    0     
    000000e4    0     
0000007c winedevice.exe
    00000080    0     
    00000088    0     
    0000008c    0     wine_sechost_service
    00000094    0     
    00000098    0     
    0000009c    0     
    000000a0    0     
    000000a4    0     
000000a8 plugplay.exe
    000000ac    0     
    000000b4    0     
    000000b8    0     wine_sechost_service
    000000bc    0     wine_rpcrt4_server
000000e8 conhost.exe
    000000ec    0     
000000f0 (D) C:\windows\syswow64\explorer.exe
    000000f4    0 <== 
    00000138    0     wine_threadpool_worker
    00000154    0     
000000f8 explorer.exe
    000000fc    0     
    00000100    0     
    00000104    0     wine_rpcrt4_server
    00000134    0     wine_rpcrt4_io
    0000013c    0     wine_threadpool_worker
    00000140    0     wine_rpcrt4_io
    00000144    0     wine_rpcrt4_io
    00000148    0     wine_rpcrt4_io
0000010c rpcss.exe
    00000110    0     
    00000118    0     
    0000011c    0     wine_sechost_service
    00000120    0     wine_rpcrt4_server
    00000124    0     wine_rpcrt4_server
    00000128    0     wine_rpcrt4_io
    0000012c    0     wine_threadpool_worker
    00000130    0     wine_rpcrt4_io
System information:
    Wine build: wine-8.0-rc1 (Debian 8.0~rc1~repack-1)
    Platform: i386 (WOW64)
    Version: Windows 7
    Host system: Linux
    Host version: 6.1.0-1-amd64

I finally noticed this little message on the command line:

00fc:err:wineboot:ProcessStartupItems Couldn't get desktop folder.

Who would have thought that this would be significant? When I bothered to read it, I checked:

[bgstack15@pcb-006|/home/bgstack15/.wine/drive_c/users]$ ll bgstack15/
total 4
drwxr-xr-x 4 bgstack15 bgstack15 4096 Jan 10 21:00 AppData/

When most "C:\users\bgstack15\" directories resemble:

$ ls -l ~/.wine/drive_c/users/bgstack15
total 4
drwxr-xr-x 4 bgstack15 bgstack15 4096 Jan 10 21:00 AppData/
lrwxrwxrwx 1 bgstack15 bgstack15   21 Jan 10 21:10 Desktop -> /home/bgstack15/Desktop/
lrwxrwxrwx 1 bgstack15 bgstack15   23 Jan 10 21:10 Documents -> /home/bgstack15/Documents/
lrwxrwxrwx 1 bgstack15 bgstack15   23 Jan 10 21:10 Downloads -> /home/bgstack15/Downloads/
lrwxrwxrwx 1 bgstack15 bgstack15   19 Jan 10 21:10 Music -> /home/bgstack15/Music/
lrwxrwxrwx 1 bgstack15 bgstack15   22 Jan 10 21:10 Pictures -> /home/bgstack15/Pictures/
lrwxrwxrwx 1 bgstack15 bgstack15   20 Jan 10 21:10 Videos -> /home/bgstack15/Videos/

So I fixed this weird wine error with:

cd ~/.wine/drive_c/users/bgstack15 ; for word in Desktop Documents Downloads Music Pictures Videos ; do ln -s ~/"${word}" . ; done

Which means that I made the symlinks that go to those real directories, and then Wine would work! This happened because the wineprefix came from a different user in Linux, so even the drive C user directory was different, and somehow it just didn't bother making a fully fleshed-out user directory there.

Comments