Is MAXIMUM_WAIT_OBJECTS really 64?

Yes, it’s really 64. Since it’s a #define, it can’t change without recompiling programs, so it pretty much can never change.

Since STATUS_ABANDONED_WAIT_63 is defined as 0xBF and STATUS_USER_APC is defined as 0xC0, if you incremented MAXIMUM_WAIT_OBJECTS by even just one, there would be no way to tell the difference between the 65th handle being abandoned and your wait being terminated by an APC. Properly changing MAXIMUM_WAIT_OBJECTS would require renumbering the status codes, which would require recompiling every Win32 program in existence.

Also, a program compiled with MAXIMUM_WAIT_OBJECTS defined as 65 would fail on an OS where it’s defined as 64.

Leave a Comment