Skip to content

Commit 2dfac4d

Browse files
committed
1 parent d30665e commit 2dfac4d

File tree

10 files changed

+2143
-194
lines changed

10 files changed

+2143
-194
lines changed

Source/Include/KNSoft/NDK/NT/Afd.h

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ typedef struct _AFD_ENDPOINT_FLAGS
2828
UCHAR ConnectionLess : 1;
2929
UCHAR : 3;
3030
UCHAR MessageMode : 1;
31+
UCHAR : 3;
3132
UCHAR Raw : 1;
3233
UCHAR : 3;
3334
UCHAR Multipoint : 1;
35+
UCHAR : 3;
3436
UCHAR C_Root : 1;
3537
UCHAR : 3;
3638
UCHAR D_Root : 1;
39+
UCHAR : 3;
3740
UCHAR IgnoreTDI : 1;
3841
UCHAR : 3;
3942
UCHAR RioSocket : 1;
43+
UCHAR : 3;
4044
};
4145
ULONG EndpointFlags;
4246
};
@@ -1019,6 +1023,15 @@ typedef enum _AFD_RIO_NOTIFICATION_COMPLETION_TYPE
10191023
AfdRioIocpCompletion = 2,
10201024
} AFD_RIO_NOTIFICATION_COMPLETION_TYPE, *PAFD_RIO_NOTIFICATION_COMPLETION_TYPE;
10211025

1026+
// private
1027+
typedef struct _AFD_RIO_COMPLETION_QUEUE
1028+
{
1029+
ULONG QHead;
1030+
ULONG QTail;
1031+
BOOLEAN Corrupted;
1032+
RIORESULT QEntry[ANYSIZE_ARRAY];
1033+
} AFD_RIO_COMPLETION_QUEUE, *PAFD_RIO_COMPLETION_QUEUE;
1034+
10221035
// private
10231036
typedef struct _AFD_RIO_COMMAND_CREATE_CQ
10241037
{
@@ -1029,7 +1042,7 @@ typedef struct _AFD_RIO_COMMAND_CREATE_CQ
10291042
ULONGLONG NotificationContext;
10301043
ULONGLONG NotificationContext2;
10311044
ULONG BufferSize;
1032-
ULONGLONG Buffer;
1045+
ULONGLONG Buffer; // PAFD_RIO_COMPLETION_QUEUE
10331046
} AFD_RIO_COMMAND_CREATE_CQ, *PAFD_RIO_COMMAND_CREATE_CQ;
10341047

10351048
// private
@@ -1052,6 +1065,35 @@ typedef struct _AFD_RIO_COMMAND_NOTIFY_CQ
10521065
ULONG Index;
10531066
} AFD_RIO_COMMAND_NOTIFY_CQ, *PAFD_RIO_COMMAND_NOTIFY_CQ;
10541067

1068+
// private
1069+
typedef struct _AFD_RIO_BUF
1070+
{
1071+
ULONG BufferId;
1072+
ULONG Offset;
1073+
ULONG Length;
1074+
} AFD_RIO_BUF, *PAFD_RIO_BUF;
1075+
1076+
// private
1077+
typedef struct _AFD_RIO_REQUEST_QUEUE_ENTRY
1078+
{
1079+
AFD_RIO_BUF Data;
1080+
AFD_RIO_BUF SourceAddress;
1081+
AFD_RIO_BUF DestinationAddress;
1082+
AFD_RIO_BUF Control;
1083+
AFD_RIO_BUF FlagsBuffer;
1084+
ULONG Flags;
1085+
ULONGLONG Context;
1086+
} AFD_RIO_REQUEST_QUEUE_ENTRY, *PAFD_RIO_REQUEST_QUEUE_ENTRY;
1087+
1088+
// private
1089+
typedef struct _AFD_RIO_REQUEST_QUEUE
1090+
{
1091+
ULONG Start;
1092+
ULONG End;
1093+
BOOLEAN PokeRequired;
1094+
AFD_RIO_REQUEST_QUEUE_ENTRY Entries[ANYSIZE_ARRAY];
1095+
} AFD_RIO_REQUEST_QUEUE, *PAFD_RIO_REQUEST_QUEUE;
1096+
10551097
// private
10561098
typedef struct _AFD_RIO_COMMAND_CREATE_RQ_PAIR
10571099
{
@@ -1060,10 +1102,10 @@ typedef struct _AFD_RIO_COMMAND_CREATE_RQ_PAIR
10601102
ULONG ReceiveCompletionQueue;
10611103
ULONG SendQueueEntryCount;
10621104
ULONG SendQueueBufferSize;
1063-
ULONGLONG SendQueueBuffer;
1105+
ULONGLONG SendQueueBuffer; // PAFD_RIO_REQUEST_QUEUE
10641106
ULONG ReceiveQueueEntryCount;
10651107
ULONG ReceiveQueueBufferSize;
1066-
ULONGLONG ReceiveQueueBuffer;
1108+
ULONGLONG ReceiveQueueBuffer; // PAFD_RIO_REQUEST_QUEUE
10671109
ULONGLONG EndpointHandle;
10681110
ULONGLONG SocketContext;
10691111
} AFD_RIO_COMMAND_CREATE_RQ_PAIR, *PAFD_RIO_COMMAND_CREATE_RQ_PAIR;

