Pelles C forum

Pelles C => Bug reports => Topic started by: czerny on August 13, 2014, 12:05:00 PM

Title: ntsecapi.h
Post by: czerny on August 13, 2014, 12:05:00 PM
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.
Title: Re: ntsecapi.h
Post by: frankie on August 13, 2014, 03:40:44 PM
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;
}
Title: Re: ntsecapi.h
Post by: czerny on August 13, 2014, 03:56:46 PM
Thanks Frankie! But this does not change the error message
Title: Re: ntsecapi.h
Post by: frankie on August 13, 2014, 04:21:59 PM
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;
}
Title: Re: ntsecapi.h
Post by: czerny on August 13, 2014, 05:00:30 PM
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.
Title: Re: ntsecapi.h
Post by: frankie on August 13, 2014, 05:56:57 PM
Good to know  :)