From fb0f73fc62c84aa665101a2c12124be6da2300d3 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 7 Sep 2022 08:38:25 -0700 Subject: [PATCH] Fix compile error --- include/pm_debug.h | 10 +++++----- pm_kext_glue_dll/src/pm_api.c | 2 +- pm_kext_glue_dll/src/pm_debug.c | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/pm_debug.h b/include/pm_debug.h index f4613e4..63b07c2 100644 --- a/include/pm_debug.h +++ b/include/pm_debug.h @@ -44,12 +44,12 @@ extern int logLevel; //must be defined in dll and kernel object All we can do is write to a dedicated debug channel and adjust the loglevel at runtime. */ #ifdef DEBUG_ON - #define DEBUG(...) _DEBUG(0, ##__VA_ARGS__) - #define INFO(...) _DEBUG(1, ##__VA_ARGS__) - #define WARN(...) _DEBUG(2, ##__VA_ARGS__) - #define ERR(...) _DEBUG(3, ##__VA_ARGS__) //ERROR is already defined in wingdi.h + #define DEBUG(...) DEBUG_LOG(0, ##__VA_ARGS__) + #define INFO(...) DEBUG_LOG(1, ##__VA_ARGS__) + #define WARN(...) DEBUG_LOG(2, ##__VA_ARGS__) + #define ERR(...) DEBUG_LOG(3, ##__VA_ARGS__) //ERROR is already defined in wingdi.h - #define _DEBUG(level, format, ...) __DEBUG(LOGGER_NAME, level, __LINE__, format, ##__VA_ARGS__) + #define DEBUG_LOG(level, format, ...) __DEBUG(LOGGER_NAME, level, __LINE__, format, ##__VA_ARGS__) void __DEBUG(char *name, int level, int line, char *format, ...); void printIpHeader(char *buf, unsigned long buf_len, char *data, unsigned long dataLength); char* printIpv4Packet(void *packet); diff --git a/pm_kext_glue_dll/src/pm_api.c b/pm_kext_glue_dll/src/pm_api.c index d5139cc..b137c55 100644 --- a/pm_kext_glue_dll/src/pm_api.c +++ b/pm_kext_glue_dll/src/pm_api.c @@ -105,7 +105,7 @@ extern _EXPORT UINT32 PortmasterRecvVerdictRequest(PortmasterPacketInfo *packetI // Process verdict request if (success && (dwBytesRead > 0)) { - INFO("Bytes read : %d, rc = %d", dwBytesRead, rc); + INFO("Bytes read : %d, rc = %d", dwBytesRead, success); PortmasterPacketInfo *PacketInfoFromDevice = (PortmasterPacketInfo*)ReadBuffer; packetToString(PacketInfoFromDevice); memcpy(packetInfo, PacketInfoFromDevice, sizeof(PortmasterPacketInfo)); diff --git a/pm_kext_glue_dll/src/pm_debug.c b/pm_kext_glue_dll/src/pm_debug.c index b658c7f..d4f6a2b 100644 --- a/pm_kext_glue_dll/src/pm_debug.c +++ b/pm_kext_glue_dll/src/pm_debug.c @@ -18,6 +18,7 @@ #include #include +#include #include "pm_common.h" @@ -32,7 +33,7 @@ /* Portmaster Helpers */ /****************************************************************************/ #ifdef DEBUG_ON -void debugPrint(char* name, int level, int line, char* format, ...) { +void __DEBUG(char* name, int level, int line, char* format, ...) { if (level >= logLevel) { va_list args; static char buf[DEBUG_BUFSIZE+1];