Anyone willing to debug why the new SafeInCloud Version is not working on Wine?

Questions about Wine on Linux
Post Reply
davgro
Newbie
Newbie
Posts: 3
Joined: Wed Dec 27, 2023 4:49 am

Anyone willing to debug why the new SafeInCloud Version is not working on Wine?

Post by davgro »

SafeInCloud 22.3.3.0 works fine with winetricks, anything above like 24.6.4 installs fine but does not start.

Wine 9.5
dotnet 4.6.2
Fedora 40

Equal topic but now with Fedora 40
XP100
Level 1
Level 1
Posts: 8
Joined: Mon Apr 29, 2024 2:48 pm

Re: Anyone willing to debug why the new SafeInCloud Version is not working on Wine?

Post by XP100 »

`RoResolveNamespace` is not implemented in "wine/dlls/wintypes/main.c".

The exception is raised here:

Code: Select all

0024:fixme:combase:RoGetActivationFactory (L"Windows.ApplicationModel.DesignMode", {2c3893cc-f81a-4e7a-b857-76a80887e185}, 0031C310): semi-stub
0024:err:combase:RoGetActivationFactory Failed to find library for L"Windows.ApplicationModel.DesignMode"
0024:fixme:wintypes:RoResolveNamespace name L"Windows.Storage", windowsMetaDataDir L"", metaDataFilePaths 0031C3C8, subNamespaces 00000000 stub!
0024:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub
0024:fixme:advapi:ReportEventW (CAFE4242,0x0001,0x0000,0x00000402,00000000,0x0001,0x00000000,0031D980,00000000): stub
0024:err:eventlog:ReportEventW L"Application: SafeInCloud.exe\n"
0024:err:eventlog:ReportEventW L"Framework Version: v4.0.30319\n"
0024:err:eventlog:ReportEventW L"Description: The process was terminated due to an unhandled exception.\n"
0024:err:eventlog:ReportEventW L"Exception Info: System.TypeLoadException\n"
...
@ElementalWarrior has a hack that returns the path.
1. RoResolveNamespace

I hacked in RoResolveNamespace calls specifically to get photo running: https://gitlab.winehq.org/ElementalWarr ... 050049e685

So any lines about RoResolveNamespace not followed by Found ... aren't resolving properly.

RoResolveNamespace docs: Determine the direct children, types, and sub-namespaces of the specified Windows Runtime namespace, from any programming language supported by the Windows Runtime.

Its responsible for looking up types, etc for the runtime. Which is used by C#, and WinRT/ C++/CX. So if I didn't hack in the path to the winmd files, it isn't going to resolve those types properly.

WinRT is window's effort to export headers/have an interface for any language to look up types, or build bindings to their libraries.
Code snippet:

Code: Select all

if(wcsstr(buffer, L"Windows.Storage") > 0){
    FIXME("Found Windows.Storage \n");
    path = L"C:\\windows\\system32\\WinMetadata\\Windows.Storage.winmd";
    if(WindowsCreateString(path, wcslen(path), str) == S_OK) {
        FIXME("Setting vars\n");
        *metaDataFilePaths = str;
        *metaDataFilePathsCount = 1;
        FIXME("Done setting\n");
    } else {
        FIXME("OUT OF MEMORY");
        return E_OUTOFMEMORY;
    }
    // *subNamespacesCount = 0;
    // WindowsCreateString(L"StoreContract", wcslen(L"StoreContract"), str2);
    // *subNamespaces = str2;
    FIXME("S_OK\n");
    return S_OK;
}
Affinity Photo running on Linux with Bottles:
https://forum.affinity.serif.com/index. ... nt=1129103

Commit 3de8daf6: wintypes: Hack in some calls to RoResolveNamespace:
https://gitlab.winehq.org/ElementalWarr ... 050049e685

After you merge the "wine/dlls/wintypes/main.c", recompile the "wintypes.dll" and then place it in the Wine lib directory, such as "/opt/wine-staging/lib/wine/i386-windows/" (32 bit) or "/opt/wine-staging/lib64/wine/x86_64-windows/" (64 bit).

Of course, Wine is missing the "WinMetadata" folder in "~/.wine/drive_c/windows/system32/" or "syswow64/" (32 bit), so you will need to copy that from "C:\Windows\System32\WinMetadata" or "C:\Windows\SysWOW64\WinMetadata" (32 bit).

After all that, the program runs, but the window is black. I get shader compilation errors:

Code: Select all

014c:err:d3dcompiler:D3DCompile2 Failed to compile shader, vkd3d result -4.
014c:err:d3dcompiler:D3DCompile2 Shader log:
014c:err:d3dcompiler:D3DCompile2     <anonymous>:146:16: E5000: syntax error, unexpected KW_COMPILE
014c:err:d3dcompiler:D3DCompile2

Code: Select all

0140:err:d3dcompiler:D3DCompile2 Failed to compile shader, vkd3d result -4.
0140:err:d3dcompiler:D3DCompile2 Shader log:
0140:err:d3dcompiler:D3DCompile2     <anonymous>:144:1: E5000: syntax error, unexpected KW_PASS, expecting '}'
0140:err:d3dcompiler:D3DCompile2
Post Reply