DDK Macros...

Not so long ago I have read an article “Simplifying Development with DDK
Macros”. It is really great. I know that any curious person may look into
DDK headers and find all this info himself. Long time ago I read almost
every header of NT4 DDK. But seems like Microsoft makes lots of efforts to
simplify driver developer’s life… I know it could make some aspects of
Windows architecture more simple, but what done is done.

I want to comment on status value test macros (NT_SUCCESS and such). We have
macros to test if status is success, if it belongs to informational or
warning or error group. That’s great! But very often we have to check if the
result of operation was unsuccessful. So, instead of writing
(!NT_SUCCESS(Status)) I propose to define one more macro – NT_FAIL – like
this:

#define NT_FAIL(Status) (!NT_SUCCESS(Status))

or like this

#define NT_FAIL(Status) ((NTSTATUS)(Status) < 0)

This is just like in COM. You have SUCCEEDED and FAILED macros. Strange,
that we don’t have one similar to FAILED macro.

-htfv