https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eea75d46e7a37ddb03ea5…
commit eea75d46e7a37ddb03ea5c8f1f9a52cb6a3d41ca
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Dec 23 00:55:08 2019 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Dec 23 00:55:08 2019 +0100
[WTSAPI32_WINETEST] Sync with Wine Staging 4.18. CORE-16441
---
modules/rostests/winetests/wtsapi32/wtsapi.c | 37 ++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/modules/rostests/winetests/wtsapi32/wtsapi.c
b/modules/rostests/winetests/wtsapi32/wtsapi.c
index dd5c8e86376..d993c6ff15e 100644
--- a/modules/rostests/winetests/wtsapi32/wtsapi.c
+++ b/modules/rostests/winetests/wtsapi32/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;
@@ -86,10 +86,37 @@ static void test_WTSEnumerateProcessesW(void)
found = found || !lstrcmpW(pname, info[i].pProcessName);
}
ok(found || broken(!ret), "process name %s not found\n",
wine_dbgstr_w(pname));
- if (info) WTSFreeMemory(info);
+ WTSFreeMemory(info);
+}
+
+static void test_WTSQuerySessionInformationW(void)
+{
+ BOOL ret;
+ WCHAR *buf;
+ DWORD count;
+
+ count = 0;
+ buf = NULL;
+ ret = WTSQuerySessionInformationW(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION,
WTSUserName, &buf, &count);
+ ok(ret, "got %u\n", GetLastError());
+ ok(buf != NULL, "buf not set\n");
+ ok(count == (lstrlenW(buf) + 1) * sizeof(WCHAR), "got %u\n", count);
+ WTSFreeMemory(buf);
+}
+
+static void test_WTSQueryUserToken(void)
+{
+ BOOL ret;
+
+ SetLastError(0xdeadbeef);
+ ret = WTSQueryUserToken(WTS_CURRENT_SESSION, NULL);
+ ok(!ret, "expected WTSQueryUserToken to fail\n");
+ ok(GetLastError()==ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER
got: %d\n", GetLastError());
}
START_TEST (wtsapi)
{
test_WTSEnumerateProcessesW();
+ test_WTSQuerySessionInformationW();
+ test_WTSQueryUserToken();
}