Skip to content

Commit c0f1450

Browse files
committed
[NDK][XDK][SYSUTILS:PS] Update the KWAIT_REASON enumeration
Validated with the System Informer phnt headers[^1]. Versioning added for Windows 8+ values, from Vergilius[^2]. [^1]: phnt headers and documentation from: https://ntdoc.m417z.com/kwait_reason https://github.com/winsiderss/systeminformer/blob/5311c5ff7ebe0a900a792730395faf147d4451b9/phnt/include/ntkeapi.h#L49 [^2]: https://www.vergiliusproject.com
1 parent 7f79e1c commit c0f1450

3 files changed

Lines changed: 85 additions & 41 deletions

File tree

‎modules/rosapps/applications/sysutils/utils/ps/ps.c‎

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,42 +113,51 @@ struct waitres {
113113
DWORD state;
114114
char desc[17];
115115
} waitreason[35 + 1] = {
116-
{0, "Executive "},
117-
{1, "FreePage "},
118-
{2, "PageIn "},
119-
{3, "PoolAllocation "},
120-
{4, "DelayExecution "},
121-
{5, "Suspended "},
122-
{6, "UserRequest "},
123-
{7, "WrExecutive "},
124-
{8, "WrFreePage "},
125-
{9, "WrPageIn "},
126-
{10,"WrPoolAllocation "},
127-
{11,"WrDelayExecution "},
128-
{12,"WrSuspended "},
129-
{13,"WrUserRequest "},
130-
{14,"WrEventPair "},
131-
{15,"WrQueue "},
132-
{16,"WrLpcReceive "},
133-
{17,"WrLpcReply "},
134-
{18,"WrVirtualMemory "},
135-
{19,"WrPageOut "},
136-
{20,"WrRendezvous "},
137-
{21,"Spare2 "},
138-
{22,"WrGuardedMutex "},
139-
{23,"Spare4 "},
140-
{24,"Spare5 "},
141-
{25,"Spare6 "},
142-
{26,"WrKernel "},
143-
{27,"WrResource "},
144-
{28,"WrPushLock "},
145-
{29,"WrMutex "},
146-
{30,"WrQuantumEnd "},
147-
{31,"WrDispatchInt "},
148-
{32,"WrPreempted "},
149-
{33,"WrYieldExecution "},
150-
{34,"MaximumWaitReason"},
151-
{-1," ? "}
116+
{0, "Executive "},
117+
{1, "FreePage "},
118+
{2, "PageIn "},
119+
{3, "PoolAllocation "},
120+
{4, "DelayExecution "},
121+
{5, "Suspended "},
122+
{6, "UserRequest "},
123+
{7, "WrExecutive "},
124+
{8, "WrFreePage "},
125+
{9, "WrPageIn "},
126+
{10,"WrPoolAllocation "},
127+
{11,"WrDelayExecution "},
128+
{12,"WrSuspended "},
129+
{13,"WrUserRequest "},
130+
{14,"WrEventPair "},
131+
{15,"WrQueue "},
132+
{16,"WrLpcReceive "},
133+
{17,"WrLpcReply "},
134+
{18,"WrVirtualMemory "},
135+
{19,"WrPageOut "},
136+
{20,"WrRendezvous "},
137+
{21,"WrKeyedEvent "},
138+
{22,"WrTerminated "},
139+
{23,"WrProcessInSwap "},
140+
{24,"WrCpuRateControl "},
141+
{25,"WrCalloutStack "},
142+
{26,"WrKernel "},
143+
{27,"WrResource "},
144+
{28,"WrPushLock "},
145+
{29,"WrMutex "},
146+
{30,"WrQuantumEnd "},
147+
{31,"WrDispatchInt "},
148+
{32,"WrPreempted "},
149+
{33,"WrYieldExecution "},
150+
{34,"WrFastMutex "},
151+
{35,"WrGuardedMutex "},
152+
{36,"WrRundown "},
153+
{37,"WrAlertByThreadId"},
154+
{38,"WrDeferredPreempt"},
155+
{39,"WrPhysicalFault "},
156+
{40,"WrIoRing "},
157+
{41,"WrMdlCache "},
158+
{42,"WrRcu "},
159+
{43,"MaximumWaitReason"},
160+
{-1," ? "}
152161
};
153162

154163
static BOOL CALLBACK

‎sdk/include/ndk/ketypes.h‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ typedef enum _KWAIT_REASON
303303
WrVirtualMemory,
304304
WrPageOut,
305305
WrRendezvous,
306-
Spare2,
307-
WrGuardedMutex,
308-
Spare4,
309-
Spare5,
310-
Spare6,
306+
WrKeyedEvent,
307+
WrTerminated,
308+
WrProcessInSwap,
309+
WrCpuRateControl,
310+
WrCalloutStack,
311311
WrKernel,
312312
WrResource,
313313
WrPushLock,
@@ -316,6 +316,25 @@ typedef enum _KWAIT_REASON
316316
WrDispatchInt,
317317
WrPreempted,
318318
WrYieldExecution,
319+
WrFastMutex,
320+
WrGuardedMutex,
321+
WrRundown,
322+
#if (NTDDI_VERSION >= NTDDI_WIN8)
323+
WrAlertByThreadId,
324+
WrDeferredPreempt,
325+
#endif
326+
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
327+
WrPhysicalFault,
328+
#endif
329+
#if (NTDDI_VERSION >= NTDDI_WIN11)
330+
WrIoRing,
331+
#endif
332+
#if (NTDDI_VERSION >= NTDDI_WIN11_NI)
333+
WrMdlCache,
334+
#endif
335+
#if (NTDDI_VERSION >= NTDDI_WIN11_GE)
336+
WrRcu,
337+
#endif
319338
MaximumWaitReason
320339
} KWAIT_REASON;
321340

‎sdk/include/xdk/ketypes.h‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,22 @@ typedef enum _KWAIT_REASON {
501501
WrFastMutex,
502502
WrGuardedMutex,
503503
WrRundown,
504+
#if (NTDDI_VERSION >= NTDDI_WIN8)
505+
WrAlertByThreadId,
506+
WrDeferredPreempt,
507+
#endif
508+
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3)
509+
WrPhysicalFault,
510+
#endif
511+
#if (NTDDI_VERSION >= NTDDI_WIN11)
512+
WrIoRing,
513+
#endif
514+
#if (NTDDI_VERSION >= NTDDI_WIN11_NI)
515+
WrMdlCache,
516+
#endif
517+
#if (NTDDI_VERSION >= NTDDI_WIN11_GE)
518+
WrRcu,
519+
#endif
504520
MaximumWaitReason
505521
} KWAIT_REASON;
506522

0 commit comments

Comments
 (0)