Source/Include/KNSoft/NDK/NT/Etw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,6 +2668,7 @@ typedef struct _ETW_OBJECT_TYPE_EVENT
26682668
WCHAR Name[ANYSIZE_ARRAY];
26692669
} ETW_OBJECT_TYPE_EVENT, *PETW_OBJECT_TYPE_EVENT;
26702670

2671+
#include <pshpack1.h>
26712672
typedef struct _ETW_OBJECT_HANDLE_EVENT
26722673
{
26732674
PVOID Object;
@@ -2676,6 +2677,7 @@ typedef struct _ETW_OBJECT_HANDLE_EVENT
26762677
USHORT ObjectType;
26772678
WCHAR ObjectName[ANYSIZE_ARRAY];
26782679
} ETW_OBJECT_HANDLE_EVENT, *PETW_OBJECT_HANDLE_EVENT;
2680+
#include <poppack.h>
26792681

26802682
typedef struct _ETW_REFDEREF_OBJECT_EVENT
26812683
{

Source/Include/KNSoft/NDK/NT/Ex/Boot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ typedef struct _VARIABLE_NAME_AND_VALUE
135135

136136
/**
137137
* The NtEnumerateSystemEnvironmentValuesEx routine enumerates system environment values with extended information.
138-
*
138+
*
139139
* \param InformationClass The class of system environment information to retrieve.
140140
* \param Buffer Pointer to a buffer that receives the system environment values data.
141141
* \param BufferLength Pointer to a ULONG variable that specifies the size of the Buffer on input.

Source/Include/KNSoft/NDK/NT/Ex/SysInfo.h

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ typedef enum _SYSTEM_INFORMATION_CLASS
104104
SystemRefTraceInformation, // qs: SYSTEM_REF_TRACE_INFORMATION // ObQueryRefTraceInformation
105105
SystemSpecialPoolInformation, // qs: SYSTEM_SPECIAL_POOL_INFORMATION (requires SeDebugPrivilege) // MmSpecialPoolTag, then MmSpecialPoolCatchOverruns != 0
106106
SystemProcessIdInformation, // q: SYSTEM_PROCESS_ID_INFORMATION
107-
SystemErrorPortInformation, // s: (requires SeTcbPrivilege)
107+
SystemErrorPortInformation, // s: HANDLE (requires SeTcbPrivilege)
108108
SystemBootEnvironmentInformation, // q: SYSTEM_BOOT_ENVIRONMENT_INFORMATION // 90
109109
SystemHypervisorInformation, // q: SYSTEM_HYPERVISOR_QUERY_INFORMATION
110110
SystemVerifierInformationEx, // qs: SYSTEM_VERIFIER_INFORMATION_EX
@@ -269,7 +269,7 @@ typedef enum _SYSTEM_INFORMATION_CLASS
269269
SystemRefTraceInformationEx, // q: SYSTEM_REF_TRACE_INFORMATION_EX
270270
SystemBasicProcessInformation, // q: SYSTEM_BASICPROCESS_INFORMATION
271271
SystemHandleCountInformation, // q: SYSTEM_HANDLECOUNT_INFORMATION
272-
SystemRuntimeAttestationReport, // q:
272+
SystemRuntimeAttestationReport, // q: SYSTEM_RUNTIME_REPORT_INPUT
273273
SystemPoolTagInformation2, // q: SYSTEM_POOLTAG_INFORMATION2 // since 26H1
274274
MaxSystemInfoClass
275275
} SYSTEM_INFORMATION_CLASS;
@@ -2601,7 +2601,7 @@ typedef struct _SYSTEM_SECUREBOOT_POLICY_INFORMATION
26012601
_Struct_size_bytes_(NextEntryOffset)
26022602
typedef struct _SYSTEM_PAGEFILE_INFORMATION_EX
26032603
{
2604-
union // HACK union declaration for convenience (dmex)
2604+
union // union declaration for convenience (dmex)
26052605
{
26062606
SYSTEM_PAGEFILE_INFORMATION Info;
26072607
struct
@@ -3963,6 +3963,100 @@ typedef struct _SYSTEM_HANDLECOUNT_INFORMATION
39633963
ULONG HandleCount;
39643964
} SYSTEM_HANDLECOUNT_INFORMATION, *PSYSTEM_HANDLECOUNT_INFORMATION;
39653965

3966+
//
3967+
// Code Integrity Report Definitions.
3968+
//
3969+
3970+
typedef struct _CODE_INTEGRITY_RUNTIME_REPORT
3971+
{
3972+
//
3973+
// The Code Integrity runtime report header.
3974+
//
3975+
3976+
RUNTIME_REPORT_HEADER Header;
3977+
3978+
//
3979+
// The number of generations (updates) of policy there have been since boot.
3980+
// The initial generation at boot is 1.
3981+
//
3982+
3983+
UINT64 CurrentGeneration;
3984+
3985+
//
3986+
// The number of generations of policy that are in this report. This is
3987+
// non-zero with the current generation reported first, followed by prior
3988+
// generations in order of ascending age.
3989+
//
3990+
3991+
ULONG NumberOfGenerations;
3992+
3993+
} CODE_INTEGRITY_RUNTIME_REPORT;
3994+
3995+
#define CODE_INTEGRITY_REPORT_GENERATION_VERSION_CURRENT (1)
3996+
3997+
typedef struct _CODE_INTEGRITY_REPORT_GENERATION_HEADER
3998+
{
3999+
//
4000+
// Version of this structure.
4001+
//
4002+
4003+
USHORT Version;
4004+
4005+
//
4006+
// Reserved Field.
4007+
//
4008+
4009+
USHORT Reserved;
4010+
4011+
//
4012+
// The number of bytes consumed by this generation, including this header
4013+
// and all CODE_INTEGRITY_REPORT_RECORD_HEADER structures and payloads.
4014+
//
4015+
4016+
ULONG RecordSize;
4017+
4018+
//
4019+
// Secure Kernel / Hypervisor secure time reference when this policy was
4020+
// commited.
4021+
//
4022+
4023+
ULONG64 CommitTime;
4024+
4025+
} CODE_INTEGRITY_REPORT_GENERATION_HEADER;
4026+
4027+
#define CODE_INTEGRITY_REPORT_RECORD_VERSION_CURRENT (1)
4028+
4029+
typedef struct _CODE_INTEGRITY_REPORT_RECORD_HEADER
4030+
{
4031+
//
4032+
// Version of this structure.
4033+
//
4034+
4035+
USHORT Version;
4036+
4037+
//
4038+
// Reserved Field.
4039+
//
4040+
4041+
USHORT Reserved;
4042+
4043+
//
4044+
// The number of bytes consumed by this record, including this header.
4045+
//
4046+
4047+
ULONG RecordSize;
4048+
4049+
//
4050+
// The event code (type) of this record. The same codes as the Measured
4051+
// Boot TCG Log are used, for example SIPAEVENT_OS_REVOCATION_LIST, and
4052+
// indicate the structure type of the payload that immediately follows
4053+
// this header.
4054+
//
4055+
4056+
ULONG SipaEventCode;
4057+
4058+
} CODE_INTEGRITY_REPORT_RECORD_HEADER;
4059+
39664060
/**
39674061
* The SYSTEM_POOLTAG2 structure describes allocation statistics for a single
39684062
* pool tag, including paged and nonpaged usage.

Source/Include/KNSoft/NDK/NT/Ldr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ LdrResSearchResource(
13091309
_In_ ULONG Flags,
13101310
_Out_opt_ PVOID* ResourceBuffer,
13111311
_Out_opt_ PSIZE_T ResourceLength,
1312-
_Out_writes_bytes_opt_(*CultureNameLength) PVOID CultureName, // WCHAR buffer[6]
1312+
_Out_writes_bytes_opt_(*CultureNameLength) PWSTR CultureName, // WCHAR buffer[6]
13131313
_Out_opt_ PULONG CultureNameLength
13141314
);
13151315

Source/Include/KNSoft/NDK/NT/MinDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ typedef const GUID* PCGUID;
377377
typedef struct _WNF_STATE_NAME
378378
{
379379
union
380-
{
380+
{
381381
ULONGLONG Value;
382382
ULONG Data[2];
383383
struct

Source/Include/KNSoft/NDK/NT/Ob/Misc.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -483,23 +483,26 @@ NtQueryDirectoryObject(
483483
// private
484484
typedef enum _BOUNDARY_ENTRY_TYPE
485485
{
486-
OBNS_Invalid,
487-
OBNS_Name,
488-
OBNS_SID,
489-
OBNS_IL
486+
BOUNDARY_ENTRY_TYPE_INVALID,
487+
BOUNDARY_ENTRY_TYPE_NAME,
488+
BOUNDARY_ENTRY_TYPE_SID,
489+
BOUNDARY_ENTRY_TYPE_IL
490490
} BOUNDARY_ENTRY_TYPE;
491491

492+
// private
493+
typedef union _OBJECT_BOUNDARY_VALUE
494+
{
495+
WCHAR Name[1];
496+
PSID Sid;
497+
PSID IntegrityLabel;
498+
} OBJECT_BOUNDARY_VALUE, *POBJECT_BOUNDARY_VALUE;
499+
492500
// private
493501
typedef struct _OBJECT_BOUNDARY_ENTRY
494502
{
495-
BOUNDARY_ENTRY_TYPE EntryType;
496-
ULONG EntrySize;
497-
//union
498-
//{
499-
// WCHAR Name[1];
500-
// PSID Sid;
501-
// PSID IntegrityLabel;
502-
//};
503+
BOUNDARY_ENTRY_TYPE Type;
504+
ULONG Size;
505+
// OBJECT_BOUNDARY_VALUE Value;
503506
} OBJECT_BOUNDARY_ENTRY, *POBJECT_BOUNDARY_ENTRY;
504507

505508
// rev

Source/Include/KNSoft/NDK/NT/Ps/Basic.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ typedef struct _RTL_USER_PROCESS_PARAMETERS
120120

121121
PVOID PackageDependencyData;
122122
ULONG ProcessGroupId;
123-
ULONG LoaderThreads;
123+
ULONG LoaderThreads; // THRESHOLD
124124

125-
UNICODE_STRING RedirectionDllName; // REDSTONE4
125+
UNICODE_STRING RedirectionDllName; // REDSTONE5
126126
UNICODE_STRING HeapPartitionName; // 19H1
127127
PULONGLONG DefaultThreadpoolCpuSetMasks;
128128
ULONG DefaultThreadpoolCpuSetMaskCount;
129-
ULONG DefaultThreadpoolThreadMaximum;
130-
ULONG HeapMemoryTypeMask; // WIN11
129+
ULONG DefaultThreadpoolThreadMaximum; // 20H1
130+
ULONG HeapMemoryTypeMask; // WIN11 22H2
131131
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
132132

133133
typedef struct _RTL_USER_PROCESS_PARAMETERS64

0 commit comments

Comments
 (0)