added error checking macros

svn path=/trunk/; revision=6825
This commit is contained in:
Gunnar Dalsnes 2003-11-30 18:51:43 +00:00
parent ee52d15ec0
commit f495637b1f

View file

@ -3,8 +3,20 @@
#ifndef __ASM__
/*
NT_SUCCESS return TRUE for a SUCCESS or INFORMATION error code.
NT_SUCCESS return FALSE for a WARNING or ERROR error code.
Note that !NT_SUCCESS(errCode) is NOT the same as NT_ERROR(errCode)
*/
#define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0)
#define NT_INFORMATION(StatCode) ((ULONG)(StatCode) >> 30 == 1)
#define NT_WARNING(StatCode) ((ULONG)(StatCode) >> 30 == 2)
#define NT_ERROR(StatCode) ((ULONG)(StatCode) >> 30 == 3)
/*
* Possible status codes
* FIXME: These may not be the actual values used by NT