summaryrefslogtreecommitdiff
path: root/protocols/ConnectionNotify/src/stdafx.h
blob: d55f2c1910e5f1e3ba68629daadfe531876d356a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once

#include <windows.h>
#include <Commctrl.h>
#include <assert.h>
#include <iphlpapi.h>
#include <Tlhelp32.h>

#include <newpluginapi.h>
#include <m_core.h>
#include <m_clistint.h>
#include <m_skin.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_popup.h>
#include <m_utils.h>
#include <m_protosvc.h>
#include <m_system.h>

#ifdef _DEBUG
#include "debug.h"
#endif
#include "resource.h"
#include "netstat.h"
#include "filter.h"
#include "version.h"
#include "pid2name.h"

#define MAX_SETTING_STR 512
#define MAX_LENGTH 512

// Note: could also use malloc() and free()
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))

#define PLUGINNAME "ConnectionNotify"
#define PLUGINNAME_NEWSOUND PLUGINNAME "_new_sound"

struct CMPlugin : public PLUGIN<CMPlugin>
{
	bool     bSetColours;
	COLORREF BgColor, FgColor;
	int      iInterval;
	int      iInterval1;
	bool     bResolveIp;
	int      iStatus[MAX_STATUS_COUNT-1];
	int      iFiltersCount;
	int      iDefaultAction = TRUE;
	uint16_t     iStatusMask;

	CMPlugin();

	int Load() override;
	int Unload() override;
};

void showMsg(wchar_t *pName,uint32_t pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state);
static unsigned __stdcall checkthread(void *dummy);
CONNECTION * LoadSettingsConnections();
void saveSettingsConnections(CONNECTION *connHead);
void LoadSettings();

extern CONNECTION *connExceptions;
extern HANDLE hFilterOptionsThread;
extern uint32_t FilterOptionsThreadId;
extern CONNECTION *connCurrentEdit;
extern HANDLE hExceptionsMutex;
extern BOOL bOptionsOpen;