Where are the BCrypt NTSTATUS code return values defined?

2.6k views Asked by At

The Windows CNG Cryptographic Primitive Functions have return values of type NTSTATUS. Several possible (symbolic) return values are mentioned, for example STATUS_AUTH_TAG_MISMATCH for the BCryptDecrypt function.

These symbols are not defined in bcrypt.h, nor in any other header file mentioned in the documentation. I can not use them in my code because they can not be resolved. Where are they located?

2

There are 2 answers

3
Fiddling Bits On BEST ANSWER

They are defined in:

ntstatus.h
0
trindflo On

windows.h is redefining macros without checking. This works:

#include <ntstatus.h>
#define WIN32_NO_STATUS 1
#include <windows.h>