News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

ntsecapi.h

Started by czerny, August 13, 2014, 12:05:00 PM

Previous topic - Next topic

czerny

With this
#include <windows.h>
#include <ntsecapi.h>

int main(int argc, char *argv[])
{
return 0;
}


I got the following error:

C:\Programme\PellesC\Include\Win\ntsecapi.h(612): error #2161: Extraneous old-style parameter list.

frankie

This is not a bug.
You have to include Sspi.h first. You are also required to define the security level SECURITY_WIN32 or SECURITY_KERNEL.

#define SECURITY_WIN32      //Normally define this ... unless you are compiling OS sources... :-)
#include <windows.h>
#include <Sspi.h>
#include <ntsecapi.h>

int main(int argc, char *argv[])
{
return 0;
}
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

czerny

Thanks Frankie! But this does not change the error message

frankie

#3
Czerny,
I have been too fast  :-[
I still have MS original defs in my include dir so my compiles works even when they don't have to  >:(
Now, after I made some cleaning, I have found that the order I indicated above works only with MS distribution. To use NTSecAPI under PellesC you need at least the definitions from LsaLookUp.h, that of course are not in the PellesC distribution  :(
So I 'made' the PellesC version of LsaLookUp, then discovered another error in NTSecAPI: a residual __inout decoration  >:(
I fixed all and attach here the working version.
After all this work I agree, this is a bug!  :( I moved the thread back in bugs  >:(
Please let me know if it works now  :(

#include <windows.h>
#include <LsaLookUp.h>
#include <ntsecapi.h>

int main(int argc, char *argv[])
{
return 0;
}
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

czerny

Thank you Frankie!

I have included the files locally
#include "lsalookup.h"
#include "ntsecapi.h"


I have tried a little example then and found, that the const STATUS_SUCCESS is not known. I have used ERROR_SUCCESS instead. Now it compiles ok.

frankie

"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide