Skip to content

Commit

Permalink
Merge pull request #443 from processhacker/master
Browse files Browse the repository at this point in the history
[pull] master from processhacker:master
  • Loading branch information
pull[bot] authored Mar 21, 2022
2 parents e36e30e + 11fc0af commit cb8b23d
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 79 deletions.
4 changes: 4 additions & 0 deletions phnt/include/ntobapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@

#if (PHNT_MODE != PHNT_MODE_KERNEL)
#define SYMBOLIC_LINK_QUERY 0x0001
#define SYMBOLIC_LINK_SET 0x0002
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
#define SYMBOLIC_LINK_ALL_ACCESS_EX (STANDARD_RIGHTS_REQUIRED | 0xFFFF)
#endif

#ifndef OBJ_PROTECT_CLOSE
Expand Down Expand Up @@ -436,6 +438,7 @@ typedef enum _SYMBOLIC_LINK_INFO_CLASS
MaxnSymbolicLinkInfoClass
} SYMBOLIC_LINK_INFO_CLASS;

#if (PHNT_VERSION >= PHNT_THRESHOLD)
NTSYSCALLAPI
NTSTATUS
NTAPI
Expand All @@ -445,6 +448,7 @@ NtSetInformationSymbolicLink(
_In_reads_bytes_(SymbolicLinkInformationLength) PVOID SymbolicLinkInformation,
_In_ ULONG SymbolicLinkInformationLength
);
#endif

#endif

Expand Down
58 changes: 27 additions & 31 deletions phnt/include/ntpsapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,14 +1198,25 @@ NtCreateProcess(
_In_ BOOLEAN InheritObjectTable,
_In_opt_ HANDLE SectionHandle,
_In_opt_ HANDLE DebugPort,
_In_opt_ HANDLE ExceptionPort
_In_opt_ HANDLE TokenHandle
);

#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
// begin_rev
#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008 // NtCreateProcessEx only
#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010 // NtCreateProcessEx only, requires SeLockMemory
#define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020 // NtCreateProcessEx only, requires SeLockMemory
#define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040 // NtCreateUserProcess only
#define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080 // NtCreateProcessEx & NtCreateUserProcess, requires SeLoadDriver
#define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_FORCE_BREAKAWAY 0x00000400 // NtCreateProcessEx & NtCreateUserProcess, requires SeTcb
#define PROCESS_CREATE_FLAGS_MINIMAL_PROCESS 0x00000800 // NtCreateProcessEx only
#define PROCESS_CREATE_FLAGS_RELEASE_SECTION 0x00001000 // NtCreateProcessEx & NtCreateUserProcess
#define PROCESS_CREATE_FLAGS_AUXILIARY_PROCESS 0x00008000 // NtCreateProcessEx & NtCreateUserProcess, requires SeTcb
// end_rev

NTSYSCALLAPI
NTSTATUS
Expand All @@ -1215,10 +1226,10 @@ NtCreateProcessEx(
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ HANDLE ParentProcess,
_In_ ULONG Flags,
_In_ ULONG Flags, // PROCESS_CREATE_FLAGS_*
_In_opt_ HANDLE SectionHandle,
_In_opt_ HANDLE DebugPort,
_In_opt_ HANDLE ExceptionPort,
_In_opt_ HANDLE TokenHandle,
_Reserved_ ULONG Reserved // JobMemberLevel
);

