28 Feb
2021
28 Feb
'21
4:26 p.m.
On 2/28/21 2:31 AM, Dmitry Timoshkov wrote:
Zebediah Figura <z.figura12(a)gmail.com> wrote:
+static PSID get_sid_from_ace(ACE_HEADER *ace) +{ + switch (ace->AceType) + { + case ACCESS_ALLOWED_ACE_TYPE: + return (SID *)&((ACCESS_ALLOWED_ACE *)ace)->SidStart; + case ACCESS_DENIED_ACE_TYPE: + return (SID *)&((ACCESS_DENIED_ACE *)ace)->SidStart; + default: + FIXME("Unhandled ACE type %#x.\n", ace->AceType); + return NULL; + } +}
I guess the cast (SID *) should be replaced by (PSID) since they are different types, and the compiler doesn't complain here because PSID is typedef'ed to PVOID.
Yeah, I think you're right; the casts are redundant and should probably be removed.