https://bugs.winehq.org/show_bug.cgi?id=37915
Bug ID: 37915 Summary: IsWow64Process fix(es) required: 32bit UPlay games do not launch in a 64Bit prefix when Wine is set to Vista/Win7 Product: Wine Version: 1.7.34 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: abolte@systemsaviour.com Distribution: ---
While the recent commit http://source.winehq.org/git/wine.git/commitdiff/bfd088dbc6b4f397d9adfbc11a6... now allows Uplay to launch 64-bit games in a 64-bit prefix when Windows 7 is selected (and probably Vista and 8), it doesn't help with launching 32-bit games.
Since #33776 was closed without covering this situation, I'm opening this bug to cover that use-case here.
Attachment 50492 from #33776 (https://bugs.winehq.org/attachment.cgi?id=50492&action=diff) solves this for me, but seems to be a work in progress based on what the author has said there.
This issue is also perhaps not specific to Uplay, although I don't know of any other application affected by the bugs in the existing implementation at this time (hence the title).
https://bugs.winehq.org/show_bug.cgi?id=37915
Adam Bolte abolte@systemsaviour.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |win64 URL| |http://uplay.ubi.com/ CC| |abolte@systemsaviour.com Distribution|--- |Debian
https://bugs.winehq.org/show_bug.cgi?id=37915
Adam Bolte abolte@systemsaviour.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=37915
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=37915
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|UNCONFIRMED |NEW CC| |focht@gmx.net Summary|IsWow64Process fix(es) |32-bit UPlay games fail in |required: 32bit UPlay games |64-bit WINEPREFIX with |do not launch in a 64Bit |WinVer set to 'Windows |prefix when Wine is set to |Vista/7' ('IsWow64Process' |Vista/Win7 |fails if process was opened | |with | |'PROCESS_QUERY_LIMITED_INFO | |RMATION' rights) Ever confirmed|0 |1
--- Comment #1 from Anastasius Focht focht@gmx.net --- Hello folks,
refining the summary a bit to define the scope.
PROCESS_QUERY_INFORMATION can be denied on many processes in Vista+ (processes with different ownerships, elevated, etc). In order to still be able to retrieve basic info, PROCESS_QUERY_LIMITED_INFORMATION = cut-down information level was introduced. It available by default in Windows Vista+ and should work on any given process - even on processes don't belong to logged on user (and without elevated rights).
Regards
https://bugs.winehq.org/show_bug.cgi?id=37915
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
https://bugs.winehq.org/show_bug.cgi?id=37915
--- Comment #2 from Adam Bolte abolte@systemsaviour.com --- Thanks for the clarification Anastasius.
https://bugs.winehq.org/show_bug.cgi?id=37915
Berillions berillions@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |berillions@gmail.com
--- Comment #3 from Berillions berillions@gmail.com --- No evolution about this issue ?
Thanks,
https://bugs.winehq.org/show_bug.cgi?id=37915
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |wineserver Summary|32-bit UPlay games fail in |Multiple games and |64-bit WINEPREFIX with |applications need proper |WinVer set to 'Windows |handling of Vista+ |Vista/7' ('IsWow64Process' |'PROCESS_QUERY_LIMITED_INFO |fails if process was opened |RMATION' right (UPlay |with |games, MS Visual Studio |'PROCESS_QUERY_LIMITED_INFO |2015 installer) |RMATION' rights) | Severity|minor |normal
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
it seems the MS Visual Studio 2015 Community Edition installer is also suffering from this. Refining the summary and raising priority.
Download: https://go.microsoft.com/fwlink/?LinkId=532606
Prerequisite:
* .NET Framework 4.0, 4.5 -> 'winetricks -q dotnet40' and run the .NET Framework 4.5 installer manually (to avoid having all previous .NET Frameworks installed, not needed here) * Windows version set to 'Windows 7'
Terminal output, includes managed backtrace:
--- snip --- $ wine ./vs_community.exe ... fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub fixme:advapi:ReportEventW (0xcafe4242,0x0001,0x0000,0x00000402,(nil),0x0001,0x00000000,0x50ccd84,(nil)): stub err:eventlog:ReportEventW L"Application: vs_community.exe\nFramework Version: v4.0.30319\nDescription: The process was terminated due to an unhandled exception.\nException Info: System.ComponentModel.Win32Exception\nStack:\n at System.Diagnostics.Process.GetProcessTimes()\n at System.Diagnostics.Process.get_StartTime()\n "... fixme:advapi:DeregisterEventSource (0xcafe4242) stub
Unhandled Exception: fixme:nls:LocaleNameToLCID unsupported flags 8000000 fixme:nls:LocaleNameToLCID unsupported flags 8000000 fixme:nls:LocaleNameToLCID unsupported flags 8000000 fixme:advapi:EventRegister {8e9f5090-2d75-4d03-8a81-e5afbf85daf1}, 0xdc3902, (nil), 0x192e9b8 System.ComponentModel.Win32Exception: Success at System.Diagnostics.Process.GetProcessTimes() at System.Diagnostics.Process.get_StartTime() at Microsoft.Devdiv.Bootstrapper.ManagedUx.Run() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() wine: Unhandled exception 0xe0434352 in thread 38 at address 0x7b845d3d (thread 0038), starting debugger... --- snip ---
Relevant part of trace log:
--- snip --- ... 003a:Call KERNEL32.OpenProcess(00001000,00000000,00000030) ret=04c9f874 003a: open_process( pid=0030, access=00001000, attributes=00000000 ) 003a: open_process() = 0 { handle=023c } 003a:Ret KERNEL32.OpenProcess() retval=0000023c ret=04c9f874 003a:Call KERNEL32.GetLastError() ret=00ee19c8 003a:Ret KERNEL32.GetLastError() retval=00000000 ret=00ee19c8 ... 003a:Call KERNEL32.GetProcessTimes(0000023c,0192a178,0192a180,0192a188,0192a190) ret=04c9f970 003a:trace:ntdll:NtQueryInformationProcess (0x23c,0x00000004,0x50ce020,0x00000020,(nil)) 003a: get_process_info( handle=023c ) 003a: get_process_info() = ACCESS_DENIED { pid=0000, ppid=0000, affinity=00000000, peb=00000000, start_time=0, end_time=0, exit_code=0, priority=0, cpu=x86, debugger_present=0 } 003a:Ret KERNEL32.GetProcessTimes() retval=00000000 ret=04c9f970 003a:Call KERNEL32.GetLastError() ret=00ee19c8 003a:Ret KERNEL32.GetLastError() retval=00000000 ret=00ee19c8 ... --- snip ---
Managed code for reference:
--- snip --- // Microsoft.Win32.NativeMethods [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool GetProcessTimes(SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user);
...
// System.Diagnostics.Process private ProcessThreadTimes GetProcessTimes() { ProcessThreadTimes processThreadTimes = new ProcessThreadTimes(); SafeProcessHandle safeProcessHandle = null; try { safeProcessHandle = this.GetProcessHandle(1024, false); if (safeProcessHandle.IsInvalid) { throw new InvalidOperationException(SR.GetString("ProcessHasExited", new object[] { this.processId.ToString(CultureInfo.CurrentCulture) })); } if (!NativeMethods.GetProcessTimes(safeProcessHandle, out processThreadTimes.create, out processThreadTimes.exit, out processThreadTimes.kernel, out processThreadTimes.user)) { throw new Win32Exception(); } } finally { this.ReleaseProcessHandle(safeProcessHandle); } return processThreadTimes; } --- snip ---
The process is opened with 'PROCESS_QUERY_LIMITED_INFORMATION' (0x1000) access rights. Wineserver has pre-Vista behaviour hard-coded in several places:
'PROCESS_QUERY_INFORMATION' (0x400) access rights
Source: https://source.winehq.org/git/wine.git/blob/905bf79337e04ed31d2823508e901692...
--- snip --- 1337 /* fetch information about a process */ 1338 DECL_HANDLER(get_process_info) 1339 { 1340 struct process *process; 1341 1342 if ((process = get_process_from_handle( req->handle, PROCESS_QUERY_INFORMATION ))) 1343 { 1344 reply->pid = get_process_id( process ); 1345 reply->ppid = process->parent ? get_process_id( process->parent ) : 0; 1346 reply->exit_code = process->exit_code; 1347 reply->priority = process->priority; 1348 reply->affinity = process->affinity; 1349 reply->peb = process->peb; 1350 reply->start_time = process->start_time; 1351 reply->end_time = process->end_time; 1352 reply->cpu = process->cpu; 1353 reply->debugger_present = !!process->debugger; 1354 release_object( process ); 1355 } 1356 } --- snip ---
https://source.winehq.org/git/wine.git/blob/5d85f57814f023c105948636094e5e07...
--- snip --- 415 /* retrieve the object corresponding to a handle, incrementing its refcount */ 416 struct object *get_handle_obj( struct process *process, obj_handle_t handle, 417 unsigned int access, const struct object_ops *ops ) 418 { 419 struct handle_entry *entry; 420 struct object *obj; 421 422 if (!(obj = get_magic_handle( handle ))) 423 { 424 if (!(entry = get_handle( process, handle ))) 425 { 426 set_error( STATUS_INVALID_HANDLE ); 427 return NULL; 428 } 429 obj = entry->ptr; 430 if (ops && (obj->ops != ops)) 431 { 432 set_error( STATUS_OBJECT_TYPE_MISMATCH ); /* not the right type */ 433 return NULL; 434 } 435 if ((entry->access & access) != access) 436 { 437 set_error( STATUS_ACCESS_DENIED ); 438 return NULL; 439 } 440 } ... 447 } --- snip ---
MSDN: https://msdn.microsoft.com/de-de/library/windows/desktop/ms684880%28v=vs.85%...
--- quote --- ... A handle that has the PROCESS_QUERY_INFORMATION access right is automatically granted PROCESS_QUERY_LIMITED_INFORMATION.
Windows Server 2003 and Windows XP: This access right is not supported. ... --- quote ---
$ sha1sum vs_community.exe 396d8565f81969783bb4eb57aeff995cdabb8077 vs_community.exe
$ du -sh vs_community.exe 3.0M vs_community.exe
$ wine --version wine-1.7.49-41-g36a39ce
Regards
https://bugs.winehq.org/show_bug.cgi?id=37915
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |1d2241eca3b3c19855dea1db017 | |305b1e6113c0e Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Anastasius Focht focht@gmx.net --- Hello folks,
this is fixed by commits:
https://source.winehq.org/git/wine.git/commitdiff/c19091272d98600de346c51630... ("server: Add implicit PROCESS_[QUERY|SET]_LIMITED_INFORMATION access.")
https://source.winehq.org/git/wine.git/commitdiff/1d2241eca3b3c19855dea1db01... ("server: For querying process information demand PROCESS_QUERY_LIMITED_INFORMATION access.")
Thanks Dmitry
Regards
https://bugs.winehq.org/show_bug.cgi?id=37915
--- Comment #6 from Adam Bolte abolte@systemsaviour.com --- Confirming this now works in 1.7.50. Thanks guys.
https://bugs.winehq.org/show_bug.cgi?id=37915
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.51.
https://bugs.winehq.org/show_bug.cgi?id=37915
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://uplay.ubi.com/ |https://web.archive.org/web | |/20171124104413/https://dow | |nload.microsoft.com/downloa | |d/e/4/c/e4c393a9-8fff-441b- | |ad3a-3f4040317a1f/vs_commun | |ity.exe