summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin15/mir_full.sln20
-rw-r--r--protocols/EmLanProto/amdproto_15.vcxproj216
-rw-r--r--protocols/EmLanProto/amdproto_15.vcxproj.filters62
-rw-r--r--protocols/EmLanProto/emlanproto.vcxproj33
-rw-r--r--protocols/EmLanProto/emlanproto.vcxproj.filters4
-rw-r--r--protocols/EmLanProto/src/amdproto.cpp23
-rw-r--r--protocols/EmLanProto/src/get_time.cpp19
-rw-r--r--protocols/EmLanProto/src/lan.cpp2
-rw-r--r--protocols/EmLanProto/src/lan.h6
-rw-r--r--protocols/EmLanProto/src/mlan.cpp164
-rw-r--r--protocols/EmLanProto/src/mlan.h14
-rw-r--r--protocols/EmLanProto/src/stdafx.cxx (renamed from protocols/EmLanProto/src/stdafx.cpp)16
-rw-r--r--protocols/EmLanProto/src/stdafx.h1
-rw-r--r--protocols/EmLanProto/src/version.h2
-rw-r--r--src/mir_core/src/utf.cpp2
15 files changed, 165 insertions, 419 deletions
diff --git a/bin15/mir_full.sln b/bin15/mir_full.sln
index 5dc6576a23..1470f0cb55 100644
--- a/bin15/mir_full.sln
+++ b/bin15/mir_full.sln
@@ -274,8 +274,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NoHistory", "..\plugins\NoH
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NotesReminders", "..\plugins\NotesAndReminders\NotesReminders_15.vcxproj", "{EEB57129-946C-4B98-8856-FDA501AE2A5E}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmLanProto", "..\protocols\EmLanProto\amdproto_15.vcxproj", "{2115FEBC-1EC4-4F95-A058-A523ED5295A4}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YAMN", "..\plugins\YAMN\YAMN.vcxproj", "{C5A87409-F08C-4A07-A8F9-1F5D52BA6D72}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewsAggregator", "..\plugins\NewsAggregator\NewsAggregator.vcxproj", "{6DE11A47-2268-4B08-8DE5-15A1705FCE28}"
@@ -430,6 +428,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtox", "..\protocols\Tox\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileAsMessage", "..\plugins\FileAsMessage\fileecho.vcxproj", "{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmLanProto", "..\protocols\EmLanProto\emlanproto.vcxproj", "{2115FEBC-1EC4-4F95-A058-A523ED5295A4}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -1366,14 +1366,6 @@ Global
{EEB57129-946C-4B98-8856-FDA501AE2A5E}.Release|Win32.Build.0 = Release|Win32
{EEB57129-946C-4B98-8856-FDA501AE2A5E}.Release|x64.ActiveCfg = Release|x64
{EEB57129-946C-4B98-8856-FDA501AE2A5E}.Release|x64.Build.0 = Release|x64
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|Win32.ActiveCfg = Debug|Win32
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|Win32.Build.0 = Debug|Win32
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|x64.ActiveCfg = Debug|x64
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|x64.Build.0 = Debug|x64
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|Win32.ActiveCfg = Release|Win32
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|Win32.Build.0 = Release|Win32
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|x64.ActiveCfg = Release|x64
- {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|x64.Build.0 = Release|x64
{C5A87409-F08C-4A07-A8F9-1F5D52BA6D72}.Debug|Win32.ActiveCfg = Debug|Win32
{C5A87409-F08C-4A07-A8F9-1F5D52BA6D72}.Debug|Win32.Build.0 = Debug|Win32
{C5A87409-F08C-4A07-A8F9-1F5D52BA6D72}.Debug|x64.ActiveCfg = Debug|x64
@@ -1988,6 +1980,14 @@ Global
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Release|Win32.Build.0 = Release|Win32
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Release|x64.ActiveCfg = Release|x64
{D7A3B8D0-425A-2286-8E2F-2C0BF1EE5C2E}.Release|x64.Build.0 = Release|x64
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|Win32.Build.0 = Debug|Win32
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|x64.ActiveCfg = Debug|x64
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Debug|x64.Build.0 = Debug|x64
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|Win32.ActiveCfg = Release|Win32
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|Win32.Build.0 = Release|Win32
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|x64.ActiveCfg = Release|x64
+ {2115FEBC-1EC4-4F95-A058-A523ED5295A4}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/protocols/EmLanProto/amdproto_15.vcxproj b/protocols/EmLanProto/amdproto_15.vcxproj
deleted file mode 100644
index b8f71e960a..0000000000
--- a/protocols/EmLanProto/amdproto_15.vcxproj
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>EmLanProto</ProjectName>
- <ProjectGuid>{2115FEBC-1EC4-4F95-A058-A523ED5295A4}</ProjectGuid>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PlatformToolset>v141_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PlatformToolset>v141_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v141_xp</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v141_xp</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)\$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)\$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)\$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)\$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)\$(Configuration)\Plugins\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)\$(Configuration)64\Plugins\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)\$(Configuration)\Obj\$(ProjectName)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)\$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <IgnoreImportLibrary>true</IgnoreImportLibrary>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <ExceptionHandling>false</ExceptionHandling>
- <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Windows</SubSystem>
- <BaseAddress>0x22000000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <ExceptionHandling>false</ExceptionHandling>
- <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Windows</SubSystem>
- <BaseAddress>0x22000000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <ExceptionHandling>false</ExceptionHandling>
- <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <SubSystem>Windows</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <BaseAddress>0x22000000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
- <ExceptionHandling>false</ExceptionHandling>
- <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
- </ClCompile>
- <Link>
- <AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Windows</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <BaseAddress>0x22000000</BaseAddress>
- <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
- <AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="src\amdproto.cpp" />
- <ClCompile Include="src\get_time.cpp" />
- <ClCompile Include="src\lan.cpp" />
- <ClCompile Include="src\mlan.cpp" />
- <ClCompile Include="src\stdafx.cpp">
- <PrecompiledHeader>Create</PrecompiledHeader>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\get_time.h" />
- <ClInclude Include="src\lan.h" />
- <ClInclude Include="src\mlan.h" />
- <ClInclude Include="src\resource.h" />
- <ClInclude Include="src\stdafx.h" />
- <ClInclude Include="src\Version.h" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\amdproto.rc" />
- <ResourceCompile Include="res\Version.rc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/protocols/EmLanProto/amdproto_15.vcxproj.filters b/protocols/EmLanProto/amdproto_15.vcxproj.filters
deleted file mode 100644
index 8d38c80fbe..0000000000
--- a/protocols/EmLanProto/amdproto_15.vcxproj.filters
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{aa1fb7ce-7e83-46e8-b50b-cc87043ddfe8}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{c7da55a0-28ce-4c6f-acbe-8e2cba06f96d}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{ee329731-83da-4e3e-abb0-188efa6b23b2}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="res\amdproto.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- <ResourceCompile Include="res\Version.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="src\amdproto.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\get_time.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\lan.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\mlan.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="src\stdafx.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="src\get_time.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\lan.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\mlan.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\resource.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\stdafx.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="src\Version.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/protocols/EmLanProto/emlanproto.vcxproj b/protocols/EmLanProto/emlanproto.vcxproj
new file mode 100644
index 0000000000..27cf97a318
--- /dev/null
+++ b/protocols/EmLanProto/emlanproto.vcxproj
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{2115FEBC-1EC4-4F95-A058-A523ED5295A4}</ProjectGuid>
+ <ProjectName>EmLanProto</ProjectName>
+ </PropertyGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
+ </ImportGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/EmLanProto/emlanproto.vcxproj.filters b/protocols/EmLanProto/emlanproto.vcxproj.filters
new file mode 100644
index 0000000000..fcae13a9d8
--- /dev/null
+++ b/protocols/EmLanProto/emlanproto.vcxproj.filters
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
+</Project> \ No newline at end of file
diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp
index d594a8f277..1bcc43a24d 100644
--- a/protocols/EmLanProto/src/amdproto.cpp
+++ b/protocols/EmLanProto/src/amdproto.cpp
@@ -28,7 +28,7 @@ bool g_InitOptions = false;
std::fstream emlanLog("EmLanLog.txt", std::ios::out|std::ios::app);
#endif
-extern "C" __declspec(dllexport) PLUGININFOEX* __cdecl MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* __cdecl MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -95,7 +95,7 @@ static INT_PTR __cdecl EMPGetStatus(WPARAM, LPARAM)
return g_lan->GetMirandaStatus();
}
-INT_PTR __cdecl EMPSetStatus(WPARAM new_status, LPARAM lParam)
+INT_PTR __cdecl EMPSetStatus(WPARAM new_status, LPARAM)
{
g_lan->SetMirandaStatus(new_status);
return 0;
@@ -124,7 +124,8 @@ static INT_PTR __cdecl EMPAddToList(WPARAM flags, LPARAM lParam)
static INT_PTR __cdecl EMPBasicSearch(WPARAM, LPARAM lParam)
{
- return g_lan->Search((const char*)lParam);
+ const wchar_t *wszName = (const wchar_t*)lParam;
+ return g_lan->Search(_T2A(wszName));
}
static INT_PTR __cdecl EMPGetAwayMsg(WPARAM, LPARAM lParam)
@@ -147,27 +148,27 @@ static INT_PTR __cdecl EMPFileResume(WPARAM wParam, LPARAM lParam)
return g_lan->FileResume((int)wParam, (PROTOFILERESUME*)lParam);
}
-static INT_PTR __cdecl EMPSendFileAllow(WPARAM wParam, LPARAM lParam)
+static INT_PTR __cdecl EMPSendFileAllow(WPARAM, LPARAM lParam)
{
return g_lan->FileAllow((CCSDATA*)lParam);
}
-static INT_PTR __cdecl EMPSendFileDeny(WPARAM wParam, LPARAM lParam)
+static INT_PTR __cdecl EMPSendFileDeny(WPARAM, LPARAM lParam)
{
return g_lan->FileDeny((CCSDATA*)lParam);
}
-static INT_PTR __cdecl EMPSendFileCancel(WPARAM wParam, LPARAM lParam)
+static INT_PTR __cdecl EMPSendFileCancel(WPARAM, LPARAM lParam)
{
return g_lan->FileCancel((CCSDATA*)lParam);
}
-static INT_PTR __cdecl EMPSendFile(WPARAM wParam, LPARAM lParam)
+static INT_PTR __cdecl EMPSendFile(WPARAM, LPARAM lParam)
{
return g_lan->SendFile((CCSDATA*)lParam);
}
-static INT_PTR __cdecl EMPRecvFile(WPARAM wParam, LPARAM lParam)
+static INT_PTR __cdecl EMPRecvFile(WPARAM, LPARAM lParam)
{
g_lan->RecvFile((CCSDATA*)lParam);
return 0;
@@ -187,7 +188,7 @@ INT_PTR CALLBACK EMPDlgProcMainOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
int cind = 0;
for (int i = 0; i < count; i++) {
in_addr addr = g_lan->GetHostAddress(i);
- char* ipStr = inet_ntoa(addr);
+ wchar_t* ipStr = mir_a2u(inet_ntoa(addr));
if (addr.S_un.S_addr == caddr.S_un.S_addr)
cind = i;
SendDlgItemMessage(hwndDlg, IDC_LIST_IP, LB_ADDSTRING, 0, (LPARAM)ipStr);
@@ -275,7 +276,7 @@ int __cdecl EMPCreateOptionsDlg(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = g_hInstance;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_EMP_FORM_OPT);
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_EMP_FORM_OPT);
odp.szTitle.a = LPGEN("E-mage LAN protocol");
odp.szGroup.a = LPGEN("Network");
odp.flags = ODPF_BOLDGROUPS;
@@ -286,7 +287,7 @@ int __cdecl EMPCreateOptionsDlg(WPARAM wParam, LPARAM)
//////////////////////////////////////////////////////////////////////////
-INT_PTR CALLBACK EMPDlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK EMPDlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM)
{
HWND hwndOwner;
RECT rc, rcDlg, rcOwner;
diff --git a/protocols/EmLanProto/src/get_time.cpp b/protocols/EmLanProto/src/get_time.cpp
index 76ad065fdf..6ffccc5047 100644
--- a/protocols/EmLanProto/src/get_time.cpp
+++ b/protocols/EmLanProto/src/get_time.cpp
@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-
static int daysInMonth[]={31,28,31,30,31,30,31,31,30,31,30,31};
static int IsLeapYear(int year)
{
@@ -42,24 +41,6 @@ static DWORD YMDHMSToTime(int year,int month,int day,int hour,int minute,int sec
return ret+3600*hour+60*minute+second;
}
-
-static DWORD TimestampLocalToGMT(DWORD from)
-{
- FILETIME ft1,ft2;
- LARGE_INTEGER liFiletime;
-
- //this huge number is the difference between 1970 and 1601 in seconds
- //liFiletime.QuadPart=(11644473600i64+(__int64)from)*10000000;
- __int64 t = 11644473600;
- liFiletime.QuadPart=(t+(__int64)from)*10000000;
- ft1.dwHighDateTime=liFiletime.HighPart;
- ft1.dwLowDateTime=liFiletime.LowPart;
- LocalFileTimeToFileTime(&ft1,&ft2);
- liFiletime.HighPart=ft2.dwHighDateTime;
- liFiletime.LowPart=ft2.dwLowDateTime;
- return (DWORD)(liFiletime.QuadPart/10000000-t);
-}
-
DWORD get_time()
{
SYSTEMTIME stime;
diff --git a/protocols/EmLanProto/src/lan.cpp b/protocols/EmLanProto/src/lan.cpp
index 336e64bb75..301e2a8284 100644
--- a/protocols/EmLanProto/src/lan.cpp
+++ b/protocols/EmLanProto/src/lan.cpp
@@ -191,7 +191,7 @@ void CLan::SendPacket(in_addr addr, const u_char* mes, int len)
addrTo.sin_addr = addr;
addrTo.sin_family = AF_INET;
addrTo.sin_port = PORT_NUMBER;
- int res = sendto(m_income, (const char*)mes, len, 0, (sockaddr*)&addrTo, sizeof(addrTo));
+ sendto(m_income, (const char*)mes, len, 0, (sockaddr*)&addrTo, sizeof(addrTo));
}
}
diff --git a/protocols/EmLanProto/src/lan.h b/protocols/EmLanProto/src/lan.h
index 1fd2bbe80a..c6dc217c64 100644
--- a/protocols/EmLanProto/src/lan.h
+++ b/protocols/EmLanProto/src/lan.h
@@ -69,11 +69,11 @@ protected:
void SendPacketBroadcast(const u_char* mes, int len);
//! Event - called when packet is received
- virtual void OnRecvPacket(u_char* mes, int len, in_addr from) { };
+ virtual void OnRecvPacket(u_char*, int, in_addr) { };
//! Event - called when new incoming tcp connection is created (new thread is created)
- virtual void OnInTCPConnection(u_long addr, SOCKET m_socket) { };
+ virtual void OnInTCPConnection(u_long, SOCKET) { };
//! Event - called when new outgoing tcp connection is created )new thread is created)
- virtual void OnOutTCPConnection(u_long addr, SOCKET m_socket, LPVOID lpParameter) {};
+ virtual void OnOutTCPConnection(u_long, SOCKET, LPVOID) {};
//! Creates new outgoing TCP connection
SOCKET CreateTCPConnection(u_long addr, LPVOID lpParameter);
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index 107effffdb..6cd8255697 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -35,8 +35,6 @@ CMLan::CMLan()
m_mirStatus = ID_STATUS_OFFLINE;
m_pRootContact = nullptr;
-
- m_pRootContact = nullptr;
m_hCheckThread = nullptr;
m_handleId = 1;
@@ -73,7 +71,7 @@ CMLan::~CMLan()
void CMLan::DeleteCache()
{
- TContact* pCont = m_pRootContact;
+ TContact *pCont = m_pRootContact;
m_pRootContact = nullptr;
while (pCont) {
delete[] pCont->m_nick;
@@ -190,8 +188,9 @@ void CMLan::RequestStatus(bool answer, u_long addr)
TPacket pak;
memset(&pak, 0, sizeof(pak));
pak.flReqStatus = answer;
- pak.strName = m_name;
+ pak.strName = mir_u2a(m_name);
SendPacketExt(pak, addr);
+ mir_free(pak.strName);
}
void CMLan::SendPacketExt(TPacket& pak, u_long addr)
@@ -283,9 +282,6 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from)
u_int rip = cont->m_addr.S_un.S_addr;
int tip = (rip << 24) | ((rip & 0xff00) << 8) | ((rip & 0xff0000) >> 8) | (rip >> 24);
db_set_dw(hContact, PROTONAME, "IP", tip);
- // HOSTENT* host = gethostbyaddr((const char*)&rip, sizeof(rip), AF_INET);
- // if (host)
- // db_set_s(hContact, PROTONAME, "UID", host->h_name);
}
}
}
@@ -325,24 +321,22 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from)
}
if (pak.idReqAwayMessage && cont) {
- MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false);
// Removed - it causes that whoisreadingawaymessage plugin was not working
- // if (hContact)
- // {
- // int IcqStatus = 0;
- // switch (m_mirStatus)
- // {
- // case ID_STATUS_AWAY: IcqStatus = ICQ_MSGTYPE_GETAWAYMSG; break;
- // case ID_STATUS_NA: IcqStatus = ICQ_MSGTYPE_GETNAMSG; break;
- // case ID_STATUS_OCCUPIED: IcqStatus = ICQ_MSGTYPE_GETOCCUMSG; break;
- // case ID_STATUS_DND: IcqStatus = ICQ_MSGTYPE_GETDNDMSG; break;
- // case ID_STATUS_FREECHAT: IcqStatus = ICQ_MSGTYPE_GETFFCMSG; break;
- // }
- // // HACK: this is a real hack
- // db_set_dw(hContact, "ICQ", "UIN", 1/*0xffffffff*/);
- // NotifyEventHooks(m_hookIcqMsgReq, IcqStatus, 1/*0xffffffff*/);
- // db_unset(hContact, "ICQ", "UIN");
- // }
+ // MCONTACT hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false);
+ // if (hContact) {
+ // int IcqStatus = 0;
+ // switch (m_mirStatus) {
+ // case ID_STATUS_AWAY: IcqStatus = ICQ_MSGTYPE_GETAWAYMSG; break;
+ // case ID_STATUS_NA: IcqStatus = ICQ_MSGTYPE_GETNAMSG; break;
+ // case ID_STATUS_OCCUPIED: IcqStatus = ICQ_MSGTYPE_GETOCCUMSG; break;
+ // case ID_STATUS_DND: IcqStatus = ICQ_MSGTYPE_GETDNDMSG; break;
+ // case ID_STATUS_FREECHAT: IcqStatus = ICQ_MSGTYPE_GETFFCMSG; break;
+ // }
+ // // HACK: this is a real hack
+ // db_set_dw(hContact, "ICQ", "UIN", 1/*0xffffffff*/);
+ // NotifyEventHooks(m_hookIcqMsgReq, IcqStatus, 1/*0xffffffff*/);
+ // db_unset(hContact, "ICQ", "UIN");
+ // }
mir_cslock lck(m_csAccessAwayMes);
@@ -370,7 +364,12 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from)
void CMLan::RecvMessageUrl(CCSDATA* ccs)
{
PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
- ptrA szMessage(Utf8Encode(pre->szMessage));
+ ptrA szMessage;
+ // input string might be already utf8-encoded
+ if (Utf8CheckString(pre->szMessage))
+ szMessage = mir_strdup(pre->szMessage);
+ else
+ szMessage = Utf8Encode(pre->szMessage);
DBEVENTINFO dbei = {};
if (!mir_strcmp(ccs->szProtoService, PSR_MESSAGE))
@@ -410,31 +409,31 @@ INT_PTR CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT *psr)
int CMLan::SendMessageUrl(CCSDATA* ccs, bool isUrl)
{
int cid = GetRandomProcId();
- size_t len;
+ size_t len = 0;
if (isUrl) {
len = mir_strlen((char*)ccs->lParam);
((char*)ccs->lParam)[len] = 1;
}
- TDataHolder* hold = new TDataHolder(ccs, cid, isUrl ? LEXT_SENDURL : LEXT_SENDMESSAGE, this);
+ TDataHolder *hold = new TDataHolder(ccs, cid, isUrl ? LEXT_SENDURL : LEXT_SENDMESSAGE, this);
if (isUrl) {
((char*)ccs->lParam)[len] = 0;
hold->msg[len] = 0;
}
- mir_forkthread(LaunchExt, (void*)hold);
+ mir_forkthread(LaunchExt, hold);
return cid;
}
int CMLan::Search(const char* name)
{
int cid = GetRandomProcId();
- mir_forkthread(LaunchExt, (void*)new TDataHolder(name, cid, LEXT_SEARCH, this));
+ mir_forkthread(LaunchExt, new TDataHolder(name, cid, LEXT_SEARCH, this));
return cid;
}
int CMLan::GetAwayMsg(CCSDATA* ccs)
{
int cid = GetRandomProcId();
- mir_forkthread(LaunchExt, (void*)new TDataHolder(ccs, cid, LEXT_GETAWAYMSG, this));
+ mir_forkthread(LaunchExt, new TDataHolder(ccs, cid, LEXT_GETAWAYMSG, this));
return cid;
}
@@ -484,10 +483,23 @@ void CMLan::SearchExt(TDataHolder* hold)
psr.ipaddr = cont->m_addr.S_un.S_addr;
psr.stat = cont->m_status;
psr.ver = cont->m_ver;
-
ProtoBroadcastAck(PROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)hold->id, (LPARAM)&psr);
}
}
+
+ // search string might contain some ip address
+ ULONG addr = inet_addr(hold->msg);
+ if (addr != INADDR_NONE) {
+ psr.nick.a = hold->msg;
+ psr.firstName.a = "";
+ psr.lastName.a = "";
+ psr.email.a = hold->msg;
+ psr.ipaddr = addr;
+ psr.stat = ID_STATUS_OFFLINE;
+ psr.ver = 0;
+ ProtoBroadcastAck(PROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)hold->id, (LPARAM)&psr);
+ }
+
ProtoBroadcastAck(PROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)hold->id, 0);
delete hold;
}
@@ -582,7 +594,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen)
if (pak.idStatus)
len += 1 + 1 + 2;
- size_t nameLen;
+ size_t nameLen = 0;
if (pak.strName) {
nameLen = mir_strlen(pak.strName);
len += 1 + 1 + nameLen + 1;
@@ -760,23 +772,17 @@ void CMLan::LoadSettings()
m_RequiredIp = db_get_dw(NULL, PROTONAME, "ipaddr", 0);
m_UseHostName = db_get_b(NULL, PROTONAME, "UseHostName", 1) != 0;
if (m_UseHostName) {
- gethostname(m_name, MAX_HOSTNAME_LEN);
+ m_nameLen = MAX_HOSTNAME_LEN;
+ GetComputerName(m_name, &m_nameLen);
CharLower(m_name);
}
else {
- DBVARIANT dbv;
- // Deleting old 'Name' value - using 'Nick' instead of it now
- if (db_get_s(NULL, PROTONAME, "Nick", &dbv)) {
- if (db_get_s(NULL, PROTONAME, "Name", &dbv))
- dbv.pszVal = "EmLan_User";
- else
- db_unset(NULL, PROTONAME, "Name");
- }
- if (!dbv.pszVal[0])
- dbv.pszVal = "EmLan_User";
- mir_strcpy(m_name, dbv.pszVal);
+ ptrW nick(db_get_wsa(NULL, PROTONAME, "Nick"));
+ if (!nick)
+ nick = mir_wstrdup(L"EmLan_User");
+ mir_wstrcpy(m_name, nick);
}
- m_nameLen = (int)mir_strlen(m_name);
+ m_nameLen = (int)mir_wstrlen(m_name);
if (GetStatus() != LM_LISTEN) {
int ipcount = GetHostAddrCount();
@@ -794,7 +800,7 @@ void CMLan::SaveSettings()
{
db_set_dw(NULL, PROTONAME, "ipaddr", m_RequiredIp);
db_set_b(NULL, PROTONAME, "UseHostName", m_UseHostName);
- db_set_s(NULL, PROTONAME, "Nick", m_name);
+ db_set_ws(NULL, PROTONAME, "Nick", m_name);
}
//////////////////////////////////////////////////////////////////////////
@@ -812,7 +818,7 @@ CMLan::TFileConnection::~TFileConnection()
}
delete[] m_szDescription;
if (m_szFiles) {
- char** cp = m_szFiles;
+ wchar_t** cp = m_szFiles;
while (*cp) {
delete[] * cp;
cp++;
@@ -1029,11 +1035,11 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
char* pf_to = pre.szMessage + 4;
char* pf_fr = (char*)conn->m_buf + 1 + 4 + 4;
- conn->m_szFiles = new char*[rcTotalFiles + 1];
+ conn->m_szFiles = new wchar_t*[rcTotalFiles + 1];
conn->m_szFiles[rcTotalFiles] = nullptr;
for (int i = 0; i < rcTotalFiles; i++) {
- conn->m_szFiles[i] = _strdup(pf_fr);
+ conn->m_szFiles[i] = mir_a2u(pf_fr);
if (i)
*pf_to++ = ' ';
while (*pf_fr)
@@ -1074,12 +1080,12 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
}
// Getting current directory
- char path[MAX_PATH];
- char* pathpart;
+ wchar_t path[MAX_PATH];
+ wchar_t* pathpart;
GetFullPathName(conn->m_szDir, MAX_PATH, path, &pathpart);
if (!SetCurrentDirectory(path)) {
if (rcTotalFiles == 1)
- conn->m_szRenamedFile = _strdup(pathpart);
+ conn->m_szRenamedFile = mir_wstrdup(pathpart);
*pathpart = 0;
if (!SetCurrentDirectory(path)) {
conn->Send(nullptr, 0);
@@ -1094,13 +1100,13 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
PROTOFILETRANSFERSTATUS fts;
fts.cbSize = sizeof(fts);
+ fts.flags = PFTS_UNICODE;
+ fts.hContact = conn->m_hContact;
fts.totalBytes = rcTotalSize;
fts.totalFiles = rcTotalFiles;
fts.totalProgress = 0;
- fts.szWorkingDir = conn->m_szDir;
- fts.flags = false;
- fts.hContact = conn->m_hContact;
- fts.pszFiles = conn->m_szFiles;
+ fts.wszWorkingDir = conn->m_szDir;
+ fts.pwszFiles = conn->m_szFiles;
bool err = false;
@@ -1150,7 +1156,7 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
}
EMLOG("Still processing");
- char* filename = conn->m_szRenamedFile;
+ wchar_t* filename = conn->m_szRenamedFile;
if (!filename)
filename = conn->m_szFiles[fileNo];
@@ -1238,7 +1244,7 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
delete conn;
}
-void CMLan::OnOutTCPConnection(u_long addr, SOCKET out_socket, LPVOID lpParameter)
+void CMLan::OnOutTCPConnection(u_long, SOCKET out_socket, LPVOID lpParameter)
{
EMLOG("Sending OUT TCP connection");
TFileConnection* conn = (TFileConnection*)lpParameter;
@@ -1258,13 +1264,13 @@ void CMLan::OnOutTCPConnection(u_long addr, SOCKET out_socket, LPVOID lpParamete
FileAddToList(conn);
u_char buf[FILE_SEND_BLOCK + 1];
- char name[MAX_PATH + 8];
+ wchar_t name[MAX_PATH + 8];
buf[0] = FCODE_SND_FILEREQ;
int len = 1 + 4 + 4;
int size = 0;
int filecount = 0;
- char** pf = conn->m_szFiles;
+ wchar_t** pf = conn->m_szFiles;
while (*pf) {
// TODO: FIX IT !
EMLOG("Opening file");
@@ -1279,33 +1285,33 @@ void CMLan::OnOutTCPConnection(u_long addr, SOCKET out_socket, LPVOID lpParamete
filecount++;
CloseHandle(hFile);
- char* filepart;
- GetFullPathName(*pf, MAX_PATH, (char*)name, &filepart);
+ wchar_t* filepart;
+ GetFullPathName(*pf, MAX_PATH, name, &filepart);
free(*pf);
- *pf = _strdup(name);
- mir_strcpy((char*)buf + len, filepart);
- len += (int)mir_strlen(filepart) + 1;
+ *pf = mir_wstrdup(name);
+ mir_strcpy((char*)buf + len, _T2A(filepart));
+ len += (int)mir_wstrlen(filepart) + 1;
pf++;
}
- mir_strcpy((char*)buf + len, conn->m_szDescription);
- len += (int)mir_strlen(conn->m_szDescription) + 1;
+ mir_strcpy((char*)buf + len, _T2A(conn->m_szDescription));
+ len += (int)mir_wstrlen(conn->m_szDescription) + 1;
*((int*)(buf + 1)) = size;
*((int*)(buf + 1 + 4)) = filecount;
GetCurrentDirectory(MAX_PATH, name);
- conn->m_szDir = _strdup(name);
+ conn->m_szDir = mir_wstrdup(name);
PROTOFILETRANSFERSTATUS fts;
fts.cbSize = sizeof(fts);
+ fts.flags = PFTS_SENDING | PFTS_UNICODE;
+ fts.hContact = conn->m_hContact;
fts.totalBytes = size;
fts.totalFiles = filecount;
fts.totalProgress = 0;
- fts.szWorkingDir = conn->m_szDir;
- fts.flags = PFTS_SENDING;
- fts.hContact = conn->m_hContact;
- fts.pszFiles = conn->m_szFiles;
+ fts.wszWorkingDir = conn->m_szDir;
+ fts.pwszFiles = conn->m_szFiles;
EMLOG("Sending file size");
if (conn->Send(buf, len)) {
@@ -1388,7 +1394,7 @@ void CMLan::OnOutTCPConnection(u_long addr, SOCKET out_socket, LPVOID lpParamete
EMLOG("Ok");
buf[0] = FCODE_SND_FILEDATA;
- if (readbytes != tosend) {
+ if ((int)readbytes != tosend) {
EMLOG("Error during reading file. File was changed");
CloseHandle(hFile);
conn->Send(nullptr, 0);
@@ -1455,14 +1461,14 @@ int CMLan::SendFile(CCSDATA* ccs)
conn->m_cid = cid;
conn->m_hContact = ccs->hContact;
- conn->m_szDescription = _strdup((char*)ccs->wParam);
+ conn->m_szDescription = mir_wstrdup((wchar_t*)ccs->wParam);
int files = 0;
- char** ppszFiles = (char**)ccs->lParam;
+ wchar_t** ppszFiles = (wchar_t**)ccs->lParam;
while (ppszFiles[files])
files++;
- conn->m_szFiles = new char*[files + 1];
+ conn->m_szFiles = new wchar_t*[files + 1];
for (int i = 0; i < files; i++)
- conn->m_szFiles[i] = _strdup(ppszFiles[i]);
+ conn->m_szFiles[i] = mir_wstrdup(ppszFiles[i]);
conn->m_szFiles[files] = nullptr;
u_long addr = db_get_dw(ccs->hContact, PROTONAME, "ipaddr", 0);
@@ -1485,7 +1491,7 @@ int CMLan::FileAllow(CCSDATA* ccs)
mir_cslock connLck(conn->m_csAccess);
conn->m_state = TFileConnection::FCS_ALLOW;
- conn->m_szDir = _strdup((char*)ccs->lParam);
+ conn->m_szDir = mir_wstrdup((wchar_t*)ccs->lParam);
return cid;
}
@@ -1546,7 +1552,7 @@ int CMLan::FileResume(int cid, PROTOFILERESUME* pfr)
case FILERESUME_RENAME:
conn->m_state = TFileConnection::FCS_RENAME;
delete[] conn->m_szRenamedFile;
- conn->m_szRenamedFile = _strdup((char*)pfr->szFilename);
+ conn->m_szRenamedFile = mir_wstrdup(pfr->szFilename);
break;
case FILERESUME_SKIP:
conn->m_state = TFileConnection::FCS_SKIP;
diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h
index ed151e1212..a314c054cd 100644
--- a/protocols/EmLanProto/src/mlan.h
+++ b/protocols/EmLanProto/src/mlan.h
@@ -62,7 +62,7 @@ public:
void LoadSettings();
void SaveSettings();
- char* GetName() { return m_name; }
+ wchar_t* GetName() { return m_name; }
bool GetUseHostName() { return m_UseHostName; }
void SetUseHostName(bool val) { m_UseHostName = val; }
void SetRequiredIp(u_long ip) { m_RequiredIp = ip; }
@@ -92,8 +92,8 @@ private:
TContact* m_pRootContact;
HANDLE m_hCheckThread;
- char m_name[MAX_HOSTNAME_LEN];
- int m_nameLen;
+ wchar_t m_name[MAX_HOSTNAME_LEN];
+ DWORD m_nameLen;
mir_cs m_csAccessClass;
mir_cs m_csAccessAwayMes;
@@ -174,10 +174,10 @@ private:
u_long m_addr;
MCONTACT m_hContact;
- char* m_szDescription;
- char** m_szFiles;
- char* m_szDir;
- char* m_szRenamedFile;
+ wchar_t* m_szDescription;
+ wchar_t** m_szFiles;
+ wchar_t* m_szDir;
+ wchar_t* m_szRenamedFile;
u_char* m_buf;
int m_recSize;
diff --git a/protocols/EmLanProto/src/stdafx.cpp b/protocols/EmLanProto/src/stdafx.cxx
index fc3e963191..e8691edb87 100644
--- a/protocols/EmLanProto/src/stdafx.cpp
+++ b/protocols/EmLanProto/src/stdafx.cxx
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// amdproto.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// amdproto.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h
index d826592439..8fefd8f2f8 100644
--- a/protocols/EmLanProto/src/stdafx.h
+++ b/protocols/EmLanProto/src/stdafx.h
@@ -5,7 +5,6 @@
#pragma once
-#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
diff --git a/protocols/EmLanProto/src/version.h b/protocols/EmLanProto/src/version.h
index 95d22389ca..4a9cf125ce 100644
--- a/protocols/EmLanProto/src/version.h
+++ b/protocols/EmLanProto/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
#define __FILEVERSION_DWORD PLUGIN_MAKE_VERSION(__MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM)
diff --git a/src/mir_core/src/utf.cpp b/src/mir_core/src/utf.cpp
index b6151a40d9..f159586cc0 100644
--- a/src/mir_core/src/utf.cpp
+++ b/src/mir_core/src/utf.cpp
@@ -392,7 +392,7 @@ MIR_CORE_DLL(char*) Utf8EncodeW(const wchar_t* src)
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Utf8Encode - converts UCS2 string to the UTF8-encoded format
+// Utf8CheckString - checks if a string is a valid utf8-encoded string
MIR_CORE_DLL(BOOL) Utf8CheckString(const char *str)
{