dll: FspDebugLogFT

This commit is contained in:
Bill Zissimopoulos 2016-01-24 17:30:16 -08:00
parent 0e2b411f38
commit c34e70f7ab
2 changed files with 18 additions and 0 deletions

View File

@ -202,6 +202,7 @@ FSP_API VOID FspPathCombine(PWSTR Prefix, PWSTR Suffix);
FSP_API NTSTATUS FspNtStatusFromWin32(DWORD Error);
FSP_API VOID FspDebugLog(const char *format, ...);
FSP_API VOID FspDebugLogSD(const char *format, PSECURITY_DESCRIPTOR SecurityDescriptor);
FSP_API VOID FspDebugLogFT(const char *format, PFILETIME FileTime);
#ifdef __cplusplus
}

View File

@ -37,3 +37,20 @@ FSP_API VOID FspDebugLogSD(const char *format, PSECURITY_DESCRIPTOR SecurityDesc
else
FspDebugLog(format, "invalid security descriptor");
}
FSP_API VOID FspDebugLogFT(const char *format, PFILETIME FileTime)
{
SYSTEMTIME SystemTime;
char buf[32];
if (FileTimeToSystemTime(FileTime, &SystemTime))
{
wsprintfA(buf, "%04hu-%02hu-%02huT%02hu:%02hu:%02hu.%03huZ",
SystemTime.wYear, SystemTime.wMonth, SystemTime.wDay,
SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond,
SystemTime.wMilliseconds);
FspDebugLog(format, buf);
}
else
FspDebugLog(format, "invalid file time");
}