summaryrefslogtreecommitdiff
path: root/MirOTR
diff options
context:
space:
mode:
Diffstat (limited to 'MirOTR')
-rw-r--r--MirOTR/MirOTR.vcxproj48
-rw-r--r--MirOTR/svcs_proto.cpp61
2 files changed, 63 insertions, 46 deletions
diff --git a/MirOTR/MirOTR.vcxproj b/MirOTR/MirOTR.vcxproj
index 363782b..8833f62 100644
--- a/MirOTR/MirOTR.vcxproj
+++ b/MirOTR/MirOTR.vcxproj
@@ -36,7 +36,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
@@ -60,17 +61,16 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\obj\$(Configuration)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\obj\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\obj\$(Configuration)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\obj\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -85,6 +85,7 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Users\CHEF-KOCH\Desktop\x64\mirotr\miranda\include;$(IncludePath)</IncludePath>
+ <ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pch%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)%3b$(TargetDir)$(ProjectName).*%3b$(TargetDir)$(RootNamespace).*;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -93,33 +94,40 @@
<AdditionalIncludeDirectories>$(SolutionDir)\miranda\include;$(SolutionDir)\libotr-3.2.0\src;$(SolutionDir)\libgcrypt-1.4.6\src;$(SolutionDir)\libgpg-error-1.9\src;$(SolutionDir)\ekhtml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MIROTR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
- <ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
- <AdditionalDependencies>libgcrypt.lib;libotr.lib;Comctl32.lib;EkHtml.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\gpg.vs\bin.vs\libgcrypt\$(Platform)\debug\static;$(SolutionDir)\otr.vs\bin.vs\libotr\$(Platform)\debug\static;$(SolutionDir)\ekhtml\vc9\$(Platform)\debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\gpg.vs\bin.vs\libgcrypt\$(Platform)\Debug\static;$(SolutionDir)\otr.vs\bin.vs\libotr\$(Platform)\Debug\static;$(SolutionDir)\ekhtml\vc9\$(Platform)\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>libgcrypt.lib;libotr.lib;Comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_MBCS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalOptions>/D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NON_CONFORMING_SWPRINTFS" %(AdditionalOptions)</AdditionalOptions>
- <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)\miranda\include;$(SolutionDir)\libotr-3.2.0\src;$(SolutionDir)\libgcrypt-1.4.6\src;$(SolutionDir)\libgpg-error-1.9\src;$(SolutionDir)\ekhtml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MIROTR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>libgcrypt.lib;libotr.lib;Comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -132,7 +140,7 @@
<ClCompile>
<AdditionalOptions>/D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NON_CONFORMING_SWPRINTFS" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>$(SolutionDir)\miranda\include;$(SolutionDir)\libotr-3.2.0\src;$(SolutionDir)\libgcrypt-1.4.6\src;$(SolutionDir)\libgpg-error-1.9\src;$(SolutionDir)\ekhtml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -145,18 +153,19 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<StringPooling>true</StringPooling>
<FloatingPointModel>Fast</FloatingPointModel>
- <MultiProcessorCompilation>true</MultiProcessorCompilation>
- <OmitFramePointers>true</OmitFramePointers>
+ <OmitFramePointers>false</OmitFramePointers>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<Link>
<AdditionalDependencies>libgcrypt.lib;libotr.lib;Comctl32.lib;EkHtml.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\gpg.vs\bin.vs\libgcrypt\$(Platform)\release\static;$(SolutionDir)\otr.vs\bin.vs\libotr\$(Platform)\release\static;$(SolutionDir)\ekhtml\vc9\$(Platform)\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\gpg.vs\bin.vs\libgcrypt\$(Platform)\release\static;$(SolutionDir)\otr.vs\bin.vs\libotr\$(Platform)\release\static;$(SolutionDir)\ekhtml\vc9\$(Platform)\Release Unicode\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
- <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ImportLibrary>
+ </ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -174,6 +183,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>libgcrypt.lib;libotr.lib;Comctl32.lib;EkHtml.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -182,6 +192,8 @@
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <IgnoreSpecificDefaultLibraries>
+ </IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/MirOTR/svcs_proto.cpp b/MirOTR/svcs_proto.cpp
index d1991fb..c4b193c 100644
--- a/MirOTR/svcs_proto.cpp
+++ b/MirOTR/svcs_proto.cpp
@@ -2,6 +2,10 @@
#include "svcs_proto.h"
#include "striphtml.h"
#include "entities.h"
+#include <winuser.h>
+#include <sys\stat.h>
+#include <ole.h>
+#include <wtypes.h>
//TODO: Social-Millionaire-Dialoge
INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
@@ -16,7 +20,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) // bypass for metacontacts
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
if(!proto || !ccs->hContact) return 1; // error
gcry_error_t err;
@@ -67,7 +71,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
/* Be *sure* not to send out plaintext */
ShowError(TranslateT(LANG_ENCRYPTION_ERROR));
/* should not be needed
- char t[3] = {0, 0, 0};
+ char t[3] = {0, 0, 0};
if(ccs->wParam & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
if (strlen(oldmessage)) memcpy(oldmessage, t,3 );
} else {
@@ -87,7 +91,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
// move the last fragment to newmessage, oldmessage_utf will be buffer later
newmessage = oldmessage_utf;
- WPARAM oldflags = ccs->wParam;
+ WPARAM oldflags = ccs->wParam;
if(ccs->wParam & PREF_UTF) {
ccs->lParam = (LPARAM)newmessage;
} else if(ccs->wParam & PREF_UNICODE) {
@@ -102,22 +106,23 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
ccs->lParam = (LPARAM)newmessage;
}
if (otr_context_get_trust(context) >= TRUST_UNVERIFIED) ccs->wParam;
- INT_PTR ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ INT_PTR ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
-/*#ifdef _DEBUG
+#ifdef _DEBUG
if(ccs->wParam & PREF_UNICODE)
- MessageBox(0, (wchar_t *)ccs->lParam, _T("OTR - sending raw message"), MB_OK);
+ MessageBox(0, (const char *)ccs->lParam, _T("OTR - sending raw message"), MB_OK);
else
- MessageBoxA(0, (char *)ccs->lParam, ("OTR - sending raw message"), MB_OK);
- #endif*/
+ MessageBoxA(0, (char *)ccs->lParam, ("OTR - sending raw message"), MB_OK);
+ #endif
// reset to original values
+
ccs->lParam = (LPARAM)oldmessage;
ccs->wParam = oldflags;
otrl_message_free(newmessage);
- return ret;
-
- }
+ return ret;
+
+ }
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
@@ -144,7 +149,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
#ifdef _DEBUG
if(pre->flags & PREF_UNICODE)
- MessageBox(0, (wchar_t *)pre->szMessage, _T("OTR - receiving message"), MB_OK);
+ MessageBox(0, (const char *)pre->szMessage, _T("OTR - receiving message"), MB_OK);
else
MessageBoxA(0, (char *)pre->szMessage, ("OTR - receiving message"), MB_OK);
#endif
@@ -195,7 +200,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED);
if (tlv) {
- /* Notify the user that the other side disconnected. */
+ /* Notify the user that the other side disconnected. */
TCHAR buff[256];
mir_sntprintf(buff, 256, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
@@ -279,7 +284,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
if (nextMsg != OTRL_SMP_EXPECT4)
otr_abort_smp(context);
else {
- SMPDialogUpdate(context, 100);
+ SMPDialogUpdate(context, 100);
//otrg_dialog_update_smp(context, 1.0);
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
}
@@ -287,7 +292,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP_ABORT);
if (tlv) {
SMPDialogUpdate(context, 0);
- context->smstate->nextExpected = OTRL_SMP_EXPECT1;
+ context->smstate->nextExpected = OTRL_SMP_EXPECT1;
}
}
}
@@ -295,23 +300,23 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
/* If we're supposed to ignore this incoming message (because it's a
* protocol message), set it to NULL, so that other plugins that
- * catch receiving-im-msg don't return 0, and cause it to be
+ * catch receiving-im-msg don't return 0, and cause it to be
* displayed anyway. */
if (ignore_msg) {
/* should not be required ;)
- char t[3] = {0, 0, 0};
- char t[3] = {0, 0, 0};
+ char t[3] = {0, 0, 0};
+ char t[3] = {0, 0, 0};
if(pre->flags & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
if (pre->szMessage && strlen(pre->szMessage)) memcpy(pre->szMessage, t,3 );
} else {
if (pre->szMessage && strlen(pre->szMessage)) memcpy(pre->szMessage, t, 1);
- }
- */
+ }
+ */
if (newmessage) otrl_message_free(newmessage);
return 1;
} else if (newmessage) {
//bool free=false;
- DWORD flags = pre->flags;
+ DWORD flags = pre->flags;
/* if(pre->flags & PREF_UTF) {
oldmessage_utf = newmessage;
} else if(pre->flags & PREF_UNICODE) { //TODO!! lstrlen(pre->szMessage)+1 ??
@@ -320,8 +325,8 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
} else {
mir_utf8decode(newmessage, NULL);
oldmessage_utf = newmessage;
- } */
-
+ } */
+
//pre->szMessage = oldmessage_utf;
pre->flags &= ~PREF_UNICODE;
pre->flags |= PREF_UTF; // just use UTF, so we do not have to recode the message
@@ -360,7 +365,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
otrl_message_free(newmessage);
// if (free) mir_free(oldmessage_utf);
- return ret;
+ return ret;
}
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
@@ -370,7 +375,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
* are received. */
void otr_abort_smp(ConnContext *context)
{
- otrl_message_abort_smp(otr_user_state, &ops, context->app_data, context);
+ otrl_message_abort_smp(otr_user_state, &ops, context->app_data, context);
}
/* Start the Socialist Millionaires' Protocol over the current connection,
@@ -379,8 +384,8 @@ void otr_abort_smp(ConnContext *context)
void otr_start_smp(ConnContext *context, const char *question,
const unsigned char *secret, size_t secretlen)
{
- otrl_message_initiate_smp_q(otr_user_state, &ops, context->app_data,
- context, question, secret, secretlen);
+ otrl_message_initiate_smp_q(otr_user_state, &ops, context->app_data,
+ context, question, secret, secretlen);
}
/* Continue the Socialist Millionaires' Protocol over the current connection,
@@ -389,5 +394,5 @@ void otr_continue_smp(ConnContext *context,
const unsigned char *secret, size_t secretlen)
{
otrl_message_respond_smp(otr_user_state, &ops, context->app_data,
- context, secret, secretlen);
+ context, secret, secretlen);
} \ No newline at end of file