Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
116890da
Commit
116890da
authored
May 28, 2020
by
Gijs Vermeulen
Committed by
Alexandre Julliard
May 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtsapi32: Improve WTSQuerySessionInformationW stub.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1db2b563
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
wtsapi.c
dlls/wtsapi32/tests/wtsapi.c
+19
-0
wtsapi32.c
dlls/wtsapi32/wtsapi32.c
+11
-0
No files found.
dlls/wtsapi32/tests/wtsapi.c
View file @
116890da
...
...
@@ -97,6 +97,25 @@ static void test_WTSQuerySessionInformation(void)
char
*
buf2
;
DWORD
count
;
SetLastError
(
0xdeadbeef
);
count
=
0
;
ret
=
WTSQuerySessionInformationW
(
WTS_CURRENT_SERVER_HANDLE
,
WTS_CURRENT_SESSION
,
WTSUserName
,
NULL
,
&
count
);
ok
(
!
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"got %u
\n
"
,
count
);
ok
(
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
count
=
1
;
ret
=
WTSQuerySessionInformationW
(
WTS_CURRENT_SERVER_HANDLE
,
WTS_CURRENT_SESSION
,
WTSUserName
,
NULL
,
&
count
);
ok
(
!
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
count
==
1
,
"got %u
\n
"
,
count
);
ok
(
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WTSQuerySessionInformationW
(
WTS_CURRENT_SERVER_HANDLE
,
WTS_CURRENT_SESSION
,
WTSUserName
,
&
buf1
,
NULL
);
ok
(
!
ret
,
"got %u
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"got %u
\n
"
,
GetLastError
());
count
=
0
;
buf1
=
NULL
;
ret
=
WTSQuerySessionInformationW
(
WTS_CURRENT_SERVER_HANDLE
,
WTS_CURRENT_SESSION
,
WTSUserName
,
&
buf1
,
&
count
);
...
...
dlls/wtsapi32/wtsapi32.c
View file @
116890da
...
...
@@ -341,6 +341,12 @@ BOOL WINAPI WTSQuerySessionInformationW(
FIXME
(
"Stub %p 0x%08x %d %p %p
\n
"
,
hServer
,
SessionId
,
WTSInfoClass
,
Buffer
,
BytesReturned
);
if
(
!
Buffer
||
!
BytesReturned
)
{
SetLastError
(
ERROR_INVALID_USER_BUFFER
);
return
FALSE
;
}
if
(
WTSInfoClass
==
WTSUserName
)
{
WCHAR
*
username
;
...
...
@@ -354,6 +360,11 @@ BOOL WINAPI WTSQuerySessionInformationW(
*
BytesReturned
=
count
*
sizeof
(
WCHAR
);
return
TRUE
;
}
else
{
*
Buffer
=
NULL
;
*
BytesReturned
=
0
;
}
return
FALSE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment