Skip to content

Commit 6e866da

Browse files
committed
Fix PsAttributes winsiderss#147, Fix spacing
1 parent b8b063a commit 6e866da

File tree

2 files changed

+56
-45
lines changed

2 files changed

+56
-45
lines changed

phnt/include/ntpsapi.h

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,15 +1222,15 @@ typedef enum _PS_ATTRIBUTE_NUM
12221222
PsAttributeIdealProcessor, // in PPROCESSOR_NUMBER
12231223
PsAttributeUmsThread, // ? in PUMS_CREATE_THREAD_ATTRIBUTES
12241224
PsAttributeMitigationOptions, // in UCHAR
1225-
PsAttributeProtectionLevel,
1225+
PsAttributeProtectionLevel, // in ULONG
12261226
PsAttributeSecureProcess, // since THRESHOLD
12271227
PsAttributeJobList,
12281228
PsAttributeChildProcessPolicy, // since THRESHOLD2
12291229
PsAttributeAllApplicationPackagesPolicy, // since REDSTONE
12301230
PsAttributeWin32kFilter,
12311231
PsAttributeSafeOpenPromptOriginClaim,
1232-
PsAttributeBnoIsolation,
1233-
PsAttributeDesktopAppPolicy,
1232+
PsAttributeBnoIsolation, // PS_BNO_ISOLATION_PARAMETERS
1233+
PsAttributeDesktopAppPolicy, // in ULONG
12341234
PsAttributeMax
12351235
} PS_ATTRIBUTE_NUM;
12361236

@@ -1243,11 +1243,11 @@ typedef enum _PS_ATTRIBUTE_NUM
12431243
((Additive) ? PS_ATTRIBUTE_ADDITIVE : 0))
12441244

12451245
#define PS_ATTRIBUTE_PARENT_PROCESS \
1246-
PsAttributeValue(PsAttributeParentProcess, FALSE, TRUE, FALSE)
1246+
PsAttributeValue(PsAttributeParentProcess, FALSE, TRUE, TRUE)
12471247
#define PS_ATTRIBUTE_DEBUG_PORT \
1248-
PsAttributeValue(PsAttributeDebugPort, FALSE, TRUE, FALSE)
1248+
PsAttributeValue(PsAttributeDebugPort, FALSE, TRUE, TRUE)
12491249
#define PS_ATTRIBUTE_TOKEN \
1250-
PsAttributeValue(PsAttributeToken, FALSE, TRUE, FALSE)
1250+
PsAttributeValue(PsAttributeToken, FALSE, TRUE, TRUE)
12511251
#define PS_ATTRIBUTE_CLIENT_ID \
12521252
PsAttributeValue(PsAttributeClientId, TRUE, FALSE, FALSE)
12531253
#define PS_ATTRIBUTE_TEB_ADDRESS \
@@ -1274,6 +1274,8 @@ typedef enum _PS_ATTRIBUTE_NUM
12741274
PsAttributeValue(PsAttributeIdealProcessor, TRUE, TRUE, FALSE)
12751275
#define PS_ATTRIBUTE_MITIGATION_OPTIONS \
12761276
PsAttributeValue(PsAttributeMitigationOptions, FALSE, TRUE, TRUE)
1277+
#define PS_ATTRIBUTE_PROTECTION_LEVEL \
1278+
PsAttributeValue(PsAttributeProtectionLevel, FALSE, TRUE, FALSE)
12771279

12781280
// end_rev
12791281

@@ -1331,18 +1333,14 @@ typedef struct _PS_STD_HANDLE_INFO
13311333
ULONG StdHandleSubsystemType;
13321334
} PS_STD_HANDLE_INFO, *PPS_STD_HANDLE_INFO;
13331335

1334-
// windows-internals-book:"Chapter 5"
1335-
typedef enum _PS_CREATE_STATE
1336+
// private
1337+
typedef struct _PS_BNO_ISOLATION_PARAMETERS
13361338
{
1337-
PsCreateInitialState,
1338-
PsCreateFailOnFileOpen,
1339-
PsCreateFailOnSectionCreate,
1340-
PsCreateFailExeFormat,
1341-
PsCreateFailMachineMismatch,
1342-
PsCreateFailExeName, // Debugger specified
1343-
PsCreateSuccess,
1344-
PsCreateMaximumStates
1345-
} PS_CREATE_STATE;
1339+
UNICODE_STRING IsolationPrefix;
1340+
ULONG HandleCount;
1341+
PVOID *Handles;
1342+
BOOLEAN IsolationEnabled;
1343+
} PS_BNO_ISOLATION_PARAMETERS, *PPS_BNO_ISOLATION_PARAMETERS;
13461344

13471345
// private
13481346
typedef enum _PS_MITIGATION_OPTION
@@ -1369,6 +1367,19 @@ typedef enum _PS_MITIGATION_OPTION
13691367
PS_MITIGATION_OPTION_RESTRICT_SET_THREAD_CONTEXT
13701368
} PS_MITIGATION_OPTION;
13711369

