From: Sebastian Lackner sebastian@fds-team.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39663 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/wtsapi32/tests/wtsapi.c | 1 - dlls/wtsapi32/wtsapi32.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/wtsapi32/tests/wtsapi.c b/dlls/wtsapi32/tests/wtsapi.c index c24bd491a7..67f56bbd7f 100644 --- a/dlls/wtsapi32/tests/wtsapi.c +++ b/dlls/wtsapi32/tests/wtsapi.c @@ -112,7 +112,6 @@ static void test_WTSQueryUserToken(void) SetLastError(0xdeadbeef); ret = WTSQueryUserToken(WTS_CURRENT_SESSION, NULL); ok(!ret, "expected WTSQueryUserToken to fail\n"); - todo_wine ok(GetLastError()==ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); }
diff --git a/dlls/wtsapi32/wtsapi32.c b/dlls/wtsapi32/wtsapi32.c index 5569502977..3edf9215fd 100644 --- a/dlls/wtsapi32/wtsapi32.c +++ b/dlls/wtsapi32/wtsapi32.c @@ -254,8 +254,17 @@ BOOL WINAPI WTSQuerySessionInformationW( */ BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token) { - FIXME("%u %p\n", session_id, token); - return FALSE; + FIXME("%u %p semi-stub!\n", session_id, token); + + if (!token) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + return DuplicateHandle(GetCurrentProcess(), GetCurrentProcessToken(), + GetCurrentProcess(), token, + 0, FALSE, DUPLICATE_SAME_ACCESS); }
/************************************************************