mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Handle TokenGroups in NtQueryInformationToken
This commit is contained in:
@@ -770,6 +770,12 @@ struct TOKEN_USER64
|
||||
SID_AND_ATTRIBUTES64 User;
|
||||
};
|
||||
|
||||
struct TOKEN_GROUPS64
|
||||
{
|
||||
ULONG GroupCount;
|
||||
SID_AND_ATTRIBUTES64 Groups[1];
|
||||
};
|
||||
|
||||
struct TOKEN_OWNER64
|
||||
{
|
||||
EMULATOR_CAST(EmulatorTraits<Emu64>::PVOID, PSID) Owner;
|
||||
|
||||
@@ -75,6 +75,26 @@ namespace syscalls
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (token_information_class == TokenGroups)
|
||||
{
|
||||
constexpr auto required_size = sizeof(TOKEN_GROUPS64) + sizeof(sid);
|
||||
return_length.write(required_size);
|
||||
|
||||
if (required_size > token_information_length)
|
||||
{
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
TOKEN_GROUPS64 groups{};
|
||||
groups.GroupCount = 1;
|
||||
groups.Groups[0].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY;
|
||||
groups.Groups[0].Sid = token_information + sizeof(TOKEN_GROUPS64);
|
||||
|
||||
emulator_object<TOKEN_GROUPS64>{c.emu, token_information}.write(groups);
|
||||
c.emu.write_memory(token_information + sizeof(TOKEN_GROUPS64), sid, sizeof(sid));
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (token_information_class == TokenOwner)
|
||||
{
|
||||
constexpr auto required_size = sizeof(sid) + sizeof(TOKEN_OWNER64);
|
||||
|
||||
Reference in New Issue
Block a user