From 6e67be23d4796ce8a3d39408aa2e02b632c67b47 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 12 Mar 2019 18:15:37 +0300 Subject: YAMN: warning fixes --- plugins/ExternalAPI/m_account.h | 218 +++++++++++++++++------------------ plugins/ExternalAPI/m_filterplugin.h | 2 +- plugins/ExternalAPI/m_mails.h | 71 +++++------- plugins/ExternalAPI/m_protoplugin.h | 28 ++--- 4 files changed, 152 insertions(+), 167 deletions(-) (limited to 'plugins/ExternalAPI') diff --git a/plugins/ExternalAPI/m_account.h b/plugins/ExternalAPI/m_account.h index c6a342fd3d..ed342bafeb 100644 --- a/plugins/ExternalAPI/m_account.h +++ b/plugins/ExternalAPI/m_account.h @@ -13,14 +13,14 @@ #include #include "m_synchro.h" //include synchronizing objects. If you want to write protocol plugin, which works with YAMN accounts, it must use YAMN synchronizing objects -// -//================================== OTHER DEFINITIONS ======================================== -// + // + //================================== OTHER DEFINITIONS ======================================== + // enum { -// Error codes returned from functions (services) working with account book files - EACC_SYSTEM=1, //use GetLastError() to retrieve detailed information about error + // Error codes returned from functions (services) working with account book files + EACC_SYSTEM = 1, //use GetLastError() to retrieve detailed information about error EACC_ALLOC, //problem with memory allocation EACC_FILECOMPATIBILITY, //file is corrupted EACC_ENDOFFILE, //unexpected end of file occured @@ -30,10 +30,10 @@ enum enum { -// Status of account -// used in messages WM_YAMN_CHANGESTATUS -// used also in function GetStatus and SetStatus - ACC_IDLE=0, //account is IDLE (no work is performed with account) + // Status of account + // used in messages WM_YAMN_CHANGESTATUS + // used also in function GetStatus and SetStatus + ACC_IDLE = 0, //account is IDLE (no work is performed with account) ACC_FINDING, //DNS lookup for account ACC_CONNECTING, //connecting in progress ACC_LOGGING, //logging in progress @@ -41,53 +41,48 @@ enum ACC_DISCONNECTING, //disconnecting from server }; -typedef struct CNotification -{ -//#define YAMN_NOTIFICATIONVERSION is not implemented, use YAMN_ACCOUNTVERSION instead - CNotification(): PopupB(0), PopupT(0), PopupTime(0), App(nullptr), AppParam(nullptr), Sound(nullptr), TrayIcon1(nullptr), TrayIcon2(nullptr) {} - -#define YAMN_ACC_SND 0x00000001 //Plays sound (1) -#define YAMN_ACC_MSG 0x00000002 //Shows dialog -#define YAMN_ACC_ICO 0x00000004 //Shows system tray icon (1) -#define YAMN_ACC_ICOB 0x00000008 //not used now, enables tray icon flashing (1) -#define YAMN_ACC_APP 0x00000010 //Runs application (1) -#define YAMN_ACC_POP 0x00000020 //Shows popup -#define YAMN_ACC_POPC 0x00000040 //Use custom colors in popup -#define YAMN_ACC_MSGP 0x00000080 //Persistant messgage. This means, when an situation occurs (e.g. new mail) and message is displayed, it is not destroyed when YAMN_ACC_MSG is not set -#define YAMN_ACC_KBN 0x00000100 //Use Keyboard notify -#define YAMN_ACC_CONT 0x00000200 //Use Contact notify -#define YAMN_ACC_CONTNICK 0x00000400 //Use Contact Nick replacement -#define YAMN_ACC_CONTNOEVENT 0x00000800 //Suppress event for this contact -//(1) - usable only in newmail notification - DWORD Flags; - - COLORREF PopupB; - COLORREF PopupT; - DWORD PopupTime; - WCHAR *App; - WCHAR *AppParam; - -//These parameters are not stored in standard YAMN book file and therefore must be set by plugin - char *Sound; - HICON TrayIcon1; - HICON TrayIcon2; -} YAMN_NOTIFICATION,*PYAMN_NOTIFICATION; - -typedef struct CServer +#define YAMN_ACC_SND 0x00000001 // Plays sound (1) +#define YAMN_ACC_MSG 0x00000002 // Shows dialog +#define YAMN_ACC_ICO 0x00000004 // Shows system tray icon (1) +#define YAMN_ACC_ICOB 0x00000008 // not used now, enables tray icon flashing (1) +#define YAMN_ACC_APP 0x00000010 // Runs application (1) +#define YAMN_ACC_POP 0x00000020 // Shows popup +#define YAMN_ACC_POPC 0x00000040 // Use custom colors in popup +#define YAMN_ACC_MSGP 0x00000080 // Persistant messgage. This means, when an situation occurs (e.g. new mail) and message is displayed, it is not destroyed when YAMN_ACC_MSG is not set +#define YAMN_ACC_KBN 0x00000100 // Use Keyboard notify +#define YAMN_ACC_CONT 0x00000200 // Use Contact notify +#define YAMN_ACC_CONTNICK 0x00000400 // Use Contact Nick replacement +#define YAMN_ACC_CONTNOEVENT 0x00000800 // Suppress event for this contact + +struct YAMN_NOTIFICATION { - CServer(): Name(nullptr), Login(nullptr), Passwd(nullptr) {} - - char *Name; - DWORD Port; + //(1) - usable only in newmail notification + DWORD Flags = 0; + + COLORREF PopupB = 0; + COLORREF PopupT = 0; + DWORD PopupTime = 0; + WCHAR *App = nullptr; + WCHAR *AppParam = nullptr; + + // These parameters are not stored in standard YAMN book file and therefore must be set by plugin + char *Sound = nullptr; + HICON TrayIcon1 = nullptr; + HICON TrayIcon2 = nullptr; +}; - char *Login; +struct CServer +{ + char *Name = nullptr; + DWORD Port = 0; -// Password encryption definitions -#define STARTCODEPSW 0x50 -#define ADDCODEPSW 0x0 - char *Passwd; + char *Login = nullptr; -} *PSERVER; + // Password encryption definitions + #define STARTCODEPSW 0x50 + #define ADDCODEPSW 0x0 + char *Passwd = nullptr; +}; // //================================== ACCOUNT DEFINITION ================================== @@ -95,54 +90,53 @@ typedef struct CServer typedef struct CAccount { -#define YAMN_ACCOUNTFILEVERSION 2 //version of standard file format (YAMN book file format) -#define YAMN_ACCOUNTVERSION 3 -//If changes are made in this structure, version is changed. -//So then YAMN does not initialzie your structure, if version does not matches. + #define YAMN_ACCOUNTFILEVERSION 2 //version of standard file format (YAMN book file format) + #define YAMN_ACCOUNTVERSION 3 + + // If changes are made in this structure, version is changed. + // So then YAMN does not initialzie your structure, if version does not matches. - BOOL AbleToWork; //This is set to TRUE by default. When it is needed to stop working on this account, YAMN sets this to zero. + BOOL AbleToWork; // This is set to TRUE by default. When it is needed to stop working on this account, YAMN sets this to zero. - struct CYAMNProtoPlugin *Plugin; //free access, because this member should not be changed. The same as YAMN_PLUGIN structure + struct CYAMNProtoPlugin *Plugin; // free access, because this member should not be changed. The same as YAMN_PLUGIN structure - char *Name; //access only through AccountAccessSO + char *Name; // access only through AccountAccessSO -// DWORD Abilities; //access only through AccountAccessSO - - PSERVER Server; //access only through AccountAccessSO + CServer *Server; //access only through AccountAccessSO WORD Interval; //access only through AccountAccessSO -// YAMN account flags (set by user) -#define YAMN_ACC_ENA 0x00000001 //Enables account. If account is disabled, no countdown is performed -#define YAMN_ACC_POPN 0x00000002 //Shows one popup per one new mail or for N mails -#define YAMN_ACC_APOP 0x00000004 //Use APOP authentication -#define YAMN_ACC_SSL23 0x00000008 //Use SSLv2,3 -#define YAMN_ACC_NOTLS 0x00000010 //Don't try StartTLS (STLS) even available -#define YAMN_ACC_BODY 0x00000020 //Always retrieve body of the message + // YAMN account flags (set by user) + #define YAMN_ACC_ENA 0x00000001 //Enables account. If account is disabled, no countdown is performed + #define YAMN_ACC_POPN 0x00000002 //Shows one popup per one new mail or for N mails + #define YAMN_ACC_APOP 0x00000004 //Use APOP authentication + #define YAMN_ACC_SSL23 0x00000008 //Use SSLv2,3 + #define YAMN_ACC_NOTLS 0x00000010 //Don't try StartTLS (STLS) even available + #define YAMN_ACC_BODY 0x00000020 //Always retrieve body of the message DWORD Flags; //access only through AccountAccessSO -// YAMN account flags (set by plugin) -#define YAMN_ACC_BROWSE 0x00000001 //Can browse mails. On this account we can run mailbrowser window -#define YAMN_ACC_POPUP 0x00000002 //Popups of new mail belonging to this account can be showed + // YAMN account flags (set by plugin) + #define YAMN_ACC_BROWSE 0x00000001 //Can browse mails. On this account we can run mailbrowser window + #define YAMN_ACC_POPUP 0x00000002 //Popups of new mail belonging to this account can be showed DWORD AbilityFlags; -// YAMN account status flags -#define YAMN_ACC_ST0 0x00000001 //Check (countdown) when Offline -#define YAMN_ACC_ST1 0x00000002 //Check (countdown) when Online -#define YAMN_ACC_ST2 0x00000004 //Check (countdown) when Away -#define YAMN_ACC_ST3 0x00000008 //Check (countdown) when Not available -#define YAMN_ACC_ST4 0x00000010 //Check (countdown) when Occupied -#define YAMN_ACC_ST5 0x00000020 //Check (countdown) when DND -#define YAMN_ACC_ST6 0x00000040 //Check (countdown) when Free for chat -#define YAMN_ACC_ST7 0x00000080 //Check (countdown) when Invisible -#define YAMN_ACC_ST8 0x00000100 //Check (countdown) when On the phone -#define YAMN_ACC_ST9 0x00000200 //Check (countdown) when Out to lunch -#define YAMN_ACC_STARTA 0x00010000 //Check on start anyway -#define YAMN_ACC_STARTS 0x00020000 //Check on start regarding to status setting -#define YAMN_ACC_FORCE 0x00040000 //Check when "check new mail" item pressed (it is called forced checking) + // YAMN account status flags + #define YAMN_ACC_ST0 0x00000001 //Check (countdown) when Offline + #define YAMN_ACC_ST1 0x00000002 //Check (countdown) when Online + #define YAMN_ACC_ST2 0x00000004 //Check (countdown) when Away + #define YAMN_ACC_ST3 0x00000008 //Check (countdown) when Not available + #define YAMN_ACC_ST4 0x00000010 //Check (countdown) when Occupied + #define YAMN_ACC_ST5 0x00000020 //Check (countdown) when DND + #define YAMN_ACC_ST6 0x00000040 //Check (countdown) when Free for chat + #define YAMN_ACC_ST7 0x00000080 //Check (countdown) when Invisible + #define YAMN_ACC_ST8 0x00000100 //Check (countdown) when On the phone + #define YAMN_ACC_ST9 0x00000200 //Check (countdown) when Out to lunch + #define YAMN_ACC_STARTA 0x00010000 //Check on start anyway + #define YAMN_ACC_STARTS 0x00020000 //Check on start regarding to status setting + #define YAMN_ACC_FORCE 0x00040000 //Check when "check new mail" item pressed (it is called forced checking) DWORD StatusFlags; //access only through AccountAccessSO -// Plugin flags. Use this DWORD if you want YAMN to store it to YAMN book file. You can set here any value + // Plugin flags. Use this DWORD if you want YAMN to store it to YAMN book file. You can set here any value DWORD PluginFlags; YAMN_NOTIFICATION NewMailN; //access only through AccountAccessSO @@ -160,45 +154,45 @@ typedef struct CAccount HANDLE Mails; //access only through MessagesAccessSO -//Account members are mostly the same, but there can be protocol (POP3,IMAP...) special features. -//To use them, only inherit this class and add your own features. -//First idea was to add pointer to void, where plugin can store its own values. -//But this solution is better in my opinion. + // Account members are mostly the same, but there can be protocol (POP3,IMAP...) special features. + // To use them, only inherit this class and add your own features. + // First idea was to add pointer to void, where plugin can store its own values. + // But this solution is better in my opinion. -//This is event with counter. Event is signaled when no threads are using account (and will not be using) -//Very usefull for account delete operation + // This is event with counter. Event is signaled when no threads are using account (and will not be using) + // Very usefull for account delete operation PSCOUNTER UsingThreads; -//We have to achieve, that only one thread can write to account and more threads can read. -//Writing to account means that we change account parameters -//Reading from account meands we read account parameters -//Use WaitToRead(), ReadDone(), WaitToWrite(), WriteDone() synchronization functions -//For plugins, this is a pointer to void. It does not matter for plugin what is this variable for, -//because plugin works only with synchronization routines. And why is this void * ? It is because -//plugin does not need to include headers for SWMRG structures... + // We have to achieve, that only one thread can write to account and more threads can read. + // Writing to account means that we change account parameters + // Reading from account meands we read account parameters + // Use WaitToRead(), ReadDone(), WaitToWrite(), WriteDone() synchronization functions + // For plugins, this is a pointer to void. It does not matter for plugin what is this variable for, + // because plugin works only with synchronization routines. And why is this void * ? It is because + // plugin does not need to include headers for SWMRG structures... PSWMRG AccountAccessSO; -//We have to achieve, that only one thread can write to account mails and more threads can read. -//While some thread writes mails, other thread can write to account. This can be small problem, but it never appears in YAMN. -//But you should think about this note if you want to add some features in the future -//Writing to messages means any changes to message queue or message data -//Reading from messages means reading message queue (browsing through all messages) or reading message data -//Use MsgsWaitToRead(),MsgsReadDone(),MsgsWaitToWrite(),MsgsWriteDone() synchronization functions + // We have to achieve, that only one thread can write to account mails and more threads can read. + // While some thread writes mails, other thread can write to account. This can be small problem, but it never appears in YAMN. + // But you should think about this note if you want to add some features in the future + // Writing to messages means any changes to message queue or message data + // Reading from messages means reading message queue (browsing through all messages) or reading message data + // Use MsgsWaitToRead(),MsgsReadDone(),MsgsWaitToWrite(),MsgsWriteDone() synchronization functions PSWMRG MessagesAccessSO; -//For clist contact notification - MCONTACT hContact; + //For clist contact notification + MCONTACT hContact; BOOL isCounting; - struct CAccount *Next; -} *HACCOUNT; + CAccount *Next; +}; // //================================== FUNCTIONS DEFINITIONS ======================================== // -typedef void (WINAPI *YAMN_SETSTATUSFCN)(HACCOUNT,TCHAR *); -typedef void (WINAPI *YAMN_GETSTATUSFCN)(HACCOUNT,TCHAR *); +typedef void (WINAPI *YAMN_SETSTATUSFCN)(CAccount*, TCHAR *); +typedef void (WINAPI *YAMN_GETSTATUSFCN)(CAccount*, TCHAR *); // //================================== QUICK FUNCTION CALL DEFINITIONS ======================================== diff --git a/plugins/ExternalAPI/m_filterplugin.h b/plugins/ExternalAPI/m_filterplugin.h index cd81c4254c..80f7ccd910 100644 --- a/plugins/ExternalAPI/m_filterplugin.h +++ b/plugins/ExternalAPI/m_filterplugin.h @@ -11,7 +11,7 @@ #ifndef YAMN_STANDARDFCN typedef DWORD (WINAPI *YAMN_STANDARDFCN)(LPVOID); #endif -typedef DWORD (WINAPI *YAMN_FILTERMAILFCN)(HACCOUNT,DWORD,HYAMNMAIL,DWORD); +typedef DWORD (WINAPI *YAMN_FILTERMAILFCN)(CAccount *,DWORD,HYAMNMAIL,DWORD); typedef struct CFilterImportFcn { diff --git a/plugins/ExternalAPI/m_mails.h b/plugins/ExternalAPI/m_mails.h index e5ef0cc692..ea53511b72 100644 --- a/plugins/ExternalAPI/m_mails.h +++ b/plugins/ExternalAPI/m_mails.h @@ -9,81 +9,72 @@ //================================== OTHER DEFINITIONS ======================================== // -typedef struct CShortNames +struct CShortNames { char *Value; char *ValueNick; - struct CShortNames *Next; -} YAMN_MIMESHORTNAMES,*PYAMN_MIMESHORTNAMES; + CShortNames *Next; +}; -typedef struct CNames +struct CMimeNames { WCHAR *Value; WCHAR *ValueNick; - struct CNames *Next; -} YAMN_MIMENAMES,*PYAMN_MIMENAMES; + CMimeNames *Next; +}; -struct CShortHeader //this header is used in to get non-unicode data from mime header +struct CShortHeader { char *From; char *FromNick; char *ReturnPath; char *ReturnPathNick; char *Subject; - PYAMN_MIMESHORTNAMES To; - PYAMN_MIMESHORTNAMES Cc; - PYAMN_MIMESHORTNAMES Bcc; + CShortNames *To; + CShortNames *Cc; + CShortNames *Bcc; char *Date; char Priority; char *Body; int CP; - - CShortHeader() {} - ~CShortHeader() {} }; -struct CHeader //this header is used in miranda to store final results of mime reading in Unicode +struct CHeader { WCHAR *From; WCHAR *FromNick; WCHAR *ReturnPath; WCHAR *ReturnPathNick; WCHAR *Subject; - PYAMN_MIMENAMES To; - PYAMN_MIMENAMES Cc; - PYAMN_MIMENAMES Bcc; + CMimeNames *To; + CMimeNames *Cc; + CMimeNames *Bcc; WCHAR *Date; TCHAR Priority; WCHAR *Body; - - CHeader() {} - ~CHeader() {} }; struct CMimeItem { - char *name; - char *value; - struct CMimeItem *Next; - CMimeItem(): name(nullptr), value(nullptr), Next(nullptr){} + char *name = nullptr; + char *value = nullptr; + CMimeItem *Next = nullptr; }; -typedef struct CMailData //this is plugin-independent +// this is plugin-independent +typedef struct CMailData { -#define YAMN_MAILDATAVERSION 3 - - DWORD Size; - int CP; - - struct CMimeItem *TranslatedHeader; //MIME items - struct CMimeItem *Additional; //MIME items not read from server (custom, for filter plugins etc.) - char *Body; //Message body + #define YAMN_MAILDATAVERSION 3 + DWORD Size = 0; + int CP = -1; - CMailData(): CP(-1), Size(0), TranslatedHeader(nullptr), Body(nullptr) {} -} MAILDATA,*PMAILDATA; + CMimeItem *TranslatedHeader = nullptr; // MIME items + CMimeItem *Additional = nullptr; // MIME items not read from server (custom, for filter plugins etc.) + char *Body = nullptr; // Message body +}; typedef struct CMimeMsgQueue { @@ -139,7 +130,7 @@ typedef struct CMimeMsgQueue #define YAMN_MSG_SPAML(maildata,level) ((maildata & YAMN_MSG_SPAMMASK)==level) DWORD Flags; //Plugins can read mail data, but it can be NULL!!! So plugin should use Load and Save services to load or save data and Unload to release data from memory - PMAILDATA MailData; + CMailData *MailData; //Here YAMN stores its own informations about this mail. Not usefull for plugins... // void *YAMNData; HWND MsgWindow; @@ -159,7 +150,7 @@ typedef struct CMimeMsgQueue //CreateAccountMail Service //Your plugin should call this to create new mail for your plugin. -//WPARAM- (HACCOUNT) Account handle +//WPARAM- (CAccount *) Account handle //LPARAM- CMailData version (use YAMN_MAILVERSION definition) //returns pointer to (HYAMNMAIL) or pointer to your structure returned from imported NewMailFcnPtr, if implemented #define MS_YAMN_CREATEACCOUNTMAIL "YAMN/Service/CreateMail" @@ -184,7 +175,7 @@ typedef struct CMimeMsgQueue //LPARAM- (DWORD) version of MAILDATA structure (use YAMN_MAILDATAVERSION definition) //returns pointer to new allocated MailData structure (the same value as MailData member) #define MS_YAMN_LOADMAILDATA "YAMN/Service/LoadMailData" -#define LoadMailData(x) (PMAILDATA)CallService(MS_YAMN_LOADMAILDATA,(WPARAM)x,(LPARAM)YAMN_MAILDATAVERSION) +#define LoadMailData(x) (CMailData*)CallService(MS_YAMN_LOADMAILDATA,(WPARAM)x,(LPARAM)YAMN_MAILDATAVERSION) //UnloadMailData Service //This service frees mail data from memory. It does not care if data were saved or not. So you should save mail before you @@ -209,10 +200,10 @@ typedef struct CMimeMsgQueue // //typedef void (WINAPI *YAMN_SENDMESSAGEFCN)(UINT,WPARAM,LPARAM); -typedef void (WINAPI *YAMN_SYNCHROMIMEMSGSFCN)(HACCOUNT,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *); +typedef void (WINAPI *YAMN_SYNCHROMIMEMSGSFCN)(CAccount *,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *,HYAMNMAIL *); typedef void (WINAPI *YAMN_TRANSLATEHEADERFCN)(char *,int,struct CMimeItem **); typedef void (WINAPI *YAMN_APPENDQUEUEFCN)(HYAMNMAIL,HYAMNMAIL); -typedef void (WINAPI *YAMN_DELETEMIMEQUEUEFCN)(HACCOUNT,HYAMNMAIL); +typedef void (WINAPI *YAMN_DELETEMIMEQUEUEFCN)(CAccount *,HYAMNMAIL); typedef void (WINAPI *YAMN_DELETEMIMEMESSAGEFCN)(HYAMNMAIL *,HYAMNMAIL,int); typedef HYAMNMAIL (WINAPI *YAMN_FINDMIMEMESSAGEFCN)(HYAMNMAIL,char *); typedef HYAMNMAIL (WINAPI *YAMN_CREATENEWDELETEQUEUEFCN)(HYAMNMAIL); diff --git a/plugins/ExternalAPI/m_protoplugin.h b/plugins/ExternalAPI/m_protoplugin.h index cbbe8e0ed1..70e8c29937 100644 --- a/plugins/ExternalAPI/m_protoplugin.h +++ b/plugins/ExternalAPI/m_protoplugin.h @@ -21,7 +21,7 @@ struct CheckParam //in any way. YAMN is waiting for this event. If you do not signal it, YAMN is blocked. HANDLE ThreadRunningEV; //ActualAccount- the only parameter used in Check function and should contain all needed information I think :) - HACCOUNT AccountParam; + CAccount *AccountParam; //I thought it, but this is needed, too #define YAMN_NORMALCHECK 0 @@ -46,7 +46,7 @@ struct DeleteParam //in any way. YAMN is waiting for this event. If you do not signal it, YAMN is blocked. HANDLE ThreadRunningEV; //ActualAccount- which account to delete - HACCOUNT AccountParam; + CAccount *AccountParam; //YAMN writes here some informations that are needed to pass to mail browser function (or bad connection or no new mail) void *BrowserParam; //Calling thread can write here its own parameter. Usefull when protocol calls its own delete function. YAMN always sets this parameter to NULL @@ -61,11 +61,11 @@ struct DeleteParam typedef DWORD(WINAPI *YAMN_STANDARDFCN)(LPVOID); #endif typedef struct CYAMNVariables *(WINAPI *YAMN_GETVARIABLESFCN)(DWORD); -typedef HACCOUNT(WINAPI *YAMN_NEWACCOUNTFCN)(struct CYAMNProtoPlugin *, DWORD); -typedef void (WINAPI *YAMN_STOPACCOUNTFCN)(HACCOUNT); -typedef void (WINAPI *YAMN_DELETEACCOUNTFCN)(HACCOUNT); -typedef DWORD(WINAPI *YAMN_WRITEPLUGINOPTS)(HANDLE File, HACCOUNT); -typedef DWORD(WINAPI *YAMN_READPLUGINOPTS)(HACCOUNT, char **, char *); +typedef CAccount *(WINAPI *YAMN_NEWACCOUNTFCN)(struct CYAMNProtoPlugin *, DWORD); +typedef void (WINAPI *YAMN_STOPACCOUNTFCN)(CAccount *); +typedef void (WINAPI *YAMN_DELETEACCOUNTFCN)(CAccount *); +typedef DWORD(WINAPI *YAMN_WRITEPLUGINOPTS)(HANDLE File, CAccount *); +typedef DWORD(WINAPI *YAMN_READPLUGINOPTS)(CAccount *, char **, char *); typedef DWORD(WINAPI *YAMN_CHECKFCN)(struct CheckParam *); typedef void(__cdecl *YAMN_DELETEFCN)(void *); typedef TCHAR* (WINAPI *YAMN_GETERRORSTRINGWFCN)(DWORD); @@ -145,7 +145,7 @@ typedef struct CAccountImportFcn YAMN_STANDARDFCN UnLoadFcn; } YAMN_PROTOIMPORTFCN, *PYAMN_PROTOIMPORTFCN; -typedef HYAMNMAIL(WINAPI *YAMN_NEWMAILFCN)(HACCOUNT, DWORD); +typedef HYAMNMAIL(WINAPI *YAMN_NEWMAILFCN)(CAccount *, DWORD); typedef void (WINAPI *YAMN_DELETEMAILFCN)(HYAMNMAIL); typedef DWORD(WINAPI *YAMN_WRITEMAILOPTS)(HANDLE File, HYAMNMAIL); typedef DWORD(WINAPI *YAMN_READMAILOPTS)(HYAMNMAIL, char **, char *); @@ -210,7 +210,7 @@ typedef struct CProtoPluginRegistration typedef struct CYAMNProtoPlugin { //Pointer to first protocol plugin account - HACCOUNT FirstAccount; + CAccount * FirstAccount; //We prevent browsing through accounts (chained list) from deleting or adding any account //If we want to delete or add, we must have "write" access to AccountBrowserSO @@ -256,13 +256,13 @@ typedef struct CProtoPluginQueue //Your plugin should call this to create new account for your plugin. //WPARAM- (HYAMNPLUGIN) Plugin handle //LPARAM- CAccount version (use YAMN_ACCOUNTVERSION definition) -//returns pointer to (HACCOUNT) or pointer to your structure returned from imported NewAccountFcnPtr, if implemented +//returns pointer to (CAccount *) or pointer to your structure returned from imported NewAccountFcnPtr, if implemented #define MS_YAMN_CREATEPLUGINACCOUNT "YAMN/Service/CreateAccount" //DeletePluginAccount Service //Deletes plugin's account from memory. You probably won't use this service, because it deletes only account //without any synchronization. Use MS_YAMN_DELETEACCOUNT instead. -//WPARAM- (HACCOUNT) to delete +//WPARAM- (CAccount *) to delete //LPARAM- any value //returns zero if failed, otherwise returns nonzero #define MS_YAMN_DELETEPLUGINACCOUNT "YAMN/Service/DeletePluginAccount" @@ -271,7 +271,7 @@ typedef struct CProtoPluginQueue //Searches accounts queue for first account that belongs to plugin //WPARAM- (HYAMNPLUGIN) Plugin handle //LPARAM- (TCHAR *)string, name of account to find -//returns found HACCOUNT handle or NULL if not found +//returns found CAccount * handle or NULL if not found #define MS_YAMN_FINDACCOUNTBYNAME "YAMN/Service/FindAccountByName" //GetNextFreeAccount Service @@ -284,14 +284,14 @@ typedef struct CProtoPluginQueue // //WPARAM- (HYAMNPLUGIN) Plugin handle //LPARAM- CAccount version (use YAMN_ACCOUNTVERSION definition) -//returns new HACCOUNT handle or NULL if not found +//returns new CAccount * handle or NULL if not found #define MS_YAMN_GETNEXTFREEACCOUNT "YAMN/Service/GetNextFreeAccount" //DeleteAccount Service //Deletes account from plugin account queue. It also deletes it, but in background (when needed). //This deleting is full synchronized and safe. It is recommended for plugins to use this service. //WPARAM- (HYAMNPLUGIN) Plugin handle -//LPARAM- (HACCOUNT) Account to delete +//LPARAM- (CAccount *) Account to delete #define MS_YAMN_DELETEACCOUNT "YAMN/Service/DeleteAccount" //ReadAccounts Service -- cgit v1.2.3