Skip to content

Commit 5d09915

Browse files
committed
1 parent 5f17419 commit 5d09915

File tree

20 files changed

+862
-98
lines changed

20 files changed

+862
-98
lines changed

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

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,61 +3733,100 @@ DEFINE_GUID( /* e46eead8-0c54-4489-9898-8fa79d059e0e */
37333733
// 0xae, 0xfc, 0xdc, 0x0f, 0x1d, 0x2f, 0xd2, 0x35
37343734
// );
37353735

3736+
/**
3737+
* The ETW class GUID for file I/O events.
3738+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/fileio
3739+
*/
37363740
DEFINE_GUID( /* 90cbdc39-4a3e-11d1-84f4-0000f80464e3 */
37373741
FileIoGuid,
37383742
0x90cbdc39,
37393743
0x4a3e,
37403744
0x11d1,
37413745
0x84, 0xf4, 0x00, 0x00, 0xf8, 0x04, 0x64, 0xe3
3742-
);
3746+
);
37433747

3748+
/**
3749+
* The ETW class GUID for image load events.
3750+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/image
3751+
*/
37443752
DEFINE_GUID( /* 2cb15d1d-5fc1-11d2-abe1-00a0c911f518 */
37453753
ImageLoadGuid,
37463754
0x2cb15d1d,
37473755
0x5fc1,
37483756
0x11d2,
37493757
0xab, 0xe1, 0x00, 0xa0, 0xc9, 0x11, 0xf5, 0x18
3750-
);
3758+
);
37513759

3760+
/**
3761+
* The ETW class GUID for page fault events.
3762+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/pagefault-v2
3763+
*/
37523764
DEFINE_GUID( /* 3d6fa8d3-fe05-11d0-9dda-00c04fd7ba7c */
37533765
PageFaultGuid,
37543766
0x3d6fa8d3,
37553767
0xfe05,
37563768
0x11d0,
37573769
0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c
3758-
);
3770+
);
37593771

3772+
/**
3773+
* The ETW class GUID for registry events.
3774+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/registry
3775+
*/
37603776
DEFINE_GUID( /* AE53722E-C863-11d2-8659-00C04FA321A1 */
37613777
RegistryGuid,
37623778
0xae53722e,
37633779
0xc863,
37643780
0x11d2,
37653781
0x86, 0x59, 0x0, 0xc0, 0x4f, 0xa3, 0x21, 0xa1
3766-
);
3782+
);
37673783

3784+
/**
3785+
* The ETW class GUID for TCP/IP events.
3786+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/tcpip
3787+
*/
37683788
DEFINE_GUID( /* 9a280ac0-c8e0-11d1-84e2-00c04fb998a2 */
37693789
TcpIpGuid,
37703790
0x9a280ac0,
37713791
0xc8e0,
37723792
0x11d1,
37733793
0x84, 0xe2, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0xa2
3774-
);
3794+
);
37753795

3796+
/**
3797+
* The ETW class GUID for thread events.
3798+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/thread
3799+
*/
37763800
DEFINE_GUID( /* 3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c */
37773801
ThreadGuid,
37783802
0x3d6fa8d1,
37793803
0xfe05,
37803804
0x11d0,
37813805
0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c
3782-
);
3806+
);
37833807

3808+
/**
3809+
* The ETW class GUID for UDP/IP events.
3810+
* \sa https://learn.microsoft.com/en-us/windows/win32/etw/udpip
3811+
*/
37843812
DEFINE_GUID( /* bf3a50c5-a9c9-4988-a005-2df0b7c80f80 */
37853813
UdpIpGuid,
37863814
0xbf3a50c5,
37873815
0xa9c9,
37883816
0x4988,
37893817
0xa0, 0x05, 0x2d, 0xf0, 0xb7, 0xc8, 0x0f, 0x80
3790-
);
3818+
);
3819+
3820+
/**
3821+
* The ETW class GUID for Intel Processor Trace (IPT) events.
3822+
*/
3823+
DEFINE_GUID( /* ff1fd2fd-6008-42bb-9e75-00a20051f3be */
3824+
IptGuid,
3825+
0xff1fd2fd,
3826+
0x6008,
3827+
0x42bb,
3828+
0x9e, 0x75, 0x00, 0xa2, 0x00, 0x51, 0xf3, 0xbe
3829+
);
37913830

37923831
//
37933832
// ThreadPool Events

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

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ EXTERN_C_START
88

99
typedef USHORT RTL_ATOM, *PRTL_ATOM;
1010

