Two questions:
1.
In “ntdef.h” the NTSTATUS is defined as follow:
typedef __success(return >= 0) LONG NTSTATUS;
what the hell is the “__success(return >= 0)”?
2.
In “ntstatus.h”, STATUS_SUCCESS is defined to 0.
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth
But the NT_SUCCESS macro in “ntdef.h” is:
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
Shouldn’t it be “Status == 0” ?
__success is an “Advanced Annotation” defined in SpecStrings_strict.h, which defines it as follows.
The reason that
NT_SUCCESSdoesn’t do a strict test againstSTATUS_SUCCESS (0)is probably that other codes likeSTATUS_PENDINGaren’t actually failures.