I get some fatal error on my project, the error is coming from sspi.h, i have to define something but i am not what and why, please someone explain.
sspi.h(60): fatal error C1189: #error : You must define one of SECURITY_WIN32, SECURITY_KERNEL, or SECURITY_MAC
While the diagnostic is clear about having to define one of SECURITY_WIN32
, SECURITY_KERNEL
, or SECURITY_MAC
, it doesn't help much in determining which one to use and why. To my knowledge, none of those are officially documented in the MSDN, so the only source of information are the actual header files.
SECURITY_MAC
: This symbol only ever appears in <sspi.h>, a file with a copyright notice of 1992-1999
. Presumably, this symbol was introduced to support compiling for "Classic" Mac OS, back when MFC was still planned to be a cross-platform framework targeting both Windows and Mac. The symbol doesn't appear to be of any practical use today.
SECURITY_KERNEL
: The most enlightening comment here is from <NTSecPKG.h>, reading // Can't use the windows.h def'ns in kernel mode.
. That appears to indicate that the SECURITY_KERNEL
symbol needs to be defined, when accessing the security package from a module running in kernel mode.
SECURITY_WIN32
: There are no comments on this symbol throughout the entire Windows SDK at all. It seems plausible, that this symbol should be used when accessing the security API from a user-mode application.
Assuming all of the above are correct, the following guideline can be used in determining the symbol to define:
SECURITY_WIN32
when compiling a user-mode application.SECURITY_KERNEL
when compiling a kernel-mode module.SECURITY_MAC
preprocessor symbol.Just add
#define SECURITY_WIN32
before all includes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With