https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3140dac3fea0a6622a3fb…
commit 3140dac3fea0a6622a3fb6ee3e7f6eefc5bc764f
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sat May 22 19:47:19 2021 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sat May 29 12:44:03 2021 +0200
[NTOS:SE] Do some cleanup on ICIF flags in token information classes
A few of these classes have fixed size lengths, the rest are arbitrary. Also the
TokenAuditPolicy class hasn't a size length type specified in the table, which is
wrong (and move the corresponding TOKEN_AUDIT_POLICY_INFORMATION structure into the
private header).
---
ntoskrnl/include/internal/se.h | 10 ++++++++++
ntoskrnl/se/token.c | 36 +++++++++++++-----------------------
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/ntoskrnl/include/internal/se.h b/ntoskrnl/include/internal/se.h
index 698d7067bae..03639470c72 100644
--- a/ntoskrnl/include/internal/se.h
+++ b/ntoskrnl/include/internal/se.h
@@ -24,6 +24,16 @@ typedef struct _KNOWN_COMPOUND_ACE
ULONG SidStart;
} KNOWN_COMPOUND_ACE, *PKNOWN_COMPOUND_ACE;
+typedef struct _TOKEN_AUDIT_POLICY_INFORMATION
+{
+ ULONG PolicyCount;
+ struct
+ {
+ ULONG Category;
+ UCHAR Value;
+ } Policies[1];
+} TOKEN_AUDIT_POLICY_INFORMATION, *PTOKEN_AUDIT_POLICY_INFORMATION;
+
FORCEINLINE
PSID
SepGetGroupFromDescriptor(PVOID _Descriptor)
diff --git a/ntoskrnl/se/token.c b/ntoskrnl/se/token.c
index 5e3e82d9ecd..eb67cda7486 100644
--- a/ntoskrnl/se/token.c
+++ b/ntoskrnl/se/token.c
@@ -14,16 +14,6 @@
#include <ntlsa.h>
-typedef struct _TOKEN_AUDIT_POLICY_INFORMATION
-{
- ULONG PolicyCount;
- struct
- {
- ULONG Category;
- UCHAR Value;
- } Policies[1];
-} TOKEN_AUDIT_POLICY_INFORMATION, *PTOKEN_AUDIT_POLICY_INFORMATION;
-
/* GLOBALS ********************************************************************/
POBJECT_TYPE SeTokenObjectType = NULL;
@@ -45,25 +35,25 @@ static const INFORMATION_CLASS_INFO SeTokenInformationClass[] = {
IQS_SAME(0, 0, 0),
/* TokenUser */
- IQS_SAME(TOKEN_USER, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_USER, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenGroups */
- IQS_SAME(TOKEN_GROUPS, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_GROUPS, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenPrivileges */
- IQS_SAME(TOKEN_PRIVILEGES, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_PRIVILEGES, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenOwner */
- IQS_SAME(TOKEN_OWNER, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE | ICIF_SET |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_OWNER, ULONG, ICIF_QUERY | ICIF_SET | ICIF_SIZE_VARIABLE),
/* TokenPrimaryGroup */
- IQS_SAME(TOKEN_PRIMARY_GROUP, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE | ICIF_SET
| ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_PRIMARY_GROUP, ULONG, ICIF_QUERY | ICIF_SET | ICIF_SIZE_VARIABLE),
/* TokenDefaultDacl */
- IQS_SAME(TOKEN_DEFAULT_DACL, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE | ICIF_SET
| ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_DEFAULT_DACL, ULONG, ICIF_QUERY | ICIF_SET | ICIF_SIZE_VARIABLE),
/* TokenSource */
- IQS_SAME(TOKEN_SOURCE, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_SOURCE, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenType */
IQS_SAME(TOKEN_TYPE, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenImpersonationLevel */
- IQS_SAME(SECURITY_IMPERSONATION_LEVEL, ULONG, ICIF_QUERY |
ICIF_QUERY_SIZE_VARIABLE),
+ IQS_SAME(SECURITY_IMPERSONATION_LEVEL, ULONG, ICIF_QUERY),
/* TokenStatistics */
- IQS_SAME(TOKEN_STATISTICS, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE |
ICIF_SET_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_STATISTICS, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenRestrictedSids */
IQS_SAME(TOKEN_GROUPS, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenSessionId */
@@ -71,13 +61,13 @@ static const INFORMATION_CLASS_INFO SeTokenInformationClass[] = {
/* TokenGroupsAndPrivileges */
IQS_SAME(TOKEN_GROUPS_AND_PRIVILEGES, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
/* TokenSessionReference */
- IQS_SAME(ULONG, ULONG, ICIF_SET | ICIF_QUERY_SIZE_VARIABLE),
+ IQS_SAME(ULONG, ULONG, ICIF_SET),
/* TokenSandBoxInert */
- IQS_SAME(ULONG, ULONG, ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE),
+ IQS_SAME(ULONG, ULONG, ICIF_QUERY),
/* TokenAuditPolicy */
- IQS_SAME(/* FIXME */0, ULONG, ICIF_QUERY | ICIF_SET | ICIF_QUERY_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_AUDIT_POLICY_INFORMATION, ULONG, ICIF_SET | ICIF_SET_SIZE_VARIABLE),
/* TokenOrigin */
- IQS_SAME(TOKEN_ORIGIN, ULONG, ICIF_QUERY | ICIF_SET | ICIF_QUERY_SIZE_VARIABLE),
+ IQS_SAME(TOKEN_ORIGIN, ULONG, ICIF_QUERY | ICIF_SET),
};
/* FUNCTIONS *****************************************************************/