On line 3126 in modules/system/nt.c (Pike 7.4.44 source tarball) I found the following:
typedef SECURITY_STATUS (WINAPI *querysecuritypackageinfotype)(SEC_CHAR*,PSecPkgInfo*); typedef SECURITY_STATUS (WINAPI *acquirecredentialshandletype)(SEC_CHAR*,SEC_CHAR*,ULONG,PLUID,PVOID,SEC_GET_KEY_FN,PVOID,PCredHandle,PTimeStamp); typedef SECURITY_STATUS (WINAPI *freecredentialshandletype)(PCredHandle); typedef SECURITY_STATUS (WINAPI *acceptsecuritycontexttype)(PCredHandle,PCtxtHandle,PSecBufferDesc,ULONG,ULONG,PCtxtHandle,PSecBufferDesc,PULONG,PTimeStamp); typedef SECURITY_STATUS (WINAPI *completeauthtokentype)(PCtxtHandle,PSecBufferDesc); typedef SECURITY_STATUS (WINAPI *deletesecuritycontexttype)(PCtxtHandle); typedef SECURITY_STATUS (WINAPI *freecontextbuffertype)(PVOID); typedef SECURITY_STATUS (WINAPI *querycontextattributestype)(PCtxtHandle,ULONG,PVOID);
I do not understand what these lines should accomplish. I only know that my compiler tells me
C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c: At top level: C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: parse error before '*' token C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: parse error before '*' token C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: warning: type defaults to `int' in declaration of `SECURITY_STATUS' C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: `SECURITY_STATUS' declared as function returning a function
and so on.
Can someone explain what the code is supposed to do or even better, tell me how to fix the problem..
Looks like you haven't included <Sspi.h>.
/ Henrik Grubbström (Lysator)
Previous text:
2004-04-06 12:25: Subject: WINAPI
On line 3126 in modules/system/nt.c (Pike 7.4.44 source tarball) I found the following:
typedef SECURITY_STATUS (WINAPI *querysecuritypackageinfotype)(SEC_CHAR*,PSecPkgInfo*); typedef SECURITY_STATUS (WINAPI *acquirecredentialshandletype)(SEC_CHAR*,SEC_CHAR*,ULONG,PLUID,PVOID,SEC_GET_KEY_FN,PVOID,PCredHandle,PTimeStamp); typedef SECURITY_STATUS (WINAPI *freecredentialshandletype)(PCredHandle); typedef SECURITY_STATUS (WINAPI *acceptsecuritycontexttype)(PCredHandle,PCtxtHandle,PSecBufferDesc,ULONG,ULONG,PCtxtHandle,PSecBufferDesc,PULONG,PTimeStamp); typedef SECURITY_STATUS (WINAPI *completeauthtokentype)(PCtxtHandle,PSecBufferDesc); typedef SECURITY_STATUS (WINAPI *deletesecuritycontexttype)(PCtxtHandle); typedef SECURITY_STATUS (WINAPI *freecontextbuffertype)(PVOID); typedef SECURITY_STATUS (WINAPI *querycontextattributestype)(PCtxtHandle,ULONG,PVOID);
I do not understand what these lines should accomplish. I only know that my compiler tells me
C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c: At top level: C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: parse error before '*' token C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: parse error before '*' token C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: warning: type defaults to `int' in declaration of `SECURITY_STATUS' C:/msys/1.0/home/SSS668/Pike-v7.4.44/src/modules/system/nt.c:3126: `SECURITY_STATUS' declared as function returning a function
and so on.
Can someone explain what the code is supposed to do or even better, tell me how to fix the problem..
/ Marcus Agehall (Scanian)
That is correct. The headers I'm using forces me to include security.h instead. The headers may be incorrect, but including security.h solves the problem.
However, the problem is that when using #include <security.h>
it's not my system include but the pike security.h file that is included. The result is not the same...
#include "/include/security.h" solves the problem.
/ Marcus Agehall (Scanian)
Previous text:
2004-04-06 12:54: Subject: WINAPI
Looks like you haven't included <Sspi.h>.
/ Henrik Grubbström (Lysator)
The solution to such problems in the past has been to prefix the pike header name with "pike_". Since the security system isn't used much I don't think it'd be a problem to do that in this case too.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-04-06 13:06: Subject: WINAPI
That is correct. The headers I'm using forces me to include security.h instead. The headers may be incorrect, but including security.h solves the problem.
However, the problem is that when using #include <security.h>
it's not my system include but the pike security.h file that is included. The result is not the same...
#include "/include/security.h" solves the problem.
/ Marcus Agehall (Scanian)
Sounds reasonable.
Next question: What the heck does the __dtoxmode() function-call found in fdlib.c do? And more important, where is it supposed to be defined. To me it looks like it's somewhat undocumented. I can find it within the MSVC7 crt libs, but not in any include-files. Nor can i find anything about it using google.
The __dtoxmode() is the last thing that stops my pike from compiling at this point. (Although I don't know if the result will be usable. Commenting out the call to _dtoxmode() results in a pike that can execute, but does cannot load files and thus fails when attempting to resolv getopt.)
/ Marcus Agehall (Scanian)
Previous text:
2004-04-06 14:42: Subject: WINAPI
The solution to such problems in the past has been to prefix the pike header name with "pike_". Since the security system isn't used much I don't think it'd be a problem to do that in this case too.
/ Martin Stjernholm, Roxen IS
My guess is that dtox means "DOS to UNIX" and sets line end conversion.
/ Martin Nilsson (provokatör)
Previous text:
2004-04-06 14:52: Subject: WINAPI
Sounds reasonable.
Next question: What the heck does the __dtoxmode() function-call found in fdlib.c do? And more important, where is it supposed to be defined. To me it looks like it's somewhat undocumented. I can find it within the MSVC7 crt libs, but not in any include-files. Nor can i find anything about it using google.
The __dtoxmode() is the last thing that stops my pike from compiling at this point. (Although I don't know if the result will be usable. Commenting out the call to _dtoxmode() results in a pike that can execute, but does cannot load files and thus fails when attempting to resolv getopt.)
/ Marcus Agehall (Scanian)
Very strange place to use it in then. Nah, I think it's something else.
I need to get my workstation so that I can work on this at home. It's no good to try solving these things while working on other code at the same time.. ;(
How was you progress under win32? Did you ever get it to compile correctly?
/ Marcus Agehall (Scanian)
Previous text:
2004-04-06 15:17: Subject: WINAPI
My guess is that dtox means "DOS to UNIX" and sets line end conversion.
/ Martin Nilsson (provokatör)
I complied it under CygWin and got it to run.
/ Martin Nilsson (provokatör)
Previous text:
2004-04-06 15:33: Subject: WINAPI
Very strange place to use it in then. Nah, I think it's something else.
I need to get my workstation so that I can work on this at home. It's no good to try solving these things while working on other code at the same time.. ;(
How was you progress under win32? Did you ever get it to compile correctly?
/ Marcus Agehall (Scanian)
BTW: You don't have the same problem with __loctotime_t(), which seems to be part of the same set of functions?
/ Henrik Grubbström (Lysator)
Previous text:
2004-04-06 16:22: Subject: WINAPI
From reading the code, __dtoxmode() seems to translate from DOS file attributes to UNIX protection mode flags.
/ Henrik Grubbström (Lysator)
I did, but that one was inside the mingw crt libs, so by just declaring it external, I avoided the problem. (But probably not in the right way...)
/ Marcus Agehall (Scanian)
Previous text:
2004-04-06 16:23: Subject: WINAPI
BTW: You don't have the same problem with __loctotime_t(), which seems to be part of the same set of functions?
/ Henrik Grubbström (Lysator)
That is somewhat close to what I figured. Assuming that is what it does, is there no better (more standard) way of doing this? I assume it is an undocumented way of doing things since google didn't tell me what it does.
/ Marcus Agehall (Scanian)
Previous text:
2004-04-06 16:22: Subject: WINAPI
From reading the code, __dtoxmode() seems to translate from DOS file attributes to UNIX protection mode flags.
/ Henrik Grubbström (Lysator)
I've made a copy of security.h,v to pike_security.h,v in the repository. I can fix the headers while at it...
/ Martin Nilsson (provokatör)
Previous text:
2004-04-06 14:42: Subject: WINAPI
The solution to such problems in the past has been to prefix the pike header name with "pike_". Since the security system isn't used much I don't think it'd be a problem to do that in this case too.
/ Martin Stjernholm, Roxen IS
pike-devel@lists.lysator.liu.se