http://bugs.winehq.org/show_bug.cgi?id=29903
Bug #: 29903 Summary: Microsoft Visual Studio 2005: enumeration of processes fails due to wtsapi32.WTSEnumerateProcessesW() being a stub ( "attach to process" menu)) Product: Wine Version: 1.4-rc3 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
clicking "attach to process" menu item with default "local transport" leads to an error message stating "Operation not supported. Unknown error: 0x8007000e".
The process list (listview) is empty due to WTSEnumerateProcessesW() API being a stub.
Prerequisite: 'winetricks -q dotnet20 mfc42'
--- snip --- ... 0024:Call wtsapi32.WTSEnumerateProcessesW(00000000,00000000,00000001,0032e828,0032e824) ret=54bc508e 0024:fixme:wtsapi:WTSEnumerateProcessesW Stub (nil) 0x00000000 0x00000001 0x32e828 0x32e824 0024:Ret wtsapi32.WTSEnumerateProcessesW() retval=00000001 ret=54bc508e 0024:Call KERNEL32.GetProcAddress(7d910000,54cb3b3c "WTSFreeMemory") ret=54bb97d2 0024:Ret KERNEL32.GetProcAddress() retval=7d914fc8 ret=54bb97d2 0024:Call wtsapi32.WTSFreeMemory(00000000) ret=54bc51b9 0024:fixme:wtsapi:WTSFreeMemory Stub (nil) 0024:Ret wtsapi32.WTSFreeMemory() retval=0000002b ret=54bc51b9 ... 0024:Call oleaut32.SysAllocString(011722a8 L"Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named 'nexus4'. Operation not supported. Unknown error: 0x8007000e.") ret=54ba4f0c ... --- snip ---
MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383831.aspx
Stub source: http://source.winehq.org/git/wine.git/blob/fddbf3b99d6582c50ede10dfddd8d438b... --- snip ---
--- snip --- 105 BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, 106 PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) 107 { 108 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version, 109 ppProcessInfo, pCount); 110 111 if (!ppProcessInfo || !pCount) return FALSE; 112 113 *pCount = 0; 114 *ppProcessInfo = NULL; 115 116 return TRUE; 117 } --- snip ---
$ wine --version wine-1.4-rc3-65-g98f0be8
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.microsoft.com/do | |wnloads/details.aspx?Family | |ID=fe6f2099-b7b4-4f47-a244- | |c96d69c35dec Summary|Microsoft Visual Studio |Some Microsoft debuggers |2005: enumeration of |fail to enumerate processes |processes fails due to |due to |wtsapi32.WTSEnumerateProces |wtsapi32.WTSEnumerateProces |sesW() being a stub ( |sesW() being a stub |"attach to process" menu)) |(Microsoft Visual Studio | |2005, DbgCLR from .NET 2.0 | |SDK)
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-02-19 07:13:14 CST --- Hello,
the managed debugger GUI "DbgCLR.exe" from .NET Framework 2.0 SDK also suffers from this.
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/Microsoft.NET/SDK/v2.0/GuiDebug ... $ wine ./DbgCLR.exe fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),0,2,(nil),0,(nil)) - stub! err:ole:TLB_ReadTypeLib Loading of typelib L"C:\Program Files\Microsoft.NET\SDK\v2.0\GuiDebug\dte80a.olb" failed with error 2 fixme:shell:SHAutoComplete stub fixme:wtsapi:WTSEnumerateProcessesW Stub (nil) 0x00000000 0x00000001 0x32eb38 0x32eb34 fixme:wtsapi:WTSFreeMemory Stub (nil) ... --- snip ---
"tools" -> "attach to process" -> "unknown error 0x8007000e"
Refining summary.
$ sha1sum setup.exe 4e4b1072b5e65e855358e2028403f2dc52a62ab4 setup.exe
$ wine --version wine-1.4-rc4
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #2 from Anastasius Focht focht@gmx.net 2013-05-03 05:20:55 CDT --- Hello folks,
revisiting, obviously still present.
http://source.winehq.org/git/wine.git/blob/102f5085efc5d9ac9e3190c721c08a2ee...
$ wine --version wine-1.5.29-107-gb94cfaf
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #3 from Stefan Leichter Stefan.Leichter@camLine.com 2013-05-20 15:34:17 CDT --- Created attachment 44517 --> http://bugs.winehq.org/attachment.cgi?id=44517 partial implemention of WTSEnumerateProcessesW
Is the patch enough?
http://bugs.winehq.org/show_bug.cgi?id=29903
Stefan Leichter Stefan.Leichter@camLine.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Stefan.Leichter@camLine.com
--- Comment #4 from Stefan Leichter Stefan.Leichter@camLine.com 2013-09-03 16:23:58 CDT --- http://source.winehq.org/patches/data/98184
http://bugs.winehq.org/show_bug.cgi?id=29903
Marcel Groothuis margro.xbmc@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |margro.xbmc@gmail.com
--- Comment #5 from Marcel Groothuis margro.xbmc@gmail.com 2013-11-30 12:57:07 CST --- I can confirm that your partial implementation fixes the process enumeration for the VS2005 remote debugger. After applying the patch to wine 1.7.6 (MacOSX 10.6), I could succesfully attach VS2005 to my running Windows application under Wine.
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
this is also needed for "Akamai Download Manager" which uses "Akamai NetSession Interface". The control panel/installer engine uses "WTSEnumerateProcessesW" API to check for running processes/services and this obviously fails.
--- snip --- $ pwd /home/focht/.wine/drive_c/users/focht/Local Settings/Application Data/Akamai
$ WINEDEBUG=+tid,+seh,+relay wine ./ControlPanel.exe >>log.txt 2>&1 ... 0009:Call KERNEL32.CreateProcessW(00000000,0033cab0 L""C:/users/focht/Local Settings/Application Data/Akamai/netsession_win.exe"",00000000,00000000,00000000,00000008,00000000,0033ccb8 L"C:/users/focht/Local Settings/Application Data/Akamai",0033ca50,0033ca98) ret=0043a8c1 ... 0024:Call KERNEL32.__wine_kernel_init() ret=7bc599ec 0009:Ret KERNEL32.CreateProcessW() retval=00000001 ret=0043a8c1 ... 0009:Call user32.SetWindowTextW(0001007c,00a3d160 L"Start") ret=00468b92 ... 0009:Call wtsapi32.WTSEnumerateProcessesW(00000000,00000000,00000001,003398c8,003398d4) ret=0043e2b1 0009:fixme:wtsapi:WTSEnumerateProcessesW Stub (nil) 0x00000000 0x00000001 0x3398c8 0x3398d4 0009:Ret wtsapi32.WTSEnumerateProcessesW() retval=00000001 ret=0043e2b1 ... 0009:Call user32.SetWindowTextW(0001007a,00a3e978 L"Not Running") ret=00468b92 ... 0024:Call KERNEL32.CreateProcessW(00000000,00944b40 L""C:/users/focht/Local Settings/Application Data/Akamai/netsession_win.exe" --client",00000000,00000000,00000000,00000008,00000000,00944bf0 L"C:/users/focht/Local Settings/Application Data/Akamai",0033f830,0033f880) ret=004332e6 ... 0026:Call KERNEL32.__wine_kernel_init() ret=7bc599ec 0024:Ret KERNEL32.CreateProcessW() retval=00000001 ret=004332e6 ... 0009:Call wtsapi32.WTSEnumerateProcessesW(00000000,00000000,00000001,003398c8,003398d4) ret=0043e2b1 0009:fixme:wtsapi:WTSEnumerateProcessesW Stub (nil) 0x00000000 0x00000001 0x3398c8 0x3398d4 0009:Ret wtsapi32.WTSEnumerateProcessesW() retval=00000001 ret=0043e2b1 ... 0009:Call user32.SetWindowTextW(0001007a,00a3e978 L"Not Running") ret=00468b92 --- snip ---
@Stefan: Can you send your partial implementation to wine-patches for review? It's enough to help the apps.
$ wine --version wine-1.7.8-220-g0bef543
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #7 from Marcel Groothuis margro.xbmc@gmail.com --- FYI: Reactos has an older but similar patch that also implements the WTSEnumerateProcessesA function.
See: http://jira.reactos.org/browse/CORE-4301?attachmentOrder=desc
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #8 from Stefan Leichter Stefan.Leichter@camLine.com --- resend: http://source.winehq.org/patches/data/101113
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #9 from Anastasius Focht focht@gmx.net --- Hello Stefan,
thanks, just keep on bugging ;-) Request feedback on wine-devel mailing list (wine-devel@winehq.org) if nothing happens.
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #10 from Stefan Leichter Stefan.Leichter@camLine.com --- Next try:
http://source.winehq.org/patches/data/101509 http://source.winehq.org/patches/data/101510
Cross your fingers ...
http://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #11 from Stefan Leichter Stefan.Leichter@camLine.com --- Hello Anastasius,
sorry, i tried my best
http://www.winehq.org/pipermail/wine-patches/2013-December/129040.html http://www.winehq.org/pipermail/wine-patches/2014-January/129437.html http://www.winehq.org/pipermail/wine-patches/2014-February/130392.html http://www.winehq.org/pipermail/wine-patches/2014-February/130548.html http://www.winehq.org/pipermail/wine-patches/2014-February/130731.html http://www.winehq.org/pipermail/wine-patches/2014-March/130950.html http://www.winehq.org/pipermail/wine-patches/2014-March/131455.html http://www.winehq.org/pipermail/wine-devel/2014-April/104085.html
to get the implemenation in, but now i got tired. Maybe someone else will have a better standing, more luck, get more feedback, ... At least some tests got committed.
Regards
http://bugs.winehq.org/show_bug.cgi?id=29903
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
--- Comment #12 from Sebastian Lackner sebastian@fds-team.de --- Created attachment 48860 --> http://bugs.winehq.org/attachment.cgi?id=48860 wtsapi32: Partial implementation of WTSEnumerateProcessesW.
@Stefan:
I don't know why noone answered on wine-patches, but your patch had several bugs. I've tried to fix them and will also try my luck to get it upstream, if someone can confirm, that it still fixes the issue.
Changes: * At various places with "return FALSE" no error code was set * When iterating through the list of processes you skip over the last element (because spi is updated before you check for the end-of-list condition). * When the second HeapAlloc fails the memory is never deallocated * Issues with pointer arithmetic, ProcessName.MaximumLength is already in bytes, no need to multiply it with sizeof(WCHAR). * As name is of type WCHAR, you should only add ProcessName.MaximumLength/sizeof(WCHAR) to get to the next location in memory. * WTSFreeMemory should be implemented in the same patch, otherwise you leak memory.
https://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #13 from Austin English austinenglish@gmail.com --- (In reply to Sebastian Lackner from comment #12)
Created attachment 48860 [details] wtsapi32: Partial implementation of WTSEnumerateProcessesW.
@Stefan:
I don't know why noone answered on wine-patches, but your patch had several bugs. I've tried to fix them and will also try my luck to get it upstream, if someone can confirm, that it still fixes the issue.
It doesn't work for me. I was testing the application from bug 26873 (http://en.dekaron.nexoneu.com/NXEU.aspx?PART=/Download/GameClient), which fails to install, just printing a bunch of WTSEnumerateProcessesW fixme's. Changing the stub to always return FALSE lets the installer complete.
With your patch, however, it also fails. I'll attach a +wtsapi trace.
Installer info: [austin@localhost ~]$ sha1sum NexonEU_Installer.exe 6ec5f715e9c3fe82ebd1f2198e8de7d3a2abeac9 NexonEU_Installer.exe [austin@localhost ~]$ du -h NexonEU_Installer.exe 11M NexonEU_Installer.exe [austin@localhost ~]$ wine --version wine-1.7.24
https://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #14 from Austin English austinenglish@gmail.com --- I take it back, tested the wrong thing. Your patch works here Sebastian.
https://bugs.winehq.org/show_bug.cgi?id=29903
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=29903
roger@mailinator.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |roger@mailinator.com
--- Comment #15 from roger@mailinator.com --- Sebastian Lackner
ping
https://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #16 from Sebastian Lackner sebastian@fds-team.de --- @roger: I tried to submit the patch shortly after I posted it here. It dropped out of the submission list without feedback, so I am not sure what else to change. Of course the implementation is not complete yet, but usually that doesn't prevent Wine from accepting patches. ;) If someone has any other idea what else to change, feel free to tell me.
The patch is also available in our staging tree: https://github.com/wine-compholio/wine-staging/tree/master/patches/wtsapi32-...
If you need it and don't want to compile Wine, you can just install one of the staging tree builds, but please note that there is no official support here on winehq.org for such patched versions: https://github.com/wine-compholio/wine-staging/wiki/Installation
https://bugs.winehq.org/show_bug.cgi?id=29903
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |michael@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/wtsapi32-Enume | |rateProcesses
https://bugs.winehq.org/show_bug.cgi?id=29903
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |wtsapi32
https://bugs.winehq.org/show_bug.cgi?id=29903
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #17 from joaopa jeremielapuree@yahoo.fr --- Any news for this bug ?
https://bugs.winehq.org/show_bug.cgi?id=29903
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Some Microsoft debuggers |Multiple games and |fail to enumerate processes |applications fail to |due to |enumerate processes due to |wtsapi32.WTSEnumerateProces |'wtsapi32.WTSEnumerateProce |sesW() being a stub |ssesW' stub (Visual Studio |(Microsoft Visual Studio |2005, .NET 2.0 SDK DbgCLR, |2005, DbgCLR from .NET 2.0 |Akamai DL Manager, Dekaron) |SDK) | Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/wtsapi32-Enume |er/patches/wtsapi32-Enumera |rateProcesses |teProcesses
--- Comment #18 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, obviously still present.
$ wine --version wine-3.3
Regards
https://bugs.winehq.org/show_bug.cgi?id=29903
--- Comment #19 from Anastasius Focht focht@gmx.net --- Hello folks,
ping, obviously still present (patch still staged).
Direct download link:
https://download.microsoft.com/download/A/9/1/A91D6B2B-A798-47DF-9C7E-A97854... (MS Visual C++ 2005 Express)
Internet Archive Snapshot/Mirror:
https://web.archive.org/web/20190127082540/http://download.microsoft.com/dow...
$ sha1sum VC.iso 1ae44e4eaf8c61c3a39e573fd6efd9889e940529 VC.iso
$ du -sh VC.iso 463M VC.iso
$ wine --version wine-5.0-rc3
Regards
https://bugs.winehq.org/show_bug.cgi?id=29903
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.microsoft.com/do |https://web.archive.org/web |wnloads/details.aspx?Family |/20111026224703/http://down |ID=fe6f2099-b7b4-4f47-a244- |load.microsoft.com/download |c96d69c35dec |/c/4/b/c4b15d7d-6f37-4d5a-b | |9c6-8f07e7d46635/setup.exe
https://bugs.winehq.org/show_bug.cgi?id=29903
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #20 from Zebediah Figura z.figura12@gmail.com --- Should be fixed by https://source.winehq.org/git/wine.git/commitdiff/5f8c7c25632ec520d42d3c1cb4adeecbcaaa2f9f.
https://bugs.winehq.org/show_bug.cgi?id=29903
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|STAGED |RESOLVED Fixed by SHA1| |5f8c7c25632ec520d42d3c1cb4a | |deecbcaaa2f9f
--- Comment #21 from Anastasius Focht focht@gmx.net --- Hello folks,
this is indeed fixed by commit https://source.winehq.org/git/wine.git/commitdiff/5f8c7c25632ec520d42d3c1cb4... ("wtsapi32: Implement WTSEnumerateProcessesW().").
Thanks Sebastian and Zeb.
In Visual Studio IDE you need to check 'Show processes from all users' to get the process list.
I've found the much smaller download from my comment #6
--- quote --- this is also needed for "Akamai Download Manager" which uses "Akamai NetSession Interface". --- quote ---
https://web.archive.org/web/20151121013111/https://client.akamai.com/install...
Install and start the control app:
--- snip --- $ pwd /home/focht/.wine/drive_c/users/focht/AppData/Local/Akamai
$ WINEDEBUG=+wtsapi,+service,+process wine ./ControlPanel.exe ... 0024:trace:wtsapi:WTSEnumerateProcessesW server 00000000, reserved 0, version 1, info 00329B5C, count 00329B64 0024:trace:wtsapi:WTSEnumerateProcessesExW server 00000000, level 0, session_id 0xfffffffe, ret_info 00329B5C, ret_count 00329B64 ... 0024:trace:process:CreateProcessInternalW app (null) cmdline L""C:/users/focht/AppData/Local/Akamai/netsession_win.exe"" --- 0024:trace:process:CreateProcessInternalW started process pid 0104 tid 0108 0024:trace:process:GetEnvironmentVariableW (L"WINEUSERNAME" 0032C700 2048) 0024:trace:wtsapi:WTSEnumerateProcessesW server 00000000, reserved 0, version 1, info 00329C0C, count 00329C14 0024:trace:wtsapi:WTSEnumerateProcessesExW server 00000000, level 0, session_id 0xfffffffe, ret_info 00329C0C, ret_count 00329C14 ... --- snip ---
Under 'Preferences' observe the service status when pressing 'Start' or 'Stop' button. It's now properly updated.
$ sha1sum installer.exe 7d0c164b197cf90a8f03a4487fd3330fc7aeb04f installer.exe
$ du -sh installer.exe 10M installer.exe
$ wine --version wine-6.9-148-gce151dd681f
Regards
https://bugs.winehq.org/show_bug.cgi?id=29903
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #22 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.10.
https://bugs.winehq.org/show_bug.cgi?id=29903
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x
https://bugs.winehq.org/show_bug.cgi?id=29903
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|6.0.x |---
--- Comment #23 from Michael Stefaniuc mstefani@winehq.org --- Removing the 6.0.x milestone from bug fixes included in 6.0.2.