NO

Author Topic: ntsecapi.h  (Read 3567 times)

czerny

  • Guest
ntsecapi.h
« on: August 13, 2014, 12:05:00 PM »
With this
Code: [Select]
#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.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2097
Re: ntsecapi.h
« Reply #1 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.
Code: [Select]
#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

  • Guest
Re: ntsecapi.h
« Reply #2 on: August 13, 2014, 03:56:46 PM »
Thanks Frankie! But this does not change the error message

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2097
Re: ntsecapi.h
« Reply #3 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  :(
Code: [Select]
#include <windows.h>
#include <LsaLookUp.h>
#include <ntsecapi.h>

int main(int argc, char *argv[])
{
return 0;
}
« Last Edit: August 13, 2014, 04:27:31 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

czerny

  • Guest
Re: ntsecapi.h
« Reply #4 on: August 13, 2014, 05:00:30 PM »
Thank you Frankie!

I have included the files locally
Code: [Select]
#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.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2097
Re: ntsecapi.h
« Reply #5 on: August 13, 2014, 05:56:57 PM »
Good to know  :)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide