From ad4e888349c2d220828c93d2d50635ff23a6fc72 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 3 Jul 2012 17:22:40 +0000 Subject: AutoShutdown: plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/utils.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugins/AutoShutdown/utils.cpp') diff --git a/plugins/AutoShutdown/utils.cpp b/plugins/AutoShutdown/utils.cpp index b9bbddbc01..d9ea4a879e 100644 --- a/plugins/AutoShutdown/utils.cpp +++ b/plugins/AutoShutdown/utils.cpp @@ -87,8 +87,9 @@ void TrimString(TCHAR *pszStr) /************************* Error Output ***************************/ -static void MessageBoxIndirectFree(MSGBOXPARAMSA *mbp) +static void MessageBoxIndirectFree(void *param) { + MSGBOXPARAMSA *mbp = (MSGBOXPARAMSA*)param; MessageBoxIndirectA(mbp); mir_free((char*)mbp->lpszCaption); /* does NULL check */ mir_free((char*)mbp->lpszText); /* does NULL check */ @@ -129,7 +130,7 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) case NIIF_WARNING: mbp->dwStyle|=MB_ICONWARNING; break; case NIIF_ERROR: mbp->dwStyle|=MB_ICONERROR; } - mir_forkthread(MessageBoxIndirectFree,mbp); + mir_forkthread(MessageBoxIndirectFree, mbp); } // LocalFree() the return value @@ -163,8 +164,8 @@ BOOL SystemTimeToTimeStamp(SYSTEMTIME *st,time_t *timestamp) BOOL TimeStampToSystemTime(time_t timestamp,SYSTEMTIME *st) { - struct tm *ts; - ts=localtime(×tamp); /* statically alloced, local time correction */ + struct tm *ts = {0}; + localtime_s(ts, ×tamp); /* statically alloced, local time correction */ if(ts==NULL) return FALSE; st->wMilliseconds=0; /* 0-999 (not given in tm) */ st->wSecond=(WORD)ts->tm_sec; /* 0-59 */ @@ -265,7 +266,8 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const fid.deffontsettings.charset=plfDefault->lfCharSet; lstrcpyn(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */ } - return CallService(MS_FONT_REGISTERT,(WPARAM)&fid,(LPARAM)&fid); + FontRegisterT(&fid); + return 0; } int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr,LOGFONT *plf) @@ -288,7 +290,8 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons lstrcpynA(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */ lstrcpyn(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */ lstrcpyn(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */ - return CallService(MS_COLOUR_REGISTERT,(WPARAM)&cid,0); + ColourRegisterT(&cid); + return 0; } int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr) @@ -320,7 +323,7 @@ HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCH sid.flags=SIDF_SORTED|SIDF_ALL_TCHAR; if(!GetModuleFileName(hInst,szFileName,SIZEOF(szFileName))) return NULL; - return (HANDLE)CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + return Skin_AddIcon(&sid); } HICON IcoLib_GetIcon(const char *pszDbName) @@ -355,7 +358,8 @@ int SkinAddNewSoundBundled(const char *pszDbName,const char *pszSection,const ch CloseHandle(hFile); } } - return CallService(MS_SKIN_ADDNEWSOUND,0,(LPARAM)&ssd); + Skin_AddSound(&ssd); + return 0; } /* workaround for 'Hotkey Service' plugin because it has needs an event catcher */ -- cgit v1.2.3