mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-25 05:56:24 +00:00
wtsapi/tests: Use a heap buffer for the user SID.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55227
This commit is contained in:
parent
fa038c3c37
commit
9c238a5dc0
|
@ -68,8 +68,7 @@ static void check_wts_process_info(const WTS_PROCESS_INFOW *info, DWORD count)
|
|||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
char sid_buffer[50];
|
||||
SID_AND_ATTRIBUTES *sid = (SID_AND_ATTRIBUTES *)sid_buffer;
|
||||
SID_AND_ATTRIBUTES *sid;
|
||||
const SYSTEM_PROCESS_INFORMATION *nt_process;
|
||||
HANDLE process, token;
|
||||
DWORD size;
|
||||
|
@ -88,11 +87,13 @@ static void check_wts_process_info(const WTS_PROCESS_INFOW *info, DWORD count)
|
|||
|
||||
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, info[i].ProcessId)))
|
||||
{
|
||||
sid = malloc(50);
|
||||
ret = OpenProcessToken(process, TOKEN_QUERY, &token);
|
||||
ok(ret, "failed to open token, error %lu\n", GetLastError());
|
||||
ret = GetTokenInformation(token, TokenUser, sid_buffer, sizeof(sid_buffer), &size);
|
||||
ret = GetTokenInformation(token, TokenUser, sid, 50, &size);
|
||||
ok(ret, "failed to get token user, error %lu\n", GetLastError());
|
||||
ok(EqualSid(info[i].pUserSid, sid->Sid), "SID did not match\n");
|
||||
free(sid);
|
||||
CloseHandle(token);
|
||||
CloseHandle(process);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue