aboutsummaryrefslogtreecommitdiff
path: root/Src/auth/log.cpp
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/auth/log.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/auth/log.cpp')
-rw-r--r--Src/auth/log.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/Src/auth/log.cpp b/Src/auth/log.cpp
new file mode 100644
index 00000000..4a51abd4
--- /dev/null
+++ b/Src/auth/log.cpp
@@ -0,0 +1,41 @@
+#include "api.h"
+#include <api/syscb/callbacks/consolecb.h>
+#include <time.h>
+#include <strsafe.h>
+void Log(const wchar_t *format, ...)
+{
+ wchar_t buffer[2048] = {0}; // hope it's big enough :)
+ va_list args;
+ va_start (args, format);
+ StringCbVPrintf(buffer, sizeof(buffer), format, args);
+ WASABI_API_SYSCB->syscb_issueCallback(SysCallback::CONSOLE, ConsoleCallback::DEBUGMESSAGE, 0, reinterpret_cast<intptr_t>(buffer));
+ va_end(args);
+}
+
+const wchar_t *MakeDateString(__time64_t convertTime)
+{
+ static wchar_t dest[2048];
+
+ SYSTEMTIME sysTime;
+ tm *newtime = _localtime64(&convertTime);
+ if (newtime)
+ {
+ sysTime.wYear = (WORD)(newtime->tm_year + 1900);
+ sysTime.wMonth = (WORD)(newtime->tm_mon + 1);
+ sysTime.wDayOfWeek = (WORD)newtime->tm_wday;
+ sysTime.wDay = (WORD)newtime->tm_mday;
+ sysTime.wHour = (WORD)newtime->tm_hour;
+ sysTime.wMinute = (WORD)newtime->tm_min;
+ sysTime.wSecond = (WORD)newtime->tm_sec;
+ sysTime.wMilliseconds = 0;
+
+ GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &sysTime, NULL, dest, 2048);
+
+ //wcsftime(expire_time, 63, L"%b %d, %Y", _localtime64(&convertTime));
+ }
+ else
+ dest[0] = 0;
+
+ return dest;
+}
+