MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / DbgPrint

Function DbgPrint

libcppcryptfs/util/util.cpp:764–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764void DbgPrint(LPCWSTR format, ...) {
765 if (s_DebugMode) {
766
767 static mutex mtx;
768 lock_guard<mutex> lck(mtx);
769
770 const WCHAR* outputString;
771 WCHAR* buffer = NULL;
772 size_t length;
773 va_list argp;
774
775 va_start(argp, format);
776 length = static_cast<ptrdiff_t>(_vscwprintf(format, argp)) + 1;
777 buffer = (WCHAR*)_malloca(length * sizeof(WCHAR));
778 if (buffer) {
779 vswprintf_s(buffer, length, format, argp);
780 outputString = buffer;
781 } else {
782 outputString = format;
783 }
784 if (s_UseStdErr) {
785 fputws(outputString, stderr);
786 } else if (s_UseLogFile && s_DebugLogFile) {
787 fputws(outputString, s_DebugLogFile);
788 fflush(s_DebugLogFile);
789 } else {
790 OutputDebugStringW(outputString);
791 }
792 if (buffer)
793 _freea(buffer);
794 va_end(argp);
795 }
796}
797#if 1
798void DbgPrintAlways(LPCWSTR format, ...) {
799

Callers 15

AssignPlainPathMethod · 0.85
ConvertMethod · 0.85
DenyOtherSessionFunction · 0.85
PrintUserNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected