Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Sep 7, 2022
1 parent fbf9fa1 commit fb0f73f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions include/pm_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pm_kext_glue_dll/src/pm_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion pm_kext_glue_dll/src/pm_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#include "pm_common.h"

Expand All @@ -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];
Expand Down

0 comments on commit fb0f73f

Please sign in to comment.