[Bug 46815] New: PS4 Remote Play 2.x (.NET 4.x app) fails on startup, reports 'Cannot connect to the server.' (missing TEMP directory in user' s Local AppData directory)
wine-bugs at winehq.org
wine-bugs at winehq.org
Sun Mar 10 11:49:55 CDT 2019
https://bugs.winehq.org/show_bug.cgi?id=46815
Bug ID: 46815
Summary: PS4 Remote Play 2.x (.NET 4.x app) fails on startup,
reports 'Cannot connect to the server.' (missing TEMP
directory in user's Local AppData directory)
Product: Wine
Version: 4.3
Hardware: x86-64
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: shell32
Assignee: wine-bugs at winehq.org
Reporter: focht at gmx.net
Distribution: ---
Hello folks,
continuation of bug 46809 (and bug 46812).
The app still fails, displaying a message "Cannot connect to the server.".
Prerequisite:
* 64-bit WINEPREFIX
* .NET Framework 4.6 ('winetricks -q dotnet46)
* Windows version set to 8.1 or higher
Install with Wine-Staging 4.3 or use patch from bug 46812
Work around bug 46809 (https://bugs.winehq.org/show_bug.cgi?id=46809#c2)
--- snip ---
$ pwd
/home/focht/.wine/drive_c/Program Files (x86)/Sony/PS4 Remote Play
$ WINEDEBUG=+seh,+relay wine ./RemotePlay.exe >>log.txt 2>&1
...
0040:Call
shell32.SHGetFolderPathW(00000000,0000001c,00000000,00000000,001f2720)
ret=79b46917
...
0040:Call shlwapi.PathFileExistsW(0683f440 L"C:\\users\\focht\\Local
Settings\\Application Data") ret=786a4a8c
...
0040:Ret shlwapi.PathFileExistsW() retval=00000001 ret=786a4a8c
0040:Ret shell32.SHGetFolderPathW() retval=00000000 ret=79b46917
...
0040:Call KERNEL32.GetFullPathNameW(0683f458 L"C:\\users\\focht\\Local
Settings\\Application Data",00000105,0683f22c,00000000) ret=79b48abb
0040:Ret KERNEL32.GetFullPathNameW() retval=0000002e ret=79b48abb
...
0040:Call KERNEL32.GetFullPathNameW(0683f3e4 L"C:\\users\\focht\\Local
Settings\\Application
Data\\Temp\\rp-version-win.json",00000105,0683f1b8,00000000) ret=79b48abb
0040:Ret KERNEL32.GetFullPathNameW() retval=00000047 ret=79b48abb
...
0040:Call KERNEL32.GetLastError() ret=00cb4513
0040:Ret KERNEL32.GetLastError() retval=000003f0 ret=00cb4513
0040:Call KERNEL32.CreateFileW(0171eb50 L"C:\\users\\focht\\Local
Settings\\Application
Data\\Temp\\rp-version-win.json",40000000,00000001,00000000,00000002,00100000,00000000)
ret=79b47fac
0040:Ret KERNEL32.CreateFileW() retval=ffffffff ret=79b47fac
...
0040:Call KERNEL32.GetFullPathNameW(0683f3e4 L"C:\\users\\focht\\Local
Settings\\Application Data\\Temp\\pplist.json",00000105,0683f1b8,00000000)
ret=79b48abb
0040:Ret KERNEL32.GetFullPathNameW() retval=0000003f ret=79b48abb
...
0040:Call KERNEL32.CreateFileW(0171f224 L"C:\\users\\focht\\Local
Settings\\Application
Data\\Temp\\pplist.json",40000000,00000001,00000000,00000002,00100000,00000000)
ret=79b47fac
0040:Ret KERNEL32.CreateFileW() retval=ffffffff ret=79b47fac
0040:Call KERNEL32.GetLastError() ret=00cb4513
0040:Ret KERNEL32.GetLastError() retval=00000003 ret=00cb4513
...
0040:Call KERNEL32.RaiseException(e0434352,00000001,00000005,0683f5a0)
ret=00c9d135
0040:trace:seh:raise_exception code=e0434352 flags=1 addr=0x7b44c03b
ip=7b44c03b tid=0040
0040:trace:seh:raise_exception info[0]=80070003
0040:trace:seh:raise_exception info[1]=00000000
0040:trace:seh:raise_exception info[2]=00000000
0040:trace:seh:raise_exception info[3]=00000000
0040:trace:seh:raise_exception info[4]=00b70000
0040:trace:seh:raise_exception eax=7b43a48d ebx=00000005 ecx=00000000
edx=0683f550 esi=0683f550 edi=0683f510
0040:trace:seh:raise_exception ebp=0683f4e8 esp=0683f484 cs=6830023 ds=683002b
es=f7c5002b fs=f7c50063 gs=f7c5006b flags=00000216
0040:trace:seh:call_vectored_handlers calling handler at 0xc95ce3 code=e0434352
flags=1
0040:Call KERNEL32.GetLastError() ret=00c95d11
0040:Ret KERNEL32.GetLastError() retval=00000003 ret=00c95d11
...
0038:Call user32.CreateWindowExW(00000000,01719420
L"WindowsForms10.STATIC.app.0.141b42a_r5_ad1",01727e08 L"Cannot connect to the
server.",5600000d,00000010,0000001c,000001c0,00000041,0001008a,00000000,00400000,00000000)
ret=0506dccf
...
--- snip ---
Corresponding managed callstacks using CLR debugger (normally invisible):
--- snip ---
...
(f6.f3): CLR exception - code e0434352 (first chance)
Exception object: 0174ac28
Exception type: System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'C:\users\focht\Local
Settings\Application Data\Temp\rp-version-win.json'.
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80070003
OS Thread Id: 0xf3 (8)
Child SP IP Call Site
0682f5f4 7b44c03b [HelperMethodFrame: 0682f5f4]
0682f6a4 79ad7de4 System.IO.__Error.WinIOError(Int32, System.String)
0682f6c4 79a95714 System.IO.FileStream.Init(System.String, System.IO.FileMode,
System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32,
System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean,
Boolean)
0682f794 79a664e7 System.IO.FileStream..ctor(System.String, System.IO.FileMode,
System.IO.FileAccess)
0682f7b0 03e655df System.Net.WebClient.DownloadFileAsync(System.Uri,
System.String, System.Object)
0682f7ec 03e65510 System.Net.WebClient.DownloadFileAsync(System.Uri,
System.String)
0682f7f4 003edb75 RemoteplayUI.CheckUpdate.?()
0682f890 79b1b6b2 System.Threading.Tasks.Task`1[[System.Int32,
mscorlib]].InnerInvoke()
0682f89c 79b1e570 System.Threading.Tasks.Task.Execute()
0682f8c0 79b1e9ba
System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
0682f8c4 79a963e4
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
0682f930 79a96326
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
0682f944 79b1e838
System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task
ByRef)
0682f9a8 79b1e724 System.Threading.Tasks.Task.ExecuteEntry(Boolean)
0682f9b8 79b1e66c
System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
0682f9bc 79adb953 System.Threading.ThreadPoolWorkQueue.Dispatch()
0682fa0c 79adb7fa
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
0682fc34 00b71366 [DebuggerU2MCatchHandlerFrame: 0682fc34]
(f6.f3): CLR exception - code e0434352 (first chance)
Exception object: 0174c808
Exception type: System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'C:\users\focht\Local
Settings\Application Data\Temp\pplist.json'.
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80070003
OS Thread Id: 0xf3 (8)
Child SP IP Call Site
0682f5f4 7b44c03b [HelperMethodFrame: 0682f5f4]
0682f6a4 79ad7de4 System.IO.__Error.WinIOError(Int32, System.String)
0682f6c4 79a95714 System.IO.FileStream.Init(System.String, System.IO.FileMode,
System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32,
System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean,
Boolean)
0682f794 79a664e7 System.IO.FileStream..ctor(System.String, System.IO.FileMode,
System.IO.FileAccess)
0682f7b0 03e655df System.Net.WebClient.DownloadFileAsync(System.Uri,
System.String, System.Object)
0682f7ec 03e65510 System.Net.WebClient.DownloadFileAsync(System.Uri,
System.String)
0682f7f4 003edc60 RemoteplayUI.CheckUpdate.?()
0682f890 79b1b6b2 System.Threading.Tasks.Task`1[[System.Int32,
mscorlib]].InnerInvoke()
0682f89c 79b1e570 System.Threading.Tasks.Task.Execute()
0682f8c0 79b1e9ba
System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
0682f8c4 79a963e4
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
0682f930 79a96326
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
0682f944 79b1e838
System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task
ByRef)
0682f9a8 79b1e724 System.Threading.Tasks.Task.ExecuteEntry(Boolean)
0682f9b8 79b1e66c
System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
0682f9bc 79adb953 System.Threading.ThreadPoolWorkQueue.Dispatch()
0682fa0c 79adb7fa
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
0682fc34 00b71366 [DebuggerU2MCatchHandlerFrame: 0682fc34]
...
--- snip ---
Looks like the app wants to put files into '%CSIDL_LOCAL_APPDATA%\\Temp'
https://stackoverflow.com/questions/1322442/getting-user-temporary-folder-path-in-windows
--- quote ---
In Windows 10, this can be tricky because the value of the Temporary Path
depends not only what it's set to by default, but also what kind of app you're
using. So it depends what specifically you need.
[Common Area] TEMP in User's Local App Data
#include <Windows.h>
#include <Shlobj.h>
#include <Shlobj_core.h>
#include <string_view>
// ...
static void GetUserLocalTempPath(std::wstring& input_parameter) {
static constexpr std::wstring_view temp_label = L"\\Temp\\";
HWND folder_handle = { 0 };
WCHAR temp_path[MAX_PATH];
auto get_folder = SHGetFolderPath(
folder_handle, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_DEFAULT, temp_path
);
if (get_folder == S_OK) {
input_parameter = static_cast<const wchar_t*>(temp_path);
input_parameter.append(temp_label);
CloseHandle(folder_handle);
}
}
GetUserLocalTempPath will likely return the full name instead of the short
name.
Also, if whatever is running it is doing it as as SYSTEM instead of a logged in
user, instead of it returning %USERPROFILE%\AppData\Local\Temp, it will return
something more like,
C:\Windows\System32\config\systemprofile\AppData\Local\Temp
--- quote ---
Manually creating the directory gets the app further (to run into next issue)
Wine source:
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/shell32/shellpath.c#l4570
--- snip ---
4570
/******************************************************************************
4571 * create_extra_folders [Internal]
4572 *
4573 * Create some extra folders that don't have a standard CSIDL definition.
4574 */
4575 static HRESULT create_extra_folders(void)
4576 {
4577 static const WCHAR environW[] =
{'E','n','v','i','r','o','n','m','e','n','t',0};
4578 static const WCHAR microsoftW[] =
{'M','i','c','r','o','s','o','f','t',0};
4579 static const WCHAR TempW[] = {'T','e','m','p',0};
4580 static const WCHAR TEMPW[] = {'T','E','M','P',0};
4581 static const WCHAR TMPW[] = {'T','M','P',0};
4582 WCHAR path[MAX_PATH+5];
4583 HRESULT hr;
4584 HKEY hkey;
4585 DWORD type, size, ret;
4586
4587 ret = RegCreateKeyW( HKEY_CURRENT_USER, environW, &hkey );
4588 if (ret) return HRESULT_FROM_WIN32( ret );
4589
4590 /* FIXME: should be under AppData, but we don't want spaces in the
temp path */
4591 hr = SHGetFolderPathAndSubDirW( 0, CSIDL_PROFILE | CSIDL_FLAG_CREATE,
NULL,
4592 SHGFP_TYPE_DEFAULT, TempW, path );
4593 if (SUCCEEDED(hr))
4594 {
4595 size = sizeof(path);
4596 if (RegQueryValueExW( hkey, TEMPW, NULL, &type, (LPBYTE)path,
&size ))
4597 RegSetValueExW( hkey, TEMPW, 0, REG_SZ, (LPBYTE)path,
(strlenW(path) + 1) * sizeof(WCHAR) );
4598 size = sizeof(path);
4599 if (RegQueryValueExW( hkey, TMPW, NULL, &type, (LPBYTE)path, &size
))
4600 RegSetValueExW( hkey, TMPW, 0, REG_SZ, (LPBYTE)path,
(strlenW(path) + 1) * sizeof(WCHAR) );
4601 }
4602 RegCloseKey( hkey );
4603
4604 if (SUCCEEDED(hr))
4605 {
4606 hr = SHGetFolderPathAndSubDirW( 0, CSIDL_COMMON_APPDATA |
CSIDL_FLAG_CREATE, NULL,
4607 SHGFP_TYPE_DEFAULT, microsoftW,
path );
4608 }
4609 if (SUCCEEDED(hr))
4610 {
4611 hr = SHGetFolderPathAndSubDirW(0, CSIDL_APPDATA |
CSIDL_FLAG_CREATE, NULL,
4612 SHGFP_TYPE_DEFAULT,
Microsoft_Windows_ThemesW, path);
4613 }
4614 return hr;
4615 }
--- snip ---
There is even a related FIXME comment.
$ sha1sum RemotePlayInstaller.exe
d7e56a826e82689383687dfc63fe2a035b987604 RemotePlayInstaller.exe
$ du -sh RemotePlayInstaller.exe
19M RemotePlayInstaller.exe
$ wine --version
wine-4.3-229-g6d82b2f1ad
Regards
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list