11+
/**
12+
* The NtAddAtom routine adds a Unicode string to the system atom table and
13+
* returns the corresponding atom identifier.
14+
*
15+
* \param AtomName A pointer to a Unicode string containing the atom name.
16+
* \param Length The length, in bytes, of the string pointed to by AtomName.
17+
* \param Atom An optional pointer that receives the resulting atom identifier.
18+
* \return NTSTATUS Successful or errant status.
19+
* \remarks If the atom already exists, its reference count is incremented and
20+
* the existing atom identifier is returned.
21+
* \see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-addatomw
22+
*/
1123
NTSYSCALLAPI
1224
NTSTATUS
1325
NTAPI
@@ -18,8 +30,33 @@ NtAddAtom(
1830

1931
#if (NTDDI_VERSION >= NTDDI_WIN8)
2032

33+
/**
34+
* ATOM_FLAG_NONE indicates that the atom being created should be placed in
35+
* the session-local atom table rather than the global atom table.
36+
*/
37+
#define ATOM_FLAG_NONE 0x0
38+
/**
39+
* ATOM_FLAG_GLOBAL indicates that the atom being created should be placed in
40+
* the global atom table rather than the session-local table.
41+
* \remarks This flag is only valid starting with Windows 8 and later.
42+
*/
2143
#define ATOM_FLAG_GLOBAL 0x2
2244

45+
// rev
46+
/**
47+
* The NtAddAtomEx routine adds a Unicode string to the system atom table with
48+
* additional creation flags.
49+
*
50+
* \param AtomName A pointer to a Unicode string containing the atom name.
51+
* \param Length The length, in bytes, of the string pointed to by AtomName.
52+
* \param Atom An optional pointer that receives the resulting atom identifier.
53+
* \param Flags A set of flags that control atom creation behavior.
54+
* \return NTSTATUS Successful or errant status.
55+
* \remarks ATOM_FLAG_GLOBAL may be used to create a global atom.
56+
* Only ATOM_FLAG_GLOBAL and ATOM_FLAG_NONE are currently supported.
57+
* Any other flag value results in STATUS_INVALID_PARAMETER.
58+
* \see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-addatomw
59+
*/
2360
NTSYSCALLAPI
2461
NTSTATUS
2562
NTAPI
@@ -31,6 +68,16 @@ NtAddAtomEx(
3168

3269
#endif
3370

71+
/**
72+
* The NtFindAtom routine retrieves the atom identifier associated with a
73+
* Unicode string in the system atom table.
74+
*
75+
* \param AtomName A pointer to a Unicode string containing the atom name.
76+
* \param Length The length, in bytes, of the string pointed to by AtomName.
77+
* \param Atom An optional pointer that receives the atom identifier if found.
78+
* \return NTSTATUS Successful or errant status.
79+
* \see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-findatomw
80+
*/
3481
NTSYSCALLAPI
3582
NTSTATUS
3683
NTAPI
@@ -39,12 +86,26 @@ NtFindAtom(
3986
_In_ ULONG Length,
4087
_Out_opt_ PRTL_ATOM Atom);
4188

89+
/**
90+
* The NtDeleteAtom routine decrements the reference count of an atom and
91+
* removes it from the system atom table when the count reaches zero.
92+
*
93+
* \param Atom The atom identifier to delete.
94+
* \return NTSTATUS Successful or errant status.
95+
* \remarks If the atom is still referenced elsewhere, it is not removed until
96+
* its reference count reaches zero.
97+
* \see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-deleteatom
98+
*/
4299
NTSYSCALLAPI
43100
NTSTATUS
44101
NTAPI
45102
NtDeleteAtom(
46103
_In_ RTL_ATOM Atom);
47104

105+
/**
106+
* The ATOM_INFORMATION_CLASS enumeration specifies the type of information
107+
* returned when querying atom table data.
108+
*/
48109
typedef enum _ATOM_INFORMATION_CLASS
49110
{
50111
AtomBasicInformation,

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ NtFilterBootOption(
444444
_In_ ULONG DataSize);
445445
#endif
446446

447+
/**
448+
* The SHUTDOWN_ACTION enumeration specifies the type of system shutdown to perform.
449+
*/
447450
typedef enum _SHUTDOWN_ACTION
448451
{
449452
ShutdownNoReboot,
@@ -452,6 +455,15 @@ typedef enum _SHUTDOWN_ACTION
452455
ShutdownRebootForRecovery // since WIN11
453456
} SHUTDOWN_ACTION;
454457

458+
/**
459+
* The NtShutdownSystem routine initiates a system shutdown using the specified
460+
* shutdown action.
461+
*
462+
* \param Action A SHUTDOWN_ACTION value that specifies whether the system
463+
* should halt, reboot, power off, or reboot for recovery.
464+
* \return NTSTATUS Successful or errant status.
465+
* \remarks The calling process must have the SE_SHUTDOWN_NAME privilege.
466+
*/
455467
NTSYSCALLAPI
456468
NTSTATUS
457469
NTAPI
@@ -460,12 +472,26 @@ NtShutdownSystem(
460472

461473
#pragma region Boot Display
462474

475+
/**
476+
* The NtDisplayString routine displays a Unicode string on the system display
477+
* during early boot or in environments where a console is not yet available.
478+
*
479+
* \param String A pointer to a UNICODE_STRING structure that contains the text to display.
480+
* \return NTSTATUS Successful or errant status.
481+
*/
463482
NTSYSCALLAPI
464483
NTSTATUS
465484
NTAPI
466485
NtDisplayString(
467486
_In_ PUNICODE_STRING String);
468487

488+
/**
489+
* The NtDrawText routine displays a Unicode string on the system display during
490+
* early boot or in environments where a standard console is not yet available.
491+
*
492+
* \param Text A pointer to a UNICODE_STRING structure that contains the text to draw on the screen.
493+
* \return NTSTATUS Successful or errant status.
494+
*/
469495
NTSYSCALLAPI
470496
NTSTATUS
471497
NTAPI

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ NtAllocateUuids(
3131

3232
#pragma region Hard Error
3333

34+
/**
35+
* The HARDERROR_RESPONSE_OPTION enumeration specifies the type of user
36+
* interface prompt that may be displayed when a hard error occurs.
37+
*/
3438
typedef enum _HARDERROR_RESPONSE_OPTION
3539
{
3640
OptionAbortRetryIgnore,
@@ -44,6 +48,10 @@ typedef enum _HARDERROR_RESPONSE_OPTION
4448
OptionCancelTryContinue
4549
} HARDERROR_RESPONSE_OPTION;
4650

51+
/**
52+
* The HARDERROR_RESPONSE enumeration specifies the response returned by the
53+
* caller or user when handling a hard error condition.
54+
*/
4755
typedef enum _HARDERROR_RESPONSE
4856
{
4957
ResponseReturnToCaller,
@@ -59,6 +67,10 @@ typedef enum _HARDERROR_RESPONSE
5967
ResponseContinue
6068
} HARDERROR_RESPONSE;
6169

70+
/**
71+
* HARDERROR_OVERRIDE_ERRORMODE indicates that the system should ignore the
72+
* calling process's error mode when processing a hard error.
73+
*/
6274
#define HARDERROR_OVERRIDE_ERRORMODE 0x10000000
6375

6476
/**
@@ -85,6 +97,15 @@ NtRaiseHardError(
8597
_In_ ULONG ValidResponseOptions,
8698
_Out_ PULONG Response);
8799

100+
/**
101+
* The NtSetDefaultHardErrorPort routine sets the system's default hard error
102+
* port, which is used by the kernel to deliver hard error notifications to a
103+
* user-mode process.
104+
*
105+
* \param DefaultHardErrorPort A handle to a port object that will receive
106+
* hard error messages generated by the system.
107+
* \return NTSTATUS Successful or errant status.
108+
*/
88109
NTSYSCALLAPI
89110
NTSTATUS
90111
NTAPI
@@ -175,6 +196,10 @@ NtSetDefaultHardErrorPort(
175196

176197
#pragma endregion
177198

199+
/**
200+
* MAX_WOW64_SHARED_ENTRIES defines the number of shared entries available to
201+
* the WOW64 (Windows-on-Windows 64-bit) subsystem.
202+
*/
178203
#define MAX_WOW64_SHARED_ENTRIES 16
179204

180205
/**

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@
44

55
EXTERN_C_START
66

7-
/* wdm.h */
7+
/* wdm.h & phnt */
88

9+
/**
10+
* The ALTERNATIVE_ARCHITECTURE_TYPE enumeration specifies the hardware
11+
* architecture variant used by the system.
12+
*
13+
* \remarks NEC98x86 represents the NEC PC-98 architecture,
14+
* supported only on very early Windows releases.
15+
*/
916
typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
1017
{
1118
StandardDesign, // None == 0 == standard design
1219
NEC98x86, // NEC PC98xx series on X86
1320
EndAlternatives // past end of known alternatives
1421
} ALTERNATIVE_ARCHITECTURE_TYPE;
1522

23+
/**
24+
* PROCESSOR_FEATURE_MAX defines the maximum number of processor feature flags
25+
* that may be reported by the system.
26+
*/
1627
#define PROCESSOR_FEATURE_MAX 64
1728

1829
EXTERN_C_END

0 commit comments

Comments
 (0)