Signed-off-by: Hans Leidekker hans@codeweavers.com --- 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 e8dced749e..3b7aa1bf09 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 aeb4b65407..736e1995b6 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); }
/************************************************************