wtsapi32: Partial implementation of WTSEnumerateProcessesW.

Sebastian Lackner sebastian at fds-team.de
Mon Jun 23 20:14:20 CDT 2014


Original patch by Stefan Leichter

Fixes http://bugs.winehq.org/show_bug.cgi?id=29903

Changes:
* At various places with "return FALSE" no error code was set
* When iterating through the list of processes the last element was
skipped (because spi was updated before checking the end-of-list condition).
* When the second HeapAlloc fails the memory was 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, we just have to add
ProcessName.MaximumLength/sizeof(WCHAR) to get to the next location in
memory.
* WTSFreeMemory should be implemented in the same patch, otherwise we'll
leak memory.

---
 dlls/wtsapi32/tests/wtsapi.c |    1 -
 dlls/wtsapi32/wtsapi32.c     |   82
++++++++++++++++++++++++++++++++++++++----
 2 files changed, 75 insertions(+), 8 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wtsapi32-Partial-implementation-of-WTSEnumerateProce.patch
Type: text/x-patch
Size: 4339 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20140624/b21ce621/attachment.bin>


More information about the wine-patches mailing list