diff --git a/inc/winfsp/winfsp.h b/inc/winfsp/winfsp.h index 99785dc6..50f24166 100644 --- a/inc/winfsp/winfsp.h +++ b/inc/winfsp/winfsp.h @@ -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 } diff --git a/src/dll/debug.c b/src/dll/debug.c index ed4a2d1b..c1b9e6ab 100644 --- a/src/dll/debug.c +++ b/src/dll/debug.c @@ -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"); +}