From f251f8ffa34a0b9699aff9ca3ed03fec8f2d2e51 Mon Sep 17 00:00:00 2001 From: watcherhd Date: Sun, 1 Jan 2012 20:39:34 +0000 Subject: SecureIM: x64 fixes git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@253 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- SecureIM/SecureIM_10.sln | 10 +++ SecureIM/commonheaders.cpp | 2 +- SecureIM/crypt_dll.cpp | 12 ++-- SecureIM/crypt_lists.cpp | 4 +- SecureIM/dbevent.cpp | 2 +- SecureIM/main.cpp | 2 +- SecureIM/mmi.cpp | 12 ++-- SecureIM/options.cpp | 4 +- SecureIM/popupOptions.cpp | 2 +- SecureIM/popupOptions.h | 2 +- SecureIM/secureim_10.vcxproj | 128 +++++++++++++++++++++++++++++++++++++ SecureIM/secureim_icons_10.vcxproj | 74 +++++++++++++++++++++ SecureIM/splitmsg.cpp | 8 +-- SecureIM/svcs_proto.cpp | 6 +- SecureIM/svcs_rsa.cpp | 2 +- 15 files changed, 241 insertions(+), 29 deletions(-) diff --git a/SecureIM/SecureIM_10.sln b/SecureIM/SecureIM_10.sln index 02a28a9..a4c58c7 100644 --- a/SecureIM/SecureIM_10.sln +++ b/SecureIM/SecureIM_10.sln @@ -7,17 +7,27 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Debug|Win32.ActiveCfg = Debug|Win32 {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Debug|Win32.Build.0 = Debug|Win32 + {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Debug|x64.ActiveCfg = Debug|x64 + {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Debug|x64.Build.0 = Debug|x64 {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Release|Win32.ActiveCfg = Release|Win32 {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Release|Win32.Build.0 = Release|Win32 + {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Release|x64.ActiveCfg = Release|x64 + {4ADADECA-99D7-410D-8127-CB27210DCC6A}.Release|x64.Build.0 = Release|x64 {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Debug|Win32.ActiveCfg = Debug|Win32 {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Debug|Win32.Build.0 = Debug|Win32 + {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Debug|x64.ActiveCfg = Debug|x64 + {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Debug|x64.Build.0 = Debug|x64 {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Release|Win32.ActiveCfg = Release|Win32 {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Release|Win32.Build.0 = Release|Win32 + {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Release|x64.ActiveCfg = Release|x64 + {3FAB6AC7-6B7F-4779-B519-34E8035074A4}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SecureIM/commonheaders.cpp b/SecureIM/commonheaders.cpp index e3b51a0..11ff4af 100644 --- a/SecureIM/commonheaders.cpp +++ b/SecureIM/commonheaders.cpp @@ -64,7 +64,7 @@ LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSet int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSetting,const char *val) { - int len = strlen(val)+64; + int len = (int)strlen(val)+64; char *buf = (LPSTR)alloca(len); strncpy(buf,val,len); CallService(MS_DB_CRYPT_ENCODESTRING,(WPARAM)len,(LPARAM)buf); diff --git a/SecureIM/crypt_dll.cpp b/SecureIM/crypt_dll.cpp index 713374e..7418f3c 100644 --- a/SecureIM/crypt_dll.cpp +++ b/SecureIM/crypt_dll.cpp @@ -30,8 +30,8 @@ LPSTR InitKeyA(pUinKey ptr,int features) { else keysig = (LPSTR)SIG_KEY3; - int slen = strlen(keysig); - int tlen = strlen(pub_text); + int slen = (int)strlen(keysig); + int tlen = (int)strlen(pub_text); LPSTR keyToSend = (LPSTR) mir_alloc(slen+tlen+1); @@ -119,8 +119,8 @@ LPSTR encrypt(pUinKey ptr, LPCSTR szEncMsg) { LPSTR szSig = (LPSTR) (ptr->offlineKey?SIG_ENOF:SIG_ENON); - int slen = strlen(szSig); - int clen = strlen(szEncMsg); + int slen = (int)strlen(szSig); + int clen = (int)strlen(szEncMsg); LPSTR szMsg = (LPSTR) mir_alloc(clen+slen+1); memcpy(szMsg, szSig, slen); @@ -182,12 +182,12 @@ LPSTR decodeMsg(pUinKey ptr, LPARAM lParam, LPSTR szEncMsg) { else { ptr->decoded=true; if( ppre->flags & PREF_UTF ) { // если протокол поддерживает utf8 - тогда отправляем в utf8 - int olen = strlen(szOldMsg)+1; + int olen = (int)strlen(szOldMsg)+1; szNewMsg = (LPSTR) mir_alloc(olen); memcpy(szNewMsg,szOldMsg,olen); } else { - int olen = (strlen(szOldMsg)+1)*(sizeof(WCHAR)+1); + int olen = ((int)strlen(szOldMsg)+1)*(sizeof(WCHAR)+1); szNewMsg = (LPSTR) mir_alloc(olen); memcpy(szNewMsg,szOldMsg,olen); ppre->flags |= PREF_UNICODE; diff --git a/SecureIM/crypt_lists.cpp b/SecureIM/crypt_lists.cpp index 3387eb7..48fbad1 100644 --- a/SecureIM/crypt_lists.cpp +++ b/SecureIM/crypt_lists.cpp @@ -261,8 +261,8 @@ void addMsg2Queue(pUinKey ptr,WPARAM wParam,LPSTR szMsg) { ptrMessage->nextMessage = NULL; if(wParam & PREF_UNICODE) { - int slen = strlen(szMsg)+1; - int wlen = wcslen((wchar_t *)(szMsg+slen))+1; + int slen = (int)strlen(szMsg)+1; + int wlen = (int)wcslen((wchar_t *)(szMsg+slen))+1; ptrMessage->Message = (LPSTR) mir_alloc(slen+wlen*sizeof(WCHAR)); memcpy(ptrMessage->Message,szMsg,slen+wlen*sizeof(WCHAR)); } diff --git a/SecureIM/dbevent.cpp b/SecureIM/dbevent.cpp index 1f6dff1..9b7d8f1 100644 --- a/SecureIM/dbevent.cpp +++ b/SecureIM/dbevent.cpp @@ -11,7 +11,7 @@ void HistoryLog(HANDLE hContact, LPCSTR szText) { dbei.flags = DBEF_SENT|DBEF_READ; dbei.timestamp = time(NULL); dbei.eventType = EVENTTYPE_MESSAGE; - dbei.cbBlob = strlen(szText) + 1; + dbei.cbBlob = (int)strlen(szText) + 1; dbei.pBlob = (PBYTE)szText; CallService(MS_DB_EVENT_ADD, (WPARAM)0, (LPARAM)&dbei); diff --git a/SecureIM/main.cpp b/SecureIM/main.cpp index b1f71e0..7e29f0d 100644 --- a/SecureIM/main.cpp +++ b/SecureIM/main.cpp @@ -91,7 +91,7 @@ int __cdecl Load(PLUGINLINK *link) { char temp[MAX_PATH]; GetTempPath(sizeof(temp),temp); GetLongPathName(temp,TEMP,sizeof(TEMP)); - TEMP_SIZE = strlen(TEMP); + TEMP_SIZE = (int)strlen(TEMP); if(TEMP[TEMP_SIZE-1]=='\\') { TEMP_SIZE--; TEMP[TEMP_SIZE]='\0'; diff --git a/SecureIM/mmi.cpp b/SecureIM/mmi.cpp index c84384e..1719556 100644 --- a/SecureIM/mmi.cpp +++ b/SecureIM/mmi.cpp @@ -23,8 +23,8 @@ void operator delete[](void * p) { // ANSIzUCS2z + ANSIzUCS2z = ANSIzUCS2z char *m_wwstrcat(LPCSTR strA, LPCSTR strB) { - int lenA = strlen(strA); - int lenB = strlen(strB); + int lenA = (int)strlen(strA); + int lenB = (int)strlen(strB); LPSTR str = (LPSTR)mir_alloc((lenA+lenB+1)*(sizeof(WCHAR)+1)); memcpy(str, strA, lenA); memcpy(str+lenA, strB, lenB+1); @@ -36,7 +36,7 @@ char *m_wwstrcat(LPCSTR strA, LPCSTR strB) { // ANSIz + ANSIzUCS2z = ANSIzUCS2z char *m_awstrcat(LPCSTR strA, LPCSTR strB) { - int lenA = strlen(strA); + int lenA = (int)strlen(strA); LPSTR tmpA = (LPSTR)mir_alloc((lenA+1)*(sizeof(WCHAR)+1)); strcpy(tmpA, strA); MultiByteToWideChar(CP_ACP, 0, strA, -1, (LPWSTR)(tmpA+lenA+1), (lenA+1)*sizeof(WCHAR)); @@ -48,8 +48,8 @@ char *m_awstrcat(LPCSTR strA, LPCSTR strB) { // ANSIz + ANSIz = ANSIzUCS2z char *m_aastrcat(LPCSTR strA, LPCSTR strB) { - int lenA = strlen(strA); - int lenB = strlen(strB); + int lenA = (int)strlen(strA); + int lenB = (int)strlen(strB); LPSTR str = (LPSTR)mir_alloc((lenA+lenB+1)*(sizeof(WCHAR)+1)); strcpy(str,strA); strcat(str,strB); @@ -114,7 +114,7 @@ LPSTR utf8_to_miranda(LPCSTR szUtfMsg, DWORD& flags) { LPSTR szMsg = mir_u2a(wszMsg); if( bCoreUnicode ) { flags |= PREF_UNICODE; - int olen = wcslen((LPWSTR)wszMsg)+1; + int olen = (int)wcslen((LPWSTR)wszMsg)+1; int nlen = olen*(sizeof(WCHAR)+1); szNewMsg = (LPSTR) mir_alloc(nlen); memcpy(szNewMsg,szMsg,olen); diff --git a/SecureIM/options.cpp b/SecureIM/options.cpp index e2ba837..17123e1 100644 --- a/SecureIM/options.cpp +++ b/SecureIM/options.cpp @@ -1847,11 +1847,11 @@ LPSTR LoadKeys(LPCSTR file,BOOL priv) { } else if(b && strncmp(keys+i,end,strlen(end))==0) { - i+=strlen(keys+i); + i+=(int)strlen(keys+i); b=false; } if(b) { - i+=strlen(keys+i); + i+=(int)strlen(keys+i); } } *(keys+i)='\0'; diff --git a/SecureIM/popupOptions.cpp b/SecureIM/popupOptions.cpp index 892d265..03776ea 100644 --- a/SecureIM/popupOptions.cpp +++ b/SecureIM/popupOptions.cpp @@ -1,7 +1,7 @@ #include "commonheaders.h" -BOOL CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char getTimeout[5]; diff --git a/SecureIM/popupOptions.h b/SecureIM/popupOptions.h index c596136..22d3453 100644 --- a/SecureIM/popupOptions.h +++ b/SecureIM/popupOptions.h @@ -1,7 +1,7 @@ #ifndef __POPUP_OPTIONS__ #define __POPUP_OPTIONS__ -BOOL CALLBACK PopOptionsDlgProc(HWND,UINT,WPARAM,LPARAM); +INT_PTR CALLBACK PopOptionsDlgProc(HWND,UINT,WPARAM,LPARAM); void RefreshPopupOptionsDlg(HWND,HWND,HWND,HWND,HWND,HWND); int onRegisterPopOptions(WPARAM,LPARAM); diff --git a/SecureIM/secureim_10.vcxproj b/SecureIM/secureim_10.vcxproj index 793ec4b..617b400 100644 --- a/SecureIM/secureim_10.vcxproj +++ b/SecureIM/secureim_10.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + secureim @@ -22,29 +30,53 @@ false true + + DynamicLibrary + false + MultiByte + false + true + DynamicLibrary false MultiByte false + + DynamicLibrary + false + MultiByte + false + + + + + + + <_ProjectFileVersion>10.0.40219.1 $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)\$(Configuration) $(Platform)/Plugins\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)\$(Configuration) $(Platform)/Obj/$(ProjectName)\ true + true $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)\$(Configuration) $(Platform)/Plugins\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)\$(Configuration) $(Platform)/Obj/$(ProjectName)\ @@ -85,6 +117,43 @@ $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebug + true + Create + commonheaders.h + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0419 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + true + true + true + Windows + 0x45000000 + false + $(IntDir)$(TargetName).lib + + NDEBUG;%(PreprocessorDefinitions) @@ -125,6 +194,44 @@ $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + + + Full + Size + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + Use + commonheaders.h + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0419 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + true + Windows + 0x45000000 + false + $(IntDir)$(TargetName).lib + + @@ -155,6 +262,7 @@ Create + Create @@ -171,31 +279,51 @@ Disabled + Disabled %(PreprocessorDefinitions) + %(PreprocessorDefinitions) EnableFastChecks + EnableFastChecks MinSpace + MinSpace %(PreprocessorDefinitions) + %(PreprocessorDefinitions) Disabled + Disabled %(PreprocessorDefinitions) + %(PreprocessorDefinitions) EnableFastChecks + EnableFastChecks MinSpace + MinSpace %(PreprocessorDefinitions) + %(PreprocessorDefinitions) Disabled + Disabled %(PreprocessorDefinitions) + %(PreprocessorDefinitions) EnableFastChecks + EnableFastChecks MinSpace + MinSpace %(PreprocessorDefinitions) + %(PreprocessorDefinitions) Disabled + Disabled %(PreprocessorDefinitions) + %(PreprocessorDefinitions) EnableFastChecks + EnableFastChecks MinSpace + MinSpace %(PreprocessorDefinitions) + %(PreprocessorDefinitions) diff --git a/SecureIM/secureim_icons_10.vcxproj b/SecureIM/secureim_icons_10.vcxproj index a5030a5..5e16518 100644 --- a/SecureIM/secureim_icons_10.vcxproj +++ b/SecureIM/secureim_icons_10.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + secureim_icons @@ -20,27 +28,47 @@ false MultiByte + + DynamicLibrary + false + MultiByte + DynamicLibrary false MultiByte + + DynamicLibrary + false + MultiByte + + + + + + + <_ProjectFileVersion>10.0.40219.1 $(SolutionDir)$(Configuration)/Icons\ + $(SolutionDir)\$(Configuration) $(Platform)/Icons\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)\$(Configuration) $(Platform)/Obj/$(ProjectName)\ $(SolutionDir)$(Configuration)/Icons\ + $(SolutionDir)\$(Configuration) $(Platform)/Icons\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)\$(Configuration) $(Platform)/Obj/$(ProjectName)\ @@ -67,6 +95,29 @@ MachineX86 + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0419 + + + %(AdditionalDependencies) + true + true + true + true + false + + + + NDEBUG;%(PreprocessorDefinitions) @@ -92,6 +143,29 @@ MachineX86 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + + + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0419 + + + true + false + + + + diff --git a/SecureIM/splitmsg.cpp b/SecureIM/splitmsg.cpp index 6389e92..45c2da1 100644 --- a/SecureIM/splitmsg.cpp +++ b/SecureIM/splitmsg.cpp @@ -7,7 +7,7 @@ LPSTR splitMsg(LPSTR szMsg, int iLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("split: msg: -----\n%s\n-----\n",szMsg); #endif - int len = strlen(szMsg); + int len = (int)strlen(szMsg); LPSTR out = (LPSTR) mir_alloc(len*2); LPSTR buf = out; @@ -69,7 +69,7 @@ LPSTR combineMessage(pUinKey ptr, LPSTR szMsg) { int len=0,i; for( i=0; imessage[i]==NULL) break; - len+=strlen(pm->message[i]); + len+=(int)strlen(pm->message[i]); } if( i==part_all ) { // combine message SAFE_FREE(ptr->tmp); @@ -100,13 +100,13 @@ LPSTR combineMessage(pUinKey ptr, LPSTR szMsg) { int splitMessageSend(pUinKey ptr, LPSTR szMsg) { int ret; - int len = strlen(szMsg); + int len = (int)strlen(szMsg); int par = (getContactStatus(ptr->hContact)==ID_STATUS_OFFLINE)?ptr->proto->split_off:ptr->proto->split_on; if( par && len>par ) { LPSTR msg = splitMsg(szMsg,par); LPSTR buf = msg; while( *buf ) { - len = strlen(buf); + len = (int)strlen(buf); LPSTR tmp = mir_strdup(buf); ret = CallContactService(ptr->hContact,PSS_MESSAGE,(WPARAM)PREF_METANODB,(LPARAM)tmp); mir_free(tmp); diff --git a/SecureIM/svcs_proto.cpp b/SecureIM/svcs_proto.cpp index 9b49423..b1f6910 100644 --- a/SecureIM/svcs_proto.cpp +++ b/SecureIM/svcs_proto.cpp @@ -58,13 +58,13 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { // cut rtf tags if( pRtfconvString && memcmp(szEncMsg,"{\\rtf1",6)==0 ) { SAFE_FREE(szUnrtfMsg); - int len = strlen(szEncMsg)+1; + int len = (int)strlen(szEncMsg)+1; LPWSTR szTemp = (LPWSTR)mir_alloc(len*sizeof(WCHAR)); if(ppre->flags & PREF_UNICODE) rtfconvW((LPWSTR)(szEncMsg+len),szTemp); else rtfconvA(szEncMsg,szTemp); - len = wcslen(szTemp)-1; + len = (int)wcslen(szTemp)-1; while(len) { if( szTemp[len] == 0x0D || szTemp[len] == 0x0A ) szTemp[len] = 0; @@ -72,7 +72,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) { break; len--; } - len = wcslen(&szTemp[1])+1; + len = (int)wcslen(&szTemp[1])+1; szUnrtfMsg = (LPSTR)mir_alloc(len*(sizeof(WCHAR)+1)); WideCharToMultiByte(CP_ACP, 0, &szTemp[1], -1, szUnrtfMsg, len*(sizeof(WCHAR)+1), NULL, NULL); memcpy(szUnrtfMsg+len,&szTemp[1],len*sizeof(WCHAR)); diff --git a/SecureIM/svcs_rsa.cpp b/SecureIM/svcs_rsa.cpp index 73fbb38..d38de67 100644 --- a/SecureIM/svcs_rsa.cpp +++ b/SecureIM/svcs_rsa.cpp @@ -16,7 +16,7 @@ int __cdecl rsa_inject(HANDLE context, LPCSTR msg) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_inject: '%s'", msg); #endif - int len = strlen(msg)+1; + int len = (int)strlen(msg)+1; LPSTR buf = (LPSTR) mir_alloc(LEN_SECU+len); memcpy(buf,SIG_SECU,LEN_SECU); memcpy(buf+LEN_SECU,msg,len); -- cgit v1.2.3