1370+
// windows-internals-book:"Chapter 5"
1371+
typedef enum _PS_CREATE_STATE
1372+
{
1373+
PsCreateInitialState,
1374+
PsCreateFailOnFileOpen,
1375+
PsCreateFailOnSectionCreate,
1376+
PsCreateFailExeFormat,
1377+
PsCreateFailMachineMismatch,
1378+
PsCreateFailExeName, // Debugger specified
1379+
PsCreateSuccess,
1380+
PsCreateMaximumStates
1381+
} PS_CREATE_STATE;
1382+
13721383
typedef struct _PS_CREATE_INFO
13731384
{
13741385
SIZE_T Size;

phnt/include/ntrtl.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ typedef struct _RTL_SPLAY_LINKS
323323
} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
324324

325325
#define RtlInitializeSplayLinks(Links) \
326-
{ \
327-
PRTL_SPLAY_LINKS _SplayLinks; \
328-
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
329-
_SplayLinks->Parent = _SplayLinks; \
330-
_SplayLinks->LeftChild = NULL; \
331-
_SplayLinks->RightChild = NULL; \
332-
}
326+
{ \
327+
PRTL_SPLAY_LINKS _SplayLinks; \
328+
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
329+
_SplayLinks->Parent = _SplayLinks; \
330+
_SplayLinks->LeftChild = NULL; \
331+
_SplayLinks->RightChild = NULL; \
332+
}
333333

334334
#define RtlParent(Links) ((PRTL_SPLAY_LINKS)(Links)->Parent)
335335
#define RtlLeftChild(Links) ((PRTL_SPLAY_LINKS)(Links)->LeftChild)
@@ -339,24 +339,24 @@ typedef struct _RTL_SPLAY_LINKS
339339
#define RtlIsRightChild(Links) ((RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)))
340340

341341
#define RtlInsertAsLeftChild(ParentLinks, ChildLinks) \
342-
{ \
343-
PRTL_SPLAY_LINKS _SplayParent; \
344-
PRTL_SPLAY_LINKS _SplayChild; \
345-
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
346-
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
347-
_SplayParent->LeftChild = _SplayChild; \
348-
_SplayChild->Parent = _SplayParent; \
349-
}
342+
{ \
343+
PRTL_SPLAY_LINKS _SplayParent; \
344+
PRTL_SPLAY_LINKS _SplayChild; \
345+
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
346+
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
347+
_SplayParent->LeftChild = _SplayChild; \
348+
_SplayChild->Parent = _SplayParent; \
349+
}
350350

351351
#define RtlInsertAsRightChild(ParentLinks, ChildLinks) \
352-
{ \
353-
PRTL_SPLAY_LINKS _SplayParent; \
354-
PRTL_SPLAY_LINKS _SplayChild; \
355-
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
356-
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
357-
_SplayParent->RightChild = _SplayChild; \
358-
_SplayChild->Parent = _SplayParent; \
359-
}
352+
{ \
353+
PRTL_SPLAY_LINKS _SplayParent; \
354+
PRTL_SPLAY_LINKS _SplayChild; \
355+
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
356+
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
357+
_SplayParent->RightChild = _SplayChild; \
358+
_SplayChild->Parent = _SplayParent; \
359+
}
360360

361361
NTSYSAPI
362362
PRTL_SPLAY_LINKS
@@ -954,11 +954,11 @@ typedef struct _RTL_RESOURCE
954954
RTL_CRITICAL_SECTION CriticalSection;
955955

956956
HANDLE SharedSemaphore;
957-
ULONG NumberOfWaitingShared;
957+
volatile ULONG NumberOfWaitingShared;
958958
HANDLE ExclusiveSemaphore;
959-
ULONG NumberOfWaitingExclusive;
959+
volatile ULONG NumberOfWaitingExclusive;
960960

961-
LONG NumberOfActive; // negative: exclusive acquire; zero: not acquired; positive: shared acquire(s)
961+
volatile LONG NumberOfActive; // negative: exclusive acquire; zero: not acquired; positive: shared acquire(s)
962962
HANDLE ExclusiveOwnerThread;
963963

964964
ULONG Flags; // RTL_RESOURCE_FLAG_*
@@ -2407,8 +2407,8 @@ typedef struct _RTL_USER_PROCESS_PARAMETERS
24072407
UNICODE_STRING RuntimeData;
24082408
RTL_DRIVE_LETTER_CURDIR CurrentDirectories[RTL_MAX_DRIVE_LETTERS];
24092409

2410-
ULONG EnvironmentSize;
2411-
ULONG EnvironmentVersion;
2410+
ULONG_PTR EnvironmentSize;
2411+
ULONG_PTR EnvironmentVersion;
24122412
PVOID PackageDependencyData;
24132413
ULONG ProcessGroupId;
24142414
ULONG LoaderThreads;

0 commit comments

Comments
 (0)