Hans Leidekker : wtsapi32: Implement WTSFreeMemory.
Module: wine Branch: master Commit: 90681e3a764ded7d73f77ab469cba1d4fd86ad32 URL: https://source.winehq.org/git/wine.git/?a=commit;h=90681e3a764ded7d73f77ab46... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 11 12:05:47 2018 +0200 wtsapi32: Implement WTSFreeMemory. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wtsapi32/tests/wtsapi.c | 10 +++++----- dlls/wtsapi32/wtsapi32.c | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/wtsapi32/tests/wtsapi.c b/dlls/wtsapi32/tests/wtsapi.c index e8dced7..3b7aa1b 100644 --- a/dlls/wtsapi32/tests/wtsapi.c +++ b/dlls/wtsapi32/tests/wtsapi.c @@ -47,21 +47,21 @@ static void test_WTSEnumerateProcessesW(void) ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 1, 1, &info, &count); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); - if (info) WTSFreeMemory(info); + WTSFreeMemory(info); info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 0, &info, &count); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); - if (info) WTSFreeMemory(info); + WTSFreeMemory(info); info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 2, &info, &count); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); - if (info) WTSFreeMemory(info); + WTSFreeMemory(info); SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, NULL, &count); @@ -73,7 +73,7 @@ static void test_WTSEnumerateProcessesW(void) ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, &info, NULL); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); - if (info) WTSFreeMemory(info); + WTSFreeMemory(info); count = 0; info = NULL; @@ -87,7 +87,7 @@ static void test_WTSEnumerateProcessesW(void) } todo_wine ok(found || broken(!ret), "process name %s not found\n", wine_dbgstr_w(pname)); - if (info) WTSFreeMemory(info); + WTSFreeMemory(info); } START_TEST (wtsapi) diff --git a/dlls/wtsapi32/wtsapi32.c b/dlls/wtsapi32/wtsapi32.c index aeb4b65..736e199 100644 --- a/dlls/wtsapi32/wtsapi32.c +++ b/dlls/wtsapi32/wtsapi32.c @@ -22,6 +22,7 @@ #include "winbase.h" #include "wtsapi32.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(wtsapi); @@ -168,9 +169,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, */ void WINAPI WTSFreeMemory(PVOID pMemory) { - static int once; - - if (!once++) FIXME("Stub %p\n", pMemory); + heap_free(pMemory); } /************************************************************
participants (1)
-
Alexandre Julliard