﻿--- D:\home\work\miranda related\miranda\other\notifyanything-src\main.cc	Tue Oct 21 19:18:40 2003 UTC
+++ D:\home\work\miranda related\miranda\other\notifyanything-src-mine\main.cc	Mon Jun 23 14:55:07 2008 UTC
@@ -89,8 +89,8 @@
 extern "C" {
 HINSTANCE hInst;
 PLUGINLINK *pluginLink;
-PLUGININFO pluginInfo = {
-	sizeof(PLUGININFO),
+PLUGININFOEX pluginInfo = {
+	sizeof(PLUGININFOEX),
 	"NotifyAnything",
 	PLUGIN_MAKE_VERSION(0, PlugVersion.major, PlugVersion.minor, PlugVersion.build),
 	"Displays popups for custom events, triggered by UDP packages.",
@@ -98,8 +98,9 @@
 	"wesslen@users.sourceforge.net",
 	"Public Domain 2003 Daniel Wesslén",
 	"http://nortiq.com/miranda",
+	0, //not unicode aware
 	0,
-	0
+	{0x2fcc4ecf, 0x33f8, 0x4e1c, {0x82, 0x6d, 0xf9, 0x20, 0xfc, 0x5b, 0x5a, 0x17}} //{2fcc4ecf-33f8-4e1c-826d-f920fc5b5a17}
 };
 }
 
@@ -910,6 +911,9 @@
 		addr.sin_addr.S_un.S_un_b.s_b3 = 0;
 		addr.sin_addr.S_un.S_un_b.s_b4 = 1;
 	}
+	
+	BOOL reuseAddr = TRUE;
+	int err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &reuseAddr, sizeof(reuseAddr)); //Allows the socket to be bound to an address that is already in use.
 
 	if (bind(sock, reinterpret_cast<sockaddr *>(&addr), sizeof addr))
 		throw "bind failed";
@@ -981,7 +985,7 @@
 	if (!fm) {
 		t += "N/A: FormatMessage failed, error code was 0x";
 		char tbuf[10];
-		t += itoa(ec, tbuf, 16);
+		t += _itoa(ec, tbuf, 16);
 	} else
 		t += buf;
 
@@ -1012,11 +1016,21 @@
 
 extern "C" {
 
-__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD)
+OLD_MIRANDAPLUGININFO_SUPPORT;
+
+__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
 {
 	return &pluginInfo;
 }
 
+static const MUUID interfaces[] = {MIID_NOTIFYANYTHING, MIID_LAST};
+
+__declspec(dllexport) const MUUID *MirandaPluginInterfaces()
+{
+	return interfaces;
+}
+
+
 int __declspec(dllexport) Load(PLUGINLINK *link)
 {
 	pluginLink = link;
@@ -1024,7 +1038,7 @@
 
 	char buf[MAX_PATH+1];
 	strcpy(buf, ".");
-	g_mirandaDir = getcwd(buf, MAX_PATH);
+	g_mirandaDir = _getcwd(buf, MAX_PATH);
 
 	InitializeCriticalSection(&g_popups_cs);
 	InitializeCriticalSection(&g_wsocklock);

