The Windows SSPI call AcquireCredentialsHandle
returns a time stamp indicating when the credentials handle will expire. The docs seem to be saying that the TimeStamp
structure should have the same format as a FILETIME
structure. However, when I use this function with the "Kerberos" package, the result makes no sense when treated as a FILETIME
:
#include <stdio.h>
#define SECURITY_WIN32
#include <windows.h>
#include <security.h>
int main() {
TimeStamp expiry;
int aquireCode;
CredHandle credHandle;
BOOL timeOk;
SYSTEMTIME sysTime;
aquireCode = AcquireCredentialsHandle(
NULL,
"Kerberos",
SECPKG_CRED_OUTBOUND,
NULL,
NULL,
NULL,
NULL,
&credHandle,
&expiry);
printf("result = %d\n", aquireCode);
printf("upper = %d (%X)\n", expiry.HighPart, expiry.HighPart);
printf("lower = %d (%X)\n", expiry.LowPart, expiry.LowPart);
timeOk = FileTimeToSystemTime((FILETIME*)&expiry, &sysTime);
printf("time covert ok = %d\n", timeOk);
printf("%4d/%02d/%02d %02d:%02d:%02d\n", sysTime.wYear, sysTime.wMonth, sysTime.wDay, sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
}
On my system, this prints:
result = 0
upper = 2147483530 (7FFFFF8A)
lower = -1488801793 (A742AFFF)
time covert ok = 1
30828/09/13 12:48:05
If it's not a FILETIME
, what is it?