Stefan Leichter : wtsapi32: Extend the parameter check of WTSEnumerateProcessesW.

Alexandre Julliard julliard at winehq.org
Wed Mar 26 14:34:12 CDT 2014


Module: wine
Branch: master
Commit: 0d2ff50e223eeeec253c31c15c1102b528e8dd1d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0d2ff50e223eeeec253c31c15c1102b528e8dd1d

Author: Stefan Leichter <Stefan.Leichter at camline.com>
Date:   Tue Mar 25 22:53:26 2014 +0100

wtsapi32: Extend the parameter check of WTSEnumerateProcessesW.

---

 dlls/wtsapi32/tests/wtsapi.c |    8 --------
 dlls/wtsapi32/wtsapi32.c     |    6 +++++-
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/wtsapi32/tests/wtsapi.c b/dlls/wtsapi32/tests/wtsapi.c
index 0a5a1ed..e8dced7 100644
--- a/dlls/wtsapi32/tests/wtsapi.c
+++ b/dlls/wtsapi32/tests/wtsapi.c
@@ -45,41 +45,33 @@ static void test_WTSEnumerateProcessesW(void)
     info = NULL;
     SetLastError(0xdeadbeef);
     ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 1, 1, &info, &count);
-    todo_wine
     ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
-    todo_wine
     ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
     if (info) WTSFreeMemory(info);
 
     info = NULL;
     SetLastError(0xdeadbeef);
     ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 0, &info, &count);
-    todo_wine
     ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
-    todo_wine
     ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
     if (info) WTSFreeMemory(info);
 
     info = NULL;
     SetLastError(0xdeadbeef);
     ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 2, &info, &count);
-    todo_wine
     ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
-    todo_wine
     ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
     if (info) WTSFreeMemory(info);
 
     SetLastError(0xdeadbeef);
     ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, NULL, &count);
     ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
-    todo_wine
     ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
 
     info = NULL;
     SetLastError(0xdeadbeef);
     ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, &info, NULL);
     ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
-    todo_wine
     ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
     if (info) WTSFreeMemory(info);
 
diff --git a/dlls/wtsapi32/wtsapi32.c b/dlls/wtsapi32/wtsapi32.c
index 314ec6b..79d5a7f 100644
--- a/dlls/wtsapi32/wtsapi32.c
+++ b/dlls/wtsapi32/wtsapi32.c
@@ -87,7 +87,11 @@ BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version
     FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
           ppProcessInfo, pCount);
 
-    if (!ppProcessInfo || !pCount) return FALSE;
+    if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
 
     *pCount = 0;
     *ppProcessInfo = NULL;




More information about the wine-cvs mailing list