Expand Down Expand Up @@ -1306,7 +1317,7 @@ NTSTATUS
NTAPI
NtGetNextThread(
_In_ HANDLE ProcessHandle,
_In_ HANDLE ThreadHandle,
_In_opt_ HANDLE ThreadHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ ULONG HandleAttributes,
_In_ ULONG Flags,
Expand Down Expand Up @@ -1991,21 +2002,6 @@ typedef struct _PS_CREATE_INFO

// end_private

// begin_rev
#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
#define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020
// Extended PROCESS_CREATE_FLAGS_*
#define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040
#define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080 // ?
#define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100
#define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
#define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
// end_rev

#if (PHNT_VERSION >= PHNT_VISTA)
NTSYSCALLAPI
NTSTATUS
Expand All @@ -2026,13 +2022,13 @@ NtCreateUserProcess(
#endif

// begin_rev
#define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
#define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002 // ?
#define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
#define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010 // ?
#define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020 // ?
#define THREAD_CREATE_FLAGS_BYPASS_PROCESS_FREEZE 0x00000040 // ?
#define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
#define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001 // NtCreateUserProcess & NtCreateThreadEx
#define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002 // NtCreateThreadEx only
#define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004 // NtCreateThreadEx only
#define THREAD_CREATE_FLAGS_LOADER_WORKER 0x00000010 // NtCreateThreadEx only
#define THREAD_CREATE_FLAGS_SKIP_LOADER_INIT 0x00000020 // NtCreateThreadEx only
#define THREAD_CREATE_FLAGS_BYPASS_PROCESS_FREEZE 0x00000040 // NtCreateThreadEx only
#define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080 // ?
// end_rev

#if (PHNT_VERSION >= PHNT_VISTA)
Expand Down
2 changes: 1 addition & 1 deletion phnt/include/ntrtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4627,7 +4627,7 @@ NTSYSAPI
LOGICAL
NTAPI
RtlSetCurrentTransaction(
_In_ HANDLE TransactionHandle
_In_opt_ HANDLE TransactionHandle
);
#endif

Expand Down
88 changes: 44 additions & 44 deletions phnt/include/ntsam.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ SamShutdownSamServer(

typedef enum _DOMAIN_INFORMATION_CLASS
{
DomainPasswordInformation = 1,
DomainGeneralInformation,
DomainLogoffInformation,
DomainOemInformation,
DomainNameInformation,
DomainReplicationInformation,
DomainServerRoleInformation,
DomainModifiedInformation,
DomainStateInformation,
DomainUasInformation,
DomainGeneralInformation2,
DomainLockoutInformation,
DomainModifiedInformation2
DomainPasswordInformation = 1, // q; s: DOMAIN_PASSWORD_INFORMATION
DomainGeneralInformation, // q: DOMAIN_GENERAL_INFORMATION
DomainLogoffInformation, // q; s: DOMAIN_LOGOFF_INFORMATION
DomainOemInformation, // q; s: DOMAIN_OEM_INFORMATION
DomainNameInformation, // q: DOMAIN_NAME_INFORMATION
DomainReplicationInformation, // q; s: DOMAIN_REPLICATION_INFORMATION
DomainServerRoleInformation, // q; s: DOMAIN_SERVER_ROLE_INFORMATION
DomainModifiedInformation, // q: DOMAIN_MODIFIED_INFORMATION
DomainStateInformation, // q; s: DOMAIN_STATE_INFORMATION
DomainUasInformation, // q; s: DOMAIN_UAS_INFORMATION
DomainGeneralInformation2, // q: DOMAIN_GENERAL_INFORMATION2
DomainLockoutInformation, // q; s: DOMAIN_LOCKOUT_INFORMATION
DomainModifiedInformation2 // q: DOMAIN_MODIFIED_INFORMATION2
} DOMAIN_INFORMATION_CLASS;

typedef enum _DOMAIN_SERVER_ENABLE_STATE
Expand Down Expand Up @@ -351,11 +351,11 @@ typedef struct _DOMAIN_LOCKOUT_INFORMATION

typedef enum _DOMAIN_DISPLAY_INFORMATION
{
DomainDisplayUser = 1,
DomainDisplayMachine,
DomainDisplayGroup,
DomainDisplayOemUser,
DomainDisplayOemGroup,
DomainDisplayUser = 1, // DOMAIN_DISPLAY_USER
DomainDisplayMachine, // DOMAIN_DISPLAY_MACHINE
DomainDisplayGroup, // DOMAIN_DISPLAY_GROUP
DomainDisplayOemUser, // DOMAIN_DISPLAY_OEM_USER
DomainDisplayOemGroup, // DOMAIN_DISPLAY_OEM_GROUP
DomainDisplayServer
} DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION;

Expand Down Expand Up @@ -563,10 +563,10 @@ typedef struct _GROUP_MEMBERSHIP

typedef enum _GROUP_INFORMATION_CLASS
{
GroupGeneralInformation = 1,
GroupNameInformation,
GroupAttributeInformation,
GroupAdminCommentInformation,
GroupGeneralInformation = 1, // q: GROUP_GENERAL_INFORMATION
GroupNameInformation, // q; s: GROUP_NAME_INFORMATION
GroupAttributeInformation, // q; s: GROUP_ATTRIBUTE_INFORMATION
GroupAdminCommentInformation, // q; s: GROUP_ADM_COMMENT_INFORMATION
GroupReplicationInformation
} GROUP_INFORMATION_CLASS;

Expand Down Expand Up @@ -718,9 +718,9 @@ SamSetMemberAttributesOfGroup(

typedef enum _ALIAS_INFORMATION_CLASS
{
AliasGeneralInformation = 1,
AliasNameInformation,
AliasAdminCommentInformation,
AliasGeneralInformation = 1, // q: ALIAS_GENERAL_INFORMATION
AliasNameInformation, // q; s: ALIAS_NAME_INFORMATION
AliasAdminCommentInformation, // q; s: ALIAS_ADM_COMMENT_INFORMATION
AliasReplicationInformation,
AliasExtendedInformation,
} ALIAS_INFORMATION_CLASS;
Expand Down Expand Up @@ -1001,26 +1001,26 @@ typedef struct _SR_SECURITY_DESCRIPTOR

typedef enum _USER_INFORMATION_CLASS
{
UserGeneralInformation = 1, // USER_GENERAL_INFORMATION
UserPreferencesInformation, // USER_PREFERENCES_INFORMATION
UserLogonInformation, // USER_LOGON_INFORMATION
UserLogonHoursInformation, // USER_LOGON_HOURS_INFORMATION
UserAccountInformation, // USER_ACCOUNT_INFORMATION
UserNameInformation, // USER_NAME_INFORMATION
UserAccountNameInformation, // USER_ACCOUNT_NAME_INFORMATION
UserFullNameInformation, // USER_FULL_NAME_INFORMATION
UserPrimaryGroupInformation, // USER_PRIMARY_GROUP_INFORMATION
UserHomeInformation, // USER_HOME_INFORMATION // 10
UserScriptInformation, // USER_SCRIPT_INFORMATION
UserProfileInformation, // USER_PROFILE_INFORMATION
UserAdminCommentInformation, // USER_ADMIN_COMMENT_INFORMATION
UserWorkStationsInformation, // USER_WORKSTATIONS_INFORMATION
UserSetPasswordInformation, // USER_SET_PASSWORD_INFORMATION
UserControlInformation, // USER_CONTROL_INFORMATION
UserExpiresInformation, // USER_EXPIRES_INFORMATION
UserGeneralInformation = 1, // q: USER_GENERAL_INFORMATION
UserPreferencesInformation, // q; s: USER_PREFERENCES_INFORMATION
UserLogonInformation, // q: USER_LOGON_INFORMATION
UserLogonHoursInformation, // q; s: USER_LOGON_HOURS_INFORMATION
UserAccountInformation, // q: USER_ACCOUNT_INFORMATION
UserNameInformation, // q; s: USER_NAME_INFORMATION
UserAccountNameInformation, // q; s: USER_ACCOUNT_NAME_INFORMATION
UserFullNameInformation, // q; s: USER_FULL_NAME_INFORMATION
UserPrimaryGroupInformation, // q; s: USER_PRIMARY_GROUP_INFORMATION
UserHomeInformation, // q; s: USER_HOME_INFORMATION // 10
UserScriptInformation, // q; s: USER_SCRIPT_INFORMATION
UserProfileInformation, // q; s: USER_PROFILE_INFORMATION
UserAdminCommentInformation, // q; s: USER_ADMIN_COMMENT_INFORMATION
UserWorkStationsInformation, // q; s: USER_WORKSTATIONS_INFORMATION
UserSetPasswordInformation, // s: USER_SET_PASSWORD_INFORMATION
UserControlInformation, // q; s: USER_CONTROL_INFORMATION
UserExpiresInformation, // q; s: USER_EXPIRES_INFORMATION
UserInternal1Information, // USER_INTERNAL1_INFORMATION
UserInternal2Information, // USER_INTERNAL2_INFORMATION
UserParametersInformation, // USER_PARAMETERS_INFORMATION // 20
UserParametersInformation, // q; s: USER_PARAMETERS_INFORMATION // 20
UserAllInformation, // USER_ALL_INFORMATION
UserInternal3Information, // USER_INTERNAL3_INFORMATION
UserInternal4Information, // USER_INTERNAL4_INFORMATION
Expand Down Expand Up @@ -1647,7 +1647,7 @@ SamQueryDisplayInformation(
_In_ ULONG Index,
_In_ ULONG EntryCount,
_In_ ULONG PreferredMaximumLength,
_In_ PULONG TotalAvailable,
_Out_ PULONG TotalAvailable,
_Out_ PULONG TotalReturned,
_Out_ PULONG ReturnedEntryCount,
_Outptr_ PVOID *SortedBuffer
Expand Down
2 changes: 1 addition & 1 deletion phnt/include/ntseapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ typedef enum _TOKEN_INFORMATION_CLASS
TokenPrivateNameSpace, // q; s: ULONG
TokenSingletonAttributes, // q: TOKEN_SECURITY_ATTRIBUTES_INFORMATION
TokenBnoIsolation, // q: TOKEN_BNO_ISOLATION_INFORMATION
TokenChildProcessFlags, // q; s: ULONG
TokenChildProcessFlags, // s: ULONG
TokenIsLessPrivilegedAppContainer, // q: ULONG
TokenIsSandboxed, // q: ULONG
TokenIsAppSilo, // TokenOriginatingProcessTrustLevel // q: TOKEN_PROCESS_TRUST_LEVEL
Expand Down
8 changes: 6 additions & 2 deletions phnt/include/winsta.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,17 @@ typedef enum _SHADOWSTATECLASS
State_Shadowed // The session is being shadowed by a different session. The current session is referred to as a shadow target.
} SHADOWSTATECLASS;

#define PROTOCOL_CONSOLE 0
#define PROTOCOL_OTHERS 1
#define PROTOCOL_RDP 2

// Retrieves the current shadow state of a session.
typedef struct _WINSTATIONSHADOW
{
SHADOWSTATECLASS ShadowState; // Specifies the current state of shadowing.
SHADOWCLASS ShadowClass; // Specifies the type of shadowing.
ULONG SessionId; // Specifies the session ID of the session.
ULONG ProtocolType; // Specifies the type of protocol on the session. Can be one of the following values.
ULONG ProtocolType; // Specifies the type of protocol on the session. Can be one of PROTOCOL_* values.
} WINSTATIONSHADOW, *PWINSTATIONSHADOW;

// Retrieves the client product ID and current product ID of the session.
Expand Down Expand Up @@ -836,7 +840,7 @@ WinStationFreeMemory(
HANDLE
WINAPI
WinStationOpenServerW(
_In_ PWSTR ServerName
_In_opt_ PWSTR ServerName
);

// rev
Expand Down

0 comments on commit cb8b23d

Please sign in to comment.