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.