#pragma once #include "main.h" #include constexpr int MAX_LOG_LINE = 2048; constexpr size_t LOGON_TYPE_COUNT = 14; typedef enum _LOG_TYPE { LOG_TYPE_INFO = 0, LOG_TYPE_WARNING, LOG_TYPE_ERROR, LOG_TYPE_DEBUG, LOG_TYPE_COUNT } LOG_TYPE; typedef enum _WTS_PROTOCOL_TYPE { WTS_PROTOCOL_CONSOLE = 0, WTS_PROTOCOL_SHADOW = 1, WTS_PROTOCOL_RDP = 2, WTS_PROTOCOL_OTHER = 99 } WTS_PROTOCOL_TYPE; extern const char* LOG_TYPE_STRINGS[LOG_TYPE_COUNT]; extern PCWSTR W_LOG_TYPE_STRINGS[LOG_TYPE_COUNT]; extern const char* LOGON_TYPE_STRINGS[LOGON_TYPE_COUNT]; extern PCWSTR W_LOGON_TYPE_STRINGS[LOGON_TYPE_COUNT]; extern HANDLE log_file; extern BOOL g_logfile_lock_initialized; extern CRITICAL_SECTION g_logfile_lock; extern const WCHAR rublon_log_filepath[]; #ifdef _DEBUG void send_to_interprocess_pipe(const char* msg); #else #define send_to_interprocess_pipe(x) ((void)0) #endif //_DEBUG void init_logfile_lock(); BOOL create_log_file(LPCWSTR log_filename); void log_line(LOG_TYPE msg_type, PCWSTR msg_fmt, ...); void get_process_details(); PCWSTR check_unicode_string(PUNICODE_STRING u_str); LPCWSTR check_string(LPCWSTR str); BOOL compare_unicode_with_wchar(PUNICODE_STRING u_str, WCHAR *name); void copy_lpwstr_string(LPWSTR in, WCHAR *out, size_t out_size); void copy_lpwstr_string(LPCWSTR in, WCHAR *out, size_t out_size); void check_SID(PSID psid, PWSTR out_buff, size_t out_buff_size); LPCWSTR remote_protocol_type_to_string(USHORT proto);