From a3e4731995ea87775764f644499c709344c75fef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 22 May 2012 15:33:45 +0000 Subject: source code refreshment git-svn-id: http://svn.miranda-ng.org/main/trunk@130 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/Mra.cpp | 14 +- protocols/MRA/Mra.h | 381 ++++++++++++++++++++------------------ protocols/MRA/MraAvatars.cpp | 2 +- protocols/MRA/MraIcons.cpp | 14 +- protocols/MRA/Mra_svcs.cpp | 6 +- protocols/MRA/Sdk/SystemHeaders.h | 65 +++++++ 6 files changed, 282 insertions(+), 200 deletions(-) create mode 100644 protocols/MRA/Sdk/SystemHeaders.h diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp index 3d8cea3744..69a8a6574a 100644 --- a/protocols/MRA/Mra.cpp +++ b/protocols/MRA/Mra.cpp @@ -409,7 +409,7 @@ PLUGININFOEX pluginInfoEx={ sizeof(PLUGININFOEX), PROTOCOL_DISPLAY_NAME_ORIGA, PLUGIN_VERSION_DWORD, - "Provides support for Mail.ru agent Instant Messenger protocol.", + "Provides support for Mail.ru agent Instant Messenger protocol ("__DATE__" "__TIME__")", "Rozhuk Ivan", "Rozhuk_I@mail.ru", "© 2006-2011 Rozhuk Ivan", @@ -436,7 +436,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD dwReason,LPVOID Reserved) { switch(dwReason){ case DLL_PROCESS_ATTACH: - memset(&masMraSettings, 0, sizeof(masMraSettings)); + bzero(&masMraSettings,sizeof(masMraSettings)); masMraSettings.hInstance=hInstance; masMraSettings.hHeap=HeapCreate(0,0,0);//GetProcessHeap(); masMraSettings.bLoggedIn=FALSE; @@ -504,23 +504,23 @@ return(TRUE); } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" MRA_API PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { if (mirandaVersion -#include -#include -#include -#include -#include -#include -#include +#include "resource.h" +#include ".\xstatus_MRA\resource.h" +#include +#include #include +#include +//#include #include #include +#include #include #include +#include + +#define bzero(pvDst,count) memset(pvDst,0,count) +#include + +#include "../../plugins/zlib/zlib.h" + +//int ZEXPORT uncompress(unsigned char*dest,uLongf *destLen,const Bytef *source,uLong sourceLen); +typedef int (*PUNCOMPRESS)(unsigned char*,DWORD*,unsigned char*,DWORD); +//int ZEXPORT compress2(Bytef *dest,uLongf *destLen,const Bytef *source,uLong sourceLen,int level); +typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int); + +#define MIRANDA_VER 0x0A00 -// miranda API +// http://miranda.svn.sourceforge.net/viewvc/miranda/trunk/miranda/include/?sortby=file #include #include #include @@ -65,11 +73,7 @@ #include #include -//sdk -#include -#include "zlib.h" -#include -#include + #include #include #include @@ -85,21 +89,6 @@ #include #include -#include "resource.h" -#include ".\xstatus_MRA\resource.h" -#include "proto.h" -#include "MraSendQueue.h" -#include "MraFilesQueue.h" -#include "MraPopUp.h" -#include "MraAvatars.h" -#include "MraIcons.h" -#include "MraSelectEMail.h" -#include "MraAntiSpam.h" -#include "MraMPop.h" -#include "MraChat.h" - -typedef int (*PUNCOMPRESS)(unsigned char*,DWORD*,unsigned char*,DWORD); -typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int); // LPS typedef struct @@ -112,12 +101,15 @@ typedef struct }; } MRA_LPS; + // GUID typedef struct { DWORD id[4]; } MRA_GUID; + + struct MRA_ADDR_LIST_ITEM { DWORD dwPort; @@ -130,6 +122,7 @@ struct MRA_ADDR_LIST MRA_ADDR_LIST_ITEM *pmaliAddress; }; + // структура содержащая информацию по построению меню или расширеных иконок struct GUI_DISPLAY_ITEM { @@ -139,6 +132,7 @@ struct GUI_DISPLAY_ITEM MIRANDASERVICE lpFunc; // функция вызываемая меню }; + // структура содержащая информацию о сервисах/функциях struct SERVICE_ITEM { @@ -146,9 +140,34 @@ struct SERVICE_ITEM MIRANDASERVICE lpFunc; // функция вызываемая }; + + + +#include "proto.h" #include "MraConstans.h" #include "MraSendCommand.h" #include "MraMRIMProxy.h" +#include "MraSendQueue.h" +#include "MraFilesQueue.h" +#include "MraPopUp.h" +#include "MraAvatars.h" +#include "MraIcons.h" +#include "MraSelectEMail.h" +#include "MraAntiSpam.h" +#include "MraMPop.h" +#include "MraChat.h" + + + +#ifdef MRA_EXPORTS + #define MRA_API __declspec(dllexport) +#else + #define MRA_API + // __declspec(dllimport) + #pragma comment(lib,"MRALib.lib") +#endif + + @@ -161,80 +180,80 @@ struct SERVICE_ITEM typedef struct { - HANDLE hHeap; - HINSTANCE hInstance; - HMODULE hDLLZLib; - HANDLE lpfnCompress2; - HANDLE lpfnUncompress; - HMODULE hDLLXStatusIcons; - char szModuleName[MAXMODULELABELLENGTH]; - WCHAR wszModuleName[MAXMODULELABELLENGTH]; - SIZE_T dwModuleNameLen; - char szDisplayModuleName[MAX_PATH]; - WCHAR wszDisplayModuleName[MAX_PATH]; - SIZE_T dwDisplayModuleNameLen; - - DWORD dwGlobalPluginRunning;// - BOOL bLoggedIn; - BOOL bChatExist; - DWORD dwStatusMode; - DWORD dwXStatusMode; - DWORD dwDesiredStatusMode; - - HWND hWndEMailPopupStatus; - DWORD dwEmailMessagesTotal; - DWORD dwEmailMessagesUnRead; - - BOOL bHideXStatusUI; - HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4]; - HANDLE hXStatusAdvancedStatusIcons[MRA_XSTATUS_COUNT+4]; - HANDLE hXStatusAdvancedStatusItems[MRA_XSTATUS_COUNT+4]; - HANDLE hExtraXstatusIcon; - - HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+4]; - HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4]; - - HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+4]; - HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4]; - - HANDLE hAdvancedStatusIcons[ADV_ICON_MAX+4]; - HANDLE hAdvancedStatusItems[ADV_ICON_MAX+4]; - HANDLE hExtraInfo; - - HANDLE hThreadAPC; // APC thread, for queue tasks - HANDLE hWaitEventThreadAPCHandle; - DWORD dwAPCThreadRunning; - FIFO_MT ffmtAPCQueue; - HANDLE hMPopSessionQueue; - HANDLE hSendQueueHandle; - HANDLE hFilesQueueHandle; - HANDLE hAvatarsQueueHandle; + HANDLE hHeap; + HINSTANCE hInstance; + HMODULE hDLLZLib; + HANDLE lpfnCompress2; + HANDLE lpfnUncompress; + HMODULE hDLLXStatusIcons; + char szModuleName[MAXMODULELABELLENGTH]; + WCHAR wszModuleName[MAXMODULELABELLENGTH]; + SIZE_T dwModuleNameLen; + char szDisplayModuleName[MAX_PATH]; + WCHAR wszDisplayModuleName[MAX_PATH]; + SIZE_T dwDisplayModuleNameLen; + + DWORD dwGlobalPluginRunning; + BOOL bLoggedIn; + BOOL bChatExist; + DWORD dwStatusMode; + DWORD dwXStatusMode; + DWORD dwDesiredStatusMode; + + HWND hWndEMailPopupStatus; + DWORD dwEmailMessagesTotal; + DWORD dwEmailMessagesUnRead; + + BOOL bHideXStatusUI; + HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4]; + HANDLE hXStatusAdvancedStatusIcons[MRA_XSTATUS_COUNT+4]; + HANDLE hXStatusAdvancedStatusItems[MRA_XSTATUS_COUNT+4]; + HANDLE hExtraXstatusIcon; + + HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+4]; + HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4]; + + HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+4]; + HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4]; + + HANDLE hAdvancedStatusIcons[ADV_ICON_MAX+4]; + HANDLE hAdvancedStatusItems[ADV_ICON_MAX+4]; + HANDLE hExtraInfo; + + HANDLE hThreadAPC; // APC thread, for queue tasks + HANDLE hWaitEventThreadAPCHandle; + DWORD dwAPCThreadRunning; + FIFO_MT ffmtAPCQueue; + HANDLE hMPopSessionQueue; + HANDLE hSendQueueHandle; + HANDLE hFilesQueueHandle; + HANDLE hAvatarsQueueHandle; - HANDLE hNetlibUser; - HANDLE hThreadWorker; - HANDLE hConnection; - DWORD dwThreadWorkerLastPingTime; - DWORD dwThreadWorkerRunning; - DWORD dwCMDNum; - CRITICAL_SECTION csCriticalSectionSend; - - HANDLE hHookModulesLoaded; - HANDLE hHookPreShutdown; - HANDLE hHookOptInitialize; - HANDLE hHookContactDeleted; - HANDLE hHookSettingChanged; - HANDLE hHookRebuildCMenu; - HANDLE hHookExtraIconsApply; - HANDLE hHookExtraIconsRebuild; - HANDLE hHookIconsChanged; - HANDLE heNudgeReceived; - HANDLE hHookRebuildStatusMenu; - HANDLE hWATrack; - - char szNewMailSound[MAX_PATH]; - - SIZE_T dwMirWorkDirPathLen; - WCHAR szMirWorkDirPath[MAX_FILEPATH]; + HANDLE hNetlibUser; + HANDLE hThreadWorker; + HANDLE hConnection; + DWORD dwThreadWorkerLastPingTime; + DWORD dwThreadWorkerRunning; + DWORD dwCMDNum; + CRITICAL_SECTION csCriticalSectionSend; + + HANDLE hHookModulesLoaded; + HANDLE hHookPreShutdown; + HANDLE hHookOptInitialize; + HANDLE hHookContactDeleted; + HANDLE hHookSettingChanged; + HANDLE hHookRebuildCMenu; + HANDLE hHookExtraIconsApply; + HANDLE hHookExtraIconsRebuild; + HANDLE hHookIconsChanged; + HANDLE heNudgeReceived; + HANDLE hHookRebuildStatusMenu; + HANDLE hWATrack; + + char szNewMailSound[MAX_PATH]; + + SIZE_T dwMirWorkDirPathLen; + WCHAR szMirWorkDirPath[MAX_FILEPATH]; } MRA_SETTINGS; @@ -243,31 +262,31 @@ typedef struct extern MRA_SETTINGS masMraSettings; -INT_PTR LoadServices (); -INT_PTR LoadModules (); -void UnloadModules (); -void UnloadServices (); -void InitExtraIcons (); -void SetExtraIcons (HANDLE hContact); -DWORD MraSetXStatusInternal (DWORD dwXStatus); -DWORD MraGetXStatusInternal (); +INT_PTR LoadServices (); +INT_PTR LoadModules (); +void UnloadModules (); +void UnloadServices (); +void InitExtraIcons (); +void SetExtraIcons (HANDLE hContact); +DWORD MraSetXStatusInternal (DWORD dwXStatus); +DWORD MraGetXStatusInternal (); -int OptInit (WPARAM wParam,LPARAM lParam); +int OptInit (WPARAM wParam,LPARAM lParam); INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam); -DWORD AdvancedSearchFromDlg(HWND hWndDlg); +DWORD AdvancedSearchFromDlg(HWND hWndDlg); -DWORD MraRecvCommand_Message (DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData); +DWORD MraRecvCommand_Message (DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData); -DWORD MraGetSelfVersionString (LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet); +DWORD MraGetSelfVersionString (LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet); -DWORD MraAddrListGetFromBuff (LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList); -DWORD MraAddrListGetToBuff (MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet); -void MraAddrListStoreToContact (HANDLE hContact,MRA_ADDR_LIST *pmalAddrList); -void MraAddrListFree (MRA_ADDR_LIST *pmalAddrList); +DWORD MraAddrListGetFromBuff (LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList); +DWORD MraAddrListGetToBuff (MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet); +void MraAddrListStoreToContact (HANDLE hContact,MRA_ADDR_LIST *pmalAddrList); +void MraAddrListFree (MRA_ADDR_LIST *pmalAddrList); @@ -354,65 +373,63 @@ BOOL DB_GetContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueNa -DWORD MraGetVersionStringFromFormated (LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet); -HANDLE MraHContactFromEmail (LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded); -BOOL MraUpdateContactInfo (HANDLE hContact); -DWORD MraContactCapabilitiesGet (HANDLE hContact); -void MraContactCapabilitiesSet (HANDLE hContact,DWORD dwFutureFlags); -DWORD MraGetContactStatus (HANDLE hContact); -DWORD MraSetContactStatus (HANDLE hContact,DWORD dwNewStatus); -void MraUpdateEmailStatus (LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL); -BOOL IsUnicodeEnv (); -BOOL IsHTTPSProxyUsed (HANDLE hNetlibUser); -BOOL IsContactMra (HANDLE hContact); -BOOL IsContactMraProto (HANDLE hContact); -BOOL IsEMailMy (LPSTR lpszEMail,SIZE_T dwEMailSize); -BOOL IsEMailChatAgent (LPSTR lpszEMail,SIZE_T dwEMailSize); -BOOL IsContactChatAgent (HANDLE hContact); -BOOL IsEMailMR (LPSTR lpszEMail,SIZE_T dwEMailSize); -BOOL GetEMailFromString (LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize); -DWORD GetContactEMailCount (HANDLE hContact,BOOL bMRAOnly); -BOOL GetContactFirstEMail (HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize); -DWORD MraAPCQueueAdd (PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData); -void MraAPCQueueDestroy (PFIFO_MT pffmtAPCQueue); -void ShowFormatedErrorMessage (LPWSTR lpwszErrText,DWORD dwErrorCode); -DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize); -void MraUserAPCThreadProc (LPVOID lpParameter); - -DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet); -void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult); -void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount); -void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow); -//void CListSetMenuItemIcon (HANDLE hMenuItem,HANDLE hIcon); -int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType); -SIZE_T CopyNumber (LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen); -BOOL IsPhone (LPSTR lpszString,SIZE_T dwStringSize); -BOOL IsContactPhone (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize); -HANDLE MraHContactFromPhone (LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded); -void EnableControlsArray (HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled); -BOOL MraRequestXStatusDetails (DWORD dwXStatus); -BOOL MraSendReplyBlogStatus (HANDLE hContact); -DWORD GetYears (CONST PSYSTEMTIME pcstSystemTime); -DWORD FindFile (LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen); -DWORD MemFillRandom (LPVOID lpBuff,SIZE_T dwBuffSize); -BOOL SetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize); -BOOL GetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize); -DWORD DecodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize); -DWORD EncodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize); - - -DWORD StartConnect (); -void MraThreadClean (); - -DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra); -DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir); -DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize); - - -DWORD GetContactFlags (HANDLE hContact); -DWORD SetContactFlags (HANDLE hContact,DWORD dwContactFlag); - -DWORD GetContactBasicInfoW (HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize); +DWORD MraGetVersionStringFromFormated (LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet); +HANDLE MraHContactFromEmail (LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded); +BOOL MraUpdateContactInfo (HANDLE hContact); +DWORD MraContactCapabilitiesGet (HANDLE hContact); +void MraContactCapabilitiesSet (HANDLE hContact,DWORD dwFutureFlags); +DWORD MraGetContactStatus (HANDLE hContact); +DWORD MraSetContactStatus (HANDLE hContact,DWORD dwNewStatus); +void MraUpdateEmailStatus (LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL); +BOOL IsUnicodeEnv (); +BOOL IsHTTPSProxyUsed (HANDLE hNetlibUser); +BOOL IsContactMra (HANDLE hContact); +BOOL IsContactMraProto (HANDLE hContact); +BOOL IsEMailMy (LPSTR lpszEMail,SIZE_T dwEMailSize); +BOOL IsEMailChatAgent (LPSTR lpszEMail,SIZE_T dwEMailSize); +BOOL IsContactChatAgent (HANDLE hContact); +BOOL IsEMailMR (LPSTR lpszEMail,SIZE_T dwEMailSize); +BOOL GetEMailFromString (LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize); +DWORD GetContactEMailCount (HANDLE hContact,BOOL bMRAOnly); +BOOL GetContactFirstEMail (HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize); +DWORD MraAPCQueueAdd (PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData); +void MraAPCQueueDestroy (PFIFO_MT pffmtAPCQueue); +void ShowFormatedErrorMessage (LPWSTR lpwszErrText,DWORD dwErrorCode); +DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize); +void MraUserAPCThreadProc (LPVOID lpParameter); + +DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet); +void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult); +void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount); +void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow); +int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType); +SIZE_T CopyNumber (LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen); +BOOL IsPhone (LPSTR lpszString,SIZE_T dwStringSize); +BOOL IsContactPhone (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize); +HANDLE MraHContactFromPhone (LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded); +void EnableControlsArray (HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled); +BOOL MraRequestXStatusDetails (DWORD dwXStatus); +BOOL MraSendReplyBlogStatus (HANDLE hContact); +DWORD GetYears (CONST PSYSTEMTIME pcstSystemTime); +DWORD FindFile (LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen); +DWORD MemFillRandom (LPVOID lpBuff,SIZE_T dwBuffSize); +BOOL SetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize); +BOOL GetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize); +DWORD DecodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize); +DWORD EncodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize); + + +DWORD StartConnect (); +void MraThreadClean (); + +DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra); +DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir); +DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize); + +DWORD GetContactFlags (HANDLE hContact); +DWORD SetContactFlags (HANDLE hContact,DWORD dwContactFlag); + +DWORD GetContactBasicInfoW (HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize); #define SCBIFSI_LOCK_CHANGES_EVENTS 1 #define SCBIF_ID 1 diff --git a/protocols/MRA/MraAvatars.cpp b/protocols/MRA/MraAvatars.cpp index 96e498d964..7c3d3710b1 100644 --- a/protocols/MRA/MraAvatars.cpp +++ b/protocols/MRA/MraAvatars.cpp @@ -498,7 +498,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection,DWORD dwRequestType,LPSTR lps if (pbKeepAlive) (*pbKeepAlive)=FALSE; if (pdwFormat) (*pdwFormat)=PA_FORMAT_UNKNOWN; if (pdwAvatarSize) (*pdwAvatarSize)=0; - if (pitLastModifiedTime) memset(pitLastModifiedTime,0, sizeof(INTERNET_TIME)); + if (pitLastModifiedTime)bzero(pitLastModifiedTime,sizeof(INTERNET_TIME)); if (hConnection) { diff --git a/protocols/MRA/MraIcons.cpp b/protocols/MRA/MraIcons.cpp index 18b8f8c5f5..f910f6adc5 100644 --- a/protocols/MRA/MraIcons.cpp +++ b/protocols/MRA/MraIcons.cpp @@ -81,15 +81,15 @@ void IconsLoad() void IconsUnLoad() { RemoveIcoLibItems(gdiMenuItems,SIZEOF(gdiMenuItems)); - memset(masMraSettings.hMainMenuIcons, 0, sizeof(masMraSettings.hMainMenuIcons)); + bzero(masMraSettings.hMainMenuIcons,sizeof(masMraSettings.hMainMenuIcons)); RemoveIcoLibItems(gdiContactMenuItems,SIZEOF(gdiContactMenuItems)); - memset(masMraSettings.hContactMenuIcons, 0, sizeof(masMraSettings.hContactMenuIcons)); + bzero(masMraSettings.hContactMenuIcons,sizeof(masMraSettings.hContactMenuIcons)); // Advanced Status Icons initialization RemoveIcoLibItems(gdiExtraStatusIconsItems,SIZEOF(gdiExtraStatusIconsItems)); - memset(masMraSettings.hAdvancedStatusIcons, 0, sizeof(masMraSettings.hAdvancedStatusIcons)); - memset(masMraSettings.hAdvancedStatusItems,0, sizeof(masMraSettings.hAdvancedStatusItems)); + bzero(masMraSettings.hAdvancedStatusIcons,sizeof(masMraSettings.hAdvancedStatusIcons)); + bzero(masMraSettings.hAdvancedStatusItems,sizeof(masMraSettings.hAdvancedStatusItems)); } @@ -112,7 +112,7 @@ void InitXStatusIcons() { GetModuleFileName(masMraSettings.hDLLXStatusIcons,wszPath,SIZEOF(wszPath)); }else{ - memset(wszPath, 0, sizeof(wszPath)); + bzero(wszPath,sizeof(wszPath)); } mir_sntprintf(wszSection,SIZEOF(wszSection),L"Status Icons/%s/Custom Status",PROTOCOL_NAMEW); @@ -144,8 +144,8 @@ void DestroyXStatusIcons() //***deb until 08 release //CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)szBuff); } - memset(masMraSettings.hXStatusAdvancedStatusIcons, 0, sizeof(masMraSettings.hXStatusAdvancedStatusIcons)); - memset(masMraSettings.hXStatusAdvancedStatusItems, 0, sizeof(masMraSettings.hXStatusAdvancedStatusItems)); + bzero(masMraSettings.hXStatusAdvancedStatusIcons,sizeof(masMraSettings.hXStatusAdvancedStatusIcons)); + bzero(masMraSettings.hXStatusAdvancedStatusItems,sizeof(masMraSettings.hXStatusAdvancedStatusItems)); } diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp index 55621e4bce..6f4e678ce9 100644 --- a/protocols/MRA/Mra_svcs.cpp +++ b/protocols/MRA/Mra_svcs.cpp @@ -123,7 +123,7 @@ void UnloadModules() { if (masMraSettings.hHookRebuildStatusMenu) {UnhookEvent(masMraSettings.hHookRebuildStatusMenu); masMraSettings.hHookRebuildStatusMenu=NULL;} - memset(masMraSettings.hXStatusMenuItems, 0, sizeof(masMraSettings.hXStatusMenuItems)); + bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems)); // Service deletion for(SIZE_T i=0;i + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + + + +#if !defined(AFX_SYSTEMHEADERS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) +#define AFX_SYSTEMHEADERS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_ + + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + + + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define WINVER 0x0502 +#define _WIN32_WINNT 0x0502 +#include +#include +#include +#include +#include +#include +#include +#include +//#include + + +#pragma comment(lib,"Crypt32.lib") +#pragma comment(lib,"shlwapi.lib") +#pragma comment(lib,"ws2_32.lib") +#pragma comment(lib,"mswsock.lib") +// RunTmChk.lib Imagehlp.lib kernel32.lib Crypt32.lib shlwapi.lib ws2_32.lib mswsock.lib + + + + + +#endif // !defined(AFX_SYSTEMHEADERS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) -- cgit v1.2.3