diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 20:23:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 20:23:22 +0000 |
commit | 52824c91bac6d6cc0f04e242b07d9031477b6362 (patch) | |
tree | 3cafc4ce886f9066b50d4d32bfdda4c5c9f954f4 /protocols/Xfire | |
parent | b4caa062df453412e7cafa5b96afab0b0c3a2940 (diff) |
protocols cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire')
-rw-r--r-- | protocols/Xfire/src/Xfire_voicechat.cpp | 26 | ||||
-rw-r--r-- | protocols/Xfire/src/Xfire_voicechat.h | 4 | ||||
-rw-r--r-- | protocols/Xfire/src/baseProtocol.h | 19 | ||||
-rw-r--r-- | protocols/Xfire/src/main.cpp | 8 | ||||
-rw-r--r-- | protocols/Xfire/src/tools.cpp | 23 | ||||
-rw-r--r-- | protocols/Xfire/xfire_10.vcxproj | 8 | ||||
-rw-r--r-- | protocols/Xfire/xfire_11.vcxproj | 8 |
7 files changed, 19 insertions, 77 deletions
diff --git a/protocols/Xfire/src/Xfire_voicechat.cpp b/protocols/Xfire/src/Xfire_voicechat.cpp index 7a3ce804d2..b11f280975 100644 --- a/protocols/Xfire/src/Xfire_voicechat.cpp +++ b/protocols/Xfire/src/Xfire_voicechat.cpp @@ -6,39 +6,25 @@ Xfire_voicechat::Xfire_voicechat() { this->resetCurrentvoicestatus();
ipport=NULL;
tsrDLL=NULL;
- IpHlpApiDLL=NULL;
tsrGetServerInfo=NULL;
- GetExtendedTcpTable=NULL;
pid=0;
}
//dekonstruktor
-Xfire_voicechat::~Xfire_voicechat() {
+Xfire_voicechat::~Xfire_voicechat()
+{
//geladene tsr remote dll freigeben
if(tsrDLL) {
FreeLibrary(tsrDLL);
tsrDLL=NULL;
}
- //geladene iphlper freigeben
- if(IpHlpApiDLL) {
- FreeLibrary(IpHlpApiDLL);
- IpHlpApiDLL=NULL;
- }
}
//init
-void Xfire_voicechat::initVoicechat() {
+void Xfire_voicechat::initVoicechat()
+{
//tsremotedll laden
tsrDLL=this->loadTSR();
- //weitere dll's laden
- IpHlpApiDLL=LoadLibraryA("IpHlpApi.dll");
- if(IpHlpApiDLL) {
- GetExtendedTcpTable=(pGetExtendedTcpTable)GetProcAddress(IpHlpApiDLL,"GetExtendedTcpTable");
- }
- else
- {
- XFireLog("IpHlpApi.dll load failed!");
- }
}
//prüft ob das paket schonmal versendet wurde, soll unnötigen nwtraffic reduzieren, *ÜBERLEGUNG* ob wirklich notwendig
@@ -343,12 +329,12 @@ BOOL Xfire_voicechat::checkforMumble(SendGameStatus2Packet* packet) { DWORD size=0;
MIB_TCPTABLE_OWNER_PID* ptab=NULL;
//tcptabelle holen
- this->GetExtendedTcpTable(NULL,&size,FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0);
+ GetExtendedTcpTable(NULL, &size, FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0);
//überhaupt was drin?
if(size) {
ptab=(MIB_TCPTABLE_OWNER_PID*)malloc(size);
//liste auslesen
- if(GetExtendedTcpTable(ptab,&size,FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0)==NO_ERROR)
+ if(GetExtendedTcpTable(ptab, &size, FALSE, AF_INET, TCP_TABLE_OWNER_PID_CONNECTIONS, 0) == NO_ERROR)
{
for(unsigned int i=0;i<ptab->dwNumEntries;i++)
{
diff --git a/protocols/Xfire/src/Xfire_voicechat.h b/protocols/Xfire/src/Xfire_voicechat.h index 1b70f3f456..5240c389a4 100644 --- a/protocols/Xfire/src/Xfire_voicechat.h +++ b/protocols/Xfire/src/Xfire_voicechat.h @@ -87,12 +87,8 @@ private: HMODULE tsrDLL;
//tsrGetServerInfo funktion vom tsremotedll
LPtsrGetServerInfo tsrGetServerInfo;
- //GetExtendedTcpTable für mumble
- pGetExtendedTcpTable GetExtendedTcpTable;
//pid für mumble
DWORD pid;
- //IpHlperApi Module
- HMODULE IpHlpApiDLL;
public:
Xfire_voicechat();
~Xfire_voicechat();
diff --git a/protocols/Xfire/src/baseProtocol.h b/protocols/Xfire/src/baseProtocol.h index d7ba459cc8..cadb8c446e 100644 --- a/protocols/Xfire/src/baseProtocol.h +++ b/protocols/Xfire/src/baseProtocol.h @@ -87,25 +87,6 @@ //=======================================================
#define protocolname "XFire" //no spaces here :)
-/* */
-typedef DWORD (*pGetExtendedTcpTable)(
- __out_bcount_opt(*pdwSize) PVOID pTcpTable,
- __inout PDWORD pdwSize,
- __in BOOL bOrder,
- __in ULONG ulAf,
- __in TCP_TABLE_CLASS TableClass,
- __in ULONG Reserved
- );
-
-typedef DWORD (*pGetExtendedUdpTable)(
- __out_bcount_opt(*pdwSize) PVOID pUdpTable,
- __inout PDWORD pdwSize,
- __in BOOL bOrder,
- __in ULONG ulAf,
- __in UDP_TABLE_CLASS TableClass,
- __in ULONG Reserved
- );
-
//=======================================================
// Defines
//=======================================================
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index f2d80d8d1e..f75e74f5e7 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -121,7 +121,6 @@ HANDLE hookgamestart = NULL; char statusmessage[2][1024];
BOOL sendonrecieve=FALSE;
HANDLE hNetlib=NULL;
-pGetExtendedUdpTable _GetExtendedUdpTable=NULL;
extern LPtsrGetServerInfo tsrGetServerInfo;
//eventhandles
@@ -1064,8 +1063,6 @@ extern "C" __declspec(dllexport) int Load(void) Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
- //void* init = GetProcAddress(LoadLibrary("atl"),"AtlAxWinInit"); _asm call init;
-
//keine protoversion in der db, dann wohl der erste start von xfire
if(db_get_b(NULL,protocolname,"protover",0)==0)
{
@@ -1338,10 +1335,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent( ME_CLIST_PREBUILDCONTACTMENU, RebuildContactMenu );
- //lade GetExtendedUdpTable Funktion
- HMODULE hmod=LoadLibraryA("IpHlpApi.dll");
- _GetExtendedUdpTable=(pGetExtendedUdpTable)GetProcAddress(hmod,"GetExtendedUdpTable");
- if(_GetExtendedUdpTable==NULL&&db_get_b(NULL,protocolname,"ipportdetec",0))
+ if(db_get_b(NULL,protocolname,"ipportdetec",0))
{
//MessageBoxA(0,"GetExtendedUdpTable not found. ServerIP/Port detection feature will be disabled.","Miranda XFire Protocol Plugin",MB_OK|MB_ICONINFORMATION);
db_set_b(NULL,protocolname,"ipportdetec",0);
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index e662defe91..dea108bbc7 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -328,10 +328,6 @@ BOOL FindTeamSpeak(DWORD*pid,int*vid) { return found;
}
-//funktion wird in main gesetzt
-extern pGetExtendedUdpTable _GetExtendedUdpTable;
-
-
#include <vector>
#define maxuppackets 4
@@ -347,13 +343,6 @@ BOOL GetServerIPPort(DWORD pid,char*localaddrr,unsigned long localaddr,char*ip1, //DUMP("***Suche IP/Port***","");
- //wenn die funktion nicht initialisiert werden konnte, könne wir nicht serverip und port rausbekommen
- if(_GetExtendedUdpTable==NULL)
- {
- XFireLog("no GetExtendedUdpTable function");
- return FALSE;
- }
-
if(pid!=lastpid)
{
lastip=lastport=0;
@@ -363,9 +352,9 @@ BOOL GetServerIPPort(DWORD pid,char*localaddrr,unsigned long localaddr,char*ip1, DWORD size=0;
MIB_UDPTABLE_OWNER_PID * ptab=NULL;
- _GetExtendedUdpTable(NULL,&size,FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
+ GetExtendedUdpTable(NULL, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
ptab=(MIB_UDPTABLE_OWNER_PID*)malloc(size);
- int ret=_GetExtendedUdpTable(ptab,&size,FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
+ int ret = GetExtendedUdpTable(ptab, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
//alle grad geöffnet updverb nach der pid vom spiel suchen, um an den port ranzukommen
if(ret==NO_ERROR)
{
@@ -563,10 +552,6 @@ BOOL GetServerIPPort2(DWORD pid,char*localaddrr,unsigned long localaddr,char*ip1 static int lastpid=0;
static int lastport=0;
- //wenn die funktion nicht initialisiert werden konnte, könne wir nicht serverip und port rausbekommen
- if(_GetExtendedUdpTable==NULL)
- return FALSE;
-
if(pid!=lastpid)
{
lastip=lastport=0;
@@ -576,9 +561,9 @@ BOOL GetServerIPPort2(DWORD pid,char*localaddrr,unsigned long localaddr,char*ip1 DWORD size=0;
MIB_UDPTABLE_OWNER_PID * ptab=NULL;
- _GetExtendedUdpTable(NULL,&size,FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
+ GetExtendedUdpTable(NULL, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
ptab=(MIB_UDPTABLE_OWNER_PID*)malloc(size);
- int ret=_GetExtendedUdpTable(ptab,&size,FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
+ int ret = GetExtendedUdpTable(ptab, &size, FALSE, AF_INET, UDP_TABLE_OWNER_PID, 0);
//alle grad geöffnet updverb nach der pid vom spiel suchen, um an den port ranzukommen
if(ret==NO_ERROR)
{
diff --git a/protocols/Xfire/xfire_10.vcxproj b/protocols/Xfire/xfire_10.vcxproj index 1354b9e9b4..266a224686 100644 --- a/protocols/Xfire/xfire_10.vcxproj +++ b/protocols/Xfire/xfire_10.vcxproj @@ -90,13 +90,13 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -115,12 +115,12 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -145,7 +145,6 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -157,6 +156,7 @@ <TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -181,7 +181,6 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -192,6 +191,7 @@ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
diff --git a/protocols/Xfire/xfire_11.vcxproj b/protocols/Xfire/xfire_11.vcxproj index c4e554deb6..c423b007d0 100644 --- a/protocols/Xfire/xfire_11.vcxproj +++ b/protocols/Xfire/xfire_11.vcxproj @@ -94,7 +94,6 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -102,6 +101,7 @@ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -120,12 +120,12 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -150,7 +150,6 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -162,6 +161,7 @@ <TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -186,7 +186,6 @@ <AdditionalIncludeDirectories>../../include;../../plugins/ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib</AdditionalDependencies>
<OutputFile>$(OutDir)XFire.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -197,6 +196,7 @@ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
|