SSPI Header File - Fatal Error

I get some fatal error in my project, the error comes from sspi.h, I have to determine something, but I'm not what and why, please explain to someone.

sspi.h(60): fatal error C1189: #error : You must define one of SECURITY_WIN32, SECURITY_KERNEL, or SECURITY_MAC 
+4
source share
2 answers

Just add

 #define SECURITY_WIN32 

before everything turns on

+4
source

While the diagnosis makes it clear that you need to define one of SECURITY_WIN32 , SECURITY_KERNEL or SECURITY_MAC , this does not help in determining which one to use and why. As far as I know, none of them are officially documented in MSDN, so the actual source files are the only source of information.

  • SECURITY_MAC : This symbol appears only in <sspi.h>, the 1992-1999 copyright notice file. Presumably, this symbol was introduced to support compilation for the "classic" Mac OS, when MFC was still planning to become a cross-platform platform, targeting both Windows and Mac. It seems that this symbol is practically not used today.

  • SECURITY_KERNEL : The most enlightened comment here is from <NTSecPKG.h>, reading // Can't use the windows.h def'ns in kernel mode. . This indicates that it is necessary to indicate the SECURITY_KERNEL symbol, which access to the security package is from a kernel-mode module.

  • SECURITY_WIN32 : There are no comments on this symbol on the entire Windows SDK. It seems plausible that this symbol should be used when accessing the security API from user mode.

Assuming all of the above is true, you can use the following guide to define a character to define a character:

  • Define SECURITY_WIN32 when compiling a user-mode application.
  • Define SECURITY_KERNEL when compiling the kernel mode module.
  • Never define an obsolete SECURITY_MAC preprocessor character.
+2
source

All Articles