summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-01 22:52:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-01 22:52:26 +0000
commit427891e0d28becb428ae8435954399f2e4daa9fe (patch)
treed4ec79359e9b35293c3ff7ca25ccda6fd71f23b4 /plugins
parentec4498ee255a018ccb16061de4594618e7ab5690 (diff)
service call replaced with helper: MS_UTILS_PATHTOABSOLUTEW
git-svn-id: http://svn.miranda-ng.org/main/trunk@3827 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/image_utils.cpp4
-rw-r--r--plugins/AssocMgr/src/assoclist.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp2
-rw-r--r--plugins/ClientChangeNotify/src/Misc.h2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp19
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp9
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp19
-rw-r--r--plugins/Clist_mw/src/BkgrCfg.cpp6
-rw-r--r--plugins/Clist_mw/src/clcopts.cpp26
-rw-r--r--plugins/Clist_mw/src/clui.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp3
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp2
-rw-r--r--plugins/FlashAvatars/src/cflash.cpp15
-rw-r--r--plugins/IEView/src/Options.cpp48
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp4
-rw-r--r--plugins/IEView/src/Utils.cpp2
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rwxr-xr-xplugins/New_GPG/src/gpg_wrapper.cpp6
-rwxr-xr-xplugins/New_GPG/src/main.cpp24
-rwxr-xr-xplugins/New_GPG/src/options.cpp4
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp4
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp2
-rw-r--r--plugins/PackUpdater/Src/Utils.cpp2
-rw-r--r--plugins/Scriver/src/chat/options.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/mir_icolib.cpp18
-rw-r--r--plugins/SmileyAdd/src/general.cpp4
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp10
-rw-r--r--plugins/UserInfoEx/src/mir_icolib.cpp17
-rw-r--r--plugins/UserInfoEx/src/svc_avatar.cpp2
-rw-r--r--plugins/VersionInfo/src/utils.cpp4
-rw-r--r--plugins/YAMN/src/main.cpp8
35 files changed, 126 insertions, 166 deletions
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp
index 35cb33259a..4c1d830711 100644
--- a/plugins/AVS/src/image_utils.cpp
+++ b/plugins/AVS/src/image_utils.cpp
@@ -307,7 +307,7 @@ INT_PTR BmpFilterSaveBitmap(WPARAM wParam,LPARAM lParam)
const char *szFile = (const char*)lParam;
char szFilename[MAX_PATH];
- if ( !CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szFile, (LPARAM)szFilename))
+ if ( !PathToAbsolute(szFile, szFilename))
mir_snprintf(szFilename, SIZEOF(szFilename), "%s", szFile);
int filenameLen = lstrlenA( szFilename );
@@ -324,7 +324,7 @@ INT_PTR BmpFilterSaveBitmapW(WPARAM wParam,LPARAM lParam)
const wchar_t *wszFile = (const wchar_t *)lParam;
wchar_t wszFilename[MAX_PATH];
- if ( !CallService(MS_UTILS_PATHTOABSOLUTEW, (WPARAM)wszFile, (LPARAM)wszFilename))
+ if ( !PathToAbsoluteW(wszFile, wszFilename))
mir_sntprintf(wszFilename, SIZEOF(wszFilename), _T("%s"), wszFile);
int filenameLen = lstrlenW( wszFilename );
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp
index 2ea9980597..cc2a58828a 100644
--- a/plugins/AssocMgr/src/assoclist.cpp
+++ b/plugins/AssocMgr/src/assoclist.cpp
@@ -96,7 +96,7 @@ void CleanupAssocEnabledSettings(void)
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", pszSuffix);
if (!DBGetContactSettingTString(NULL, "AssocMgr", szSetting, &dbv)) {
- if(CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)dbv.ptszVal, (LPARAM)szDLL)) {
+ if( PathToAbsoluteT(dbv.ptszVal, szDLL)) {
/* file still exists? */
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if(hFile == INVALID_HANDLE_VALUE) {
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index f06469adef..c79374a1ec 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -464,7 +464,7 @@ int FillAvatarListFromDB(HWND list, HANDLE hContact)
// Get file in disk
char path[MAX_PATH] = "";
- CallService(MS_UTILS_PATHTOABSOLUTE,(WPARAM) (char *) &dbei.pBlob[i+1],(LPARAM)path);
+ PathToAbsolute((char*)&dbei.pBlob[i+1], path);
TCHAR *filename = mir_a2t(path);
// Add to list
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index dcc2679bcd..4c33dfa38a 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -901,7 +901,7 @@ void * GetHistoryEventText(HANDLE hContact, HANDLE hDbEvent, DBEVENTINFO *dbe, i
if (dbe->pBlob[i] != 0)
{
TCHAR absFile[MAX_PATH] = _T("");
- CallService(MS_UTILS_PATHTOABSOLUTET,(WPARAM) &dbe->pBlob[i], (LPARAM)absFile);
+ PathToAbsoluteT((TCHAR*)&dbe->pBlob[i], absFile);
if(absFile != NULL)
{
HBITMAP hBmp = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM) absFile, IMGL_TCHAR);
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h
index 9ef8337636..6853fcc442 100644
--- a/plugins/ClientChangeNotify/src/Misc.h
+++ b/plugins/ClientChangeNotify/src/Misc.h
@@ -53,7 +53,7 @@ __inline TCString Path_ToAbsolute(TCString &Path)
{
CString Str;
Str.GetBuffer(MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(const char*)TCHAR2ANSI(Path), (LPARAM)(char*)Str);
+ PathToAbsolute( TCHAR2ANSI(Path), Str);
Str.ReleaseBuffer();
return ANSI2TCHAR(Str);
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 107a46958f..4dd2d44ec8 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -587,15 +587,14 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
- DBVARIANT dbv = {0};
- if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ DBVARIANT dbv;
+ if ( !DBGetContactSettingString(NULL, "StatusBar", "BkBitmap", &dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
- if ( ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- char szPath[MAX_PATH];
- if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
- }
+ char szPath[MAX_PATH];
+ if ( PathToAbsolute(dbv.pszVal, szPath))
+ SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
+
db_free(&dbv);
}
}
@@ -1497,7 +1496,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
{
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
+ int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
@@ -1670,9 +1669,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
db_set_b(NULL, module, "UseWinColours", (BYTE)dat->item[indx].useWinColours);
char str[MAX_PATH];
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
- (WPARAM)dat->item[indx].filename,
- (LPARAM)str);
+ int retval = PathToAbsolute(dat->item[indx].filename, str);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename);
else
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 3fd7ed5423..b8fb2365c3 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -894,8 +894,9 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName)
char szRelativePath[MAX_PATH];
GetModuleFileNameA(GetModuleHandle(NULL), szRelativePath, MAX_PATH);
char *str = strrchr( szRelativePath, '\\' );
- if ( str != NULL ) *str = 0;
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szRelativePath, (LPARAM)szFolderPath);
+ if (str != NULL)
+ *str = 0;
+ PathToAbsolute(szRelativePath, szFolderPath);
}
if ( szAccoName ) {
@@ -934,7 +935,7 @@ static HICON CLUI_ExtractIconFromPath(const char *path, BOOL * needFree)
comma = strrchr(file,',');
if (comma == NULL) n = 0;
else {n = atoi(comma+1); *comma = 0;}
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)file, (LPARAM)fileFull);
+ PathToAbsolute(file, fileFull);
hIcon = NULL;
ExtractIconExA(fileFull,n,NULL,&hIcon,1);
if (needFree)
@@ -1648,7 +1649,7 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDes
sid.ptszDefaultFile = fileFull;
if (tszDefaultFile) {
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)tszDefaultFile, (LPARAM)fileFull);
+ PathToAbsoluteT(tszDefaultFile, fileFull);
if ( !FileExists(fileFull))
fileFull[0] = _T('\0');
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index d86d025d4a..1deee93360 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -1778,13 +1778,13 @@ int ske_GetFullFilename(char * buf, char *file, char * skinfolder,BOOL madeAbsol
_snprintf(b2, MAX_PATH,"%s\\%s",(skinfolder == NULL)?SkinPlace:((INT_PTR)skinfolder != -1)?skinfolder:"",file);
else
_snprintf(b2, MAX_PATH,"%s",file);
- if (madeAbsolute)
+ if (madeAbsolute) {
if (b2[0] == '\\' && b2[1] != '\\')
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2+1), (LPARAM)buf);
+ PathToAbsolute(b2+1, buf);
else
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2), (LPARAM)buf);
- else
- memcpy(buf,b2,MAX_PATH);
+ PathToAbsolute(b2, buf);
+ }
+ else memcpy(buf,b2,MAX_PATH);
mir_free(SkinPlace);
return 0;
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 522446fd62..0d804d46bc 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -345,7 +345,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), sd->File );
IniParser::GetSkinFolder( sd->File, skinfolder );
_sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn );
- CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn );
+ PathToAbsoluteT(prfn, imfn);
char * imfn_ch = mir_t2a( imfn );
hPreviewBitmap = ske_LoadGlyphImage( imfn_ch );
mir_free( imfn_ch );
@@ -477,8 +477,8 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg )
TCHAR *SkinsFolder = DBGetStringT( NULL, "ModernData", "SkinsFolder");
if ( !SkinsFolder ) SkinsFolder = mir_tstrdup( _T("Skins"));
- CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)SkinsFolder, (LPARAM)path );
- mir_free_and_nil( SkinsFolder );
+ PathToAbsoluteT(SkinsFolder, path);
+ mir_free_and_nil(SkinsFolder);
AddSkinToList( hwndDlg, TranslateT("Default Skin"), _T("%Default Skin%"));
attrib = GetFileAttributes( path );
@@ -488,10 +488,9 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg )
TCHAR * skinfile;
TCHAR skinfull[MAX_PATH];
skinfile = DBGetStringT( NULL, SKIN, "SkinFile");
- if ( skinfile )
- {
- CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull );
- res = AddSkinToListFullName( hwndDlg, skinfull );
+ if ( skinfile ) {
+ PathToAbsoluteT(skinfile, skinfull);
+ res = AddSkinToListFullName(hwndDlg, skinfull);
mir_free( skinfile );
}
@@ -668,7 +667,7 @@ INT_PTR SvcActiveSkin(WPARAM wParam, LPARAM lParam)
TCHAR skinfull[MAX_PATH];
skinfile = DBGetStringT( NULL, SKIN, "SkinFile");
if ( skinfile ) {
- CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull );
+ PathToAbsoluteT(skinfile, skinfull);
mir_free(skinfile);
return (INT_PTR)mir_tstrdup(skinfull);
}
@@ -722,8 +721,8 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), (LPCTSTR)lParam );
IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder );
_sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn );
- CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn );
- char * imfn_ch = mir_t2a( imfn );
+ PathToAbsoluteT(prfn, imfn);
+ char * imfn_ch = mir_t2a(imfn);
hPreviewBitmap = ske_LoadGlyphImage( imfn_ch );
mir_free( imfn_ch );
diff --git a/plugins/Clist_mw/src/BkgrCfg.cpp b/plugins/Clist_mw/src/BkgrCfg.cpp
index 33932c7e5f..5dced4e4db 100644
--- a/plugins/Clist_mw/src/BkgrCfg.cpp
+++ b/plugins/Clist_mw/src/BkgrCfg.cpp
@@ -71,7 +71,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
{
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
+ int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
@@ -232,9 +232,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
{
char str[MAX_PATH];
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
- (WPARAM)dat->item[indx].filename,
- (LPARAM)str);
+ int retval = PathToAbsolute(dat->item[indx].filename, str);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename);
else
diff --git a/plugins/Clist_mw/src/clcopts.cpp b/plugins/Clist_mw/src/clcopts.cpp
index 5d74eddc72..63ee91a856 100644
--- a/plugins/Clist_mw/src/clcopts.cpp
+++ b/plugins/Clist_mw/src/clcopts.cpp
@@ -327,14 +327,12 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- char szPath[MAX_PATH];
- if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
- }
- else
- mir_free(dbv.pszVal);
+ char szPath[MAX_PATH];
+ if ( PathToAbsolute(dbv.pszVal, szPath))
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, szPath);
+
+ mir_free(dbv.pszVal);
}
WORD bmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
@@ -447,16 +445,16 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
- { DBVARIANT dbv;
+ {
+ DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- char szPath[MAX_PATH];
- if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
- }
- else mir_free(dbv.pszVal);
+ char szPath[MAX_PATH];
+ if ( PathToAbsolute(dbv.pszVal, szPath))
+ SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
+
+ mir_free(dbv.pszVal);
}
}
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index f30e910dd3..3e63f9ceff 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -139,7 +139,7 @@ int GetConnectingIconForProtoCount(char *szProto)
_snprintf(szFullPath, SIZEOF(szFullPath), "%s\\Icons\\proto_conn_%s.dll", szPath, szProto);
lstrcpynA(file,szFullPath,SIZEOF(file));
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)file, (LPARAM)fileFull);
+ PathToAbsolute(file, fileFull);
ret = ExtractIconExA(fileFull,-1,NULL,NULL,1);
if (ret == 0&&!strcmp(szProto,"ICQ")) ret = 8;
return ret;
@@ -160,7 +160,7 @@ static HICON ExtractIconFromPath(const char *path)
comma = strrchr(file,',');
if (comma == NULL) n = 0;
else {n = atoi(comma+1); *comma = 0;}
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)file, (LPARAM)fileFull);
+ PathToAbsolute(file, fileFull);
#ifdef _DEBUG
{
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index bf2cb0c777..f5747d4246 100644
--- a/plugins/Clist_nicer/src/clcopts.cpp
+++ b/plugins/Clist_nicer/src/clcopts.cpp
@@ -741,10 +741,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendMessage(hwndDlg, WM_USER + 11, 0, 0);
{
DBVARIANT dbv;
-
if ( !cfg::getTString(NULL, "CLC", "BkBitmap", &dbv)) {
TCHAR szPath[MAX_PATH];
- if (CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM) dbv.ptszVal, (LPARAM)szPath))
+ if ( PathToAbsoluteT(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
DBFreeVariant(&dbv);
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index e6e1a520f3..562fc411e0 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -143,7 +143,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)DEFAULT_SKIN_FOLDER, (LPARAM)g_szSkinLib);
+ PathToAbsoluteT(DEFAULT_SKIN_FOLDER, g_szSkinLib);
RegisterIcons();
diff --git a/plugins/FlashAvatars/src/cflash.cpp b/plugins/FlashAvatars/src/cflash.cpp
index 00c1226331..f571a4ac7c 100644
--- a/plugins/FlashAvatars/src/cflash.cpp
+++ b/plugins/FlashAvatars/src/cflash.cpp
@@ -174,9 +174,10 @@ static void __cdecl loadFlash_Thread(void *p) {
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
mir_sntprintf(path, MAX_PATH, _T("%s\\%s"), tmpPath, _T("Flash"));
mir_free(tmpPath);
- } else
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)(_T("Flash")), (LPARAM)path);
- } else {
+ }
+ else PathToAbsoluteT( _T("Flash"), path);
+ }
+ else {
if(_tcslen(path) && path[_tcslen(path)-1]=='\\')
path[_tcslen(path)-1] = 0;
}
@@ -600,11 +601,11 @@ static int systemModulesLoaded(WPARAM /*wParam*/, LPARAM /*lParam*/)
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
mir_sntprintf(path, MAX_PATH, _T("%s\\%s\\"), tmpPath, _T("Flash"));
mir_free(tmpPath);
- } // default for older Mirandas
- else
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)(_T("Flash\\")), (LPARAM)path);
- hAvatarsFolder = FoldersRegisterCustomPathT("Flash Avatars", "Avatars Cache", path);
+ }
+ // default for older Mirandas
+ else PathToAbsoluteT( _T("Flash\\"), path);
+ hAvatarsFolder = FoldersRegisterCustomPathT("Flash Avatars", "Avatars Cache", path);
return 0;
}
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp
index e9ff0922f5..f3864a46d0 100644
--- a/plugins/IEView/src/Options.cpp
+++ b/plugins/IEView/src/Options.cpp
@@ -1538,27 +1538,25 @@ void Options::init() {
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setSRMMBackgroundFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setSRMMCssFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ PathToAbsolute(dbv.pszVal, tmpPath);
proto->setSRMMTemplateFilename(tmpPath);
DBFreeVariant(&dbv);
}
@@ -1573,27 +1571,25 @@ void Options::init() {
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setChatBackgroundFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setChatCssFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ PathToAbsolute(dbv.pszVal, tmpPath);
proto->setChatTemplateFilename(tmpPath);
DBFreeVariant(&dbv);
}
@@ -1608,27 +1604,25 @@ void Options::init() {
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setHistoryBackgroundFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE) && strncmp(tmpPath, "http://", 7)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ if ( strncmp(tmpPath, "http://", 7))
+ PathToAbsolute(dbv.pszVal, tmpPath);
+
proto->setHistoryCssFilename(tmpPath);
DBFreeVariant(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)tmpPath);
- }
+ PathToAbsolute(dbv.pszVal, tmpPath);
proto->setHistoryTemplateFilename(tmpPath);
DBFreeVariant(&dbv);
}
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index 3cc39d9d43..6a65eab30c 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -73,8 +73,8 @@ char *TemplateHTMLBuilder::getAvatar(HANDLE hContact, const char * szProto) {
if (result == NULL) {
/* relative -> absolute */
_tcscpy (tmpPath, dbv.ptszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTET) && _tcsncmp(tmpPath, _T("http://"), 7))
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)dbv.ptszVal, (LPARAM)tmpPath);
+ if ( _tcsncmp(tmpPath, _T("http://"), 7))
+ PathToAbsoluteT(dbv.ptszVal, tmpPath);
result = tmpPath;
}
diff --git a/plugins/IEView/src/Utils.cpp b/plugins/IEView/src/Utils.cpp
index 5c52ae696a..d9a3f85043 100644
--- a/plugins/IEView/src/Utils.cpp
+++ b/plugins/IEView/src/Utils.cpp
@@ -30,7 +30,7 @@ HANDLE* Utils::hServices = NULL;
const wchar_t *Utils::getBaseDir() {
char temp[MAX_PATH];
base_dir[0] = '\0';
- long tlen = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"miranda32.exe", (LPARAM)temp);
+ long tlen = PathToAbsolute("miranda32.exe", temp);
if (tlen) {
temp[tlen - 13]=0;
MultiByteToWideChar(CP_ACP, 0, temp, (int)strlen(temp), base_dir, MAX_PATH);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 265682ee8d..eb7e51567a 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -544,7 +544,7 @@ bool bReadMirandaDirAndPath()
char tmp[MAX_PATH];
TCHAR *tmp2;
_tcscpy( szDBPath , pszDbPathError );
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"miranda32.exe", (LPARAM)tmp);
+ PathToAbsolute("miranda32.exe", tmp);
tmp2 = mir_utf8decodeT(tmp);
sMirandaPath = tmp2;
sMirandaPath.erase(sMirandaPath.find_last_of(_T("\\")));
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index 80fdc8279d..af4a2da89a 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -49,7 +49,7 @@ void PreviewSound(HWND hList)
}
else
{
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)buff, (LPARAM)stzSoundPath);
+ PathToAbsoluteT(buff, stzSoundPath);
PlaySound(stzSoundPath, NULL, SND_ASYNC | SND_FILENAME);
}
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 3dd69e97a5..d7418dbc1e 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -741,7 +741,7 @@ void PlayChangeSound(HANDLE hContact, WORD oldStatus, WORD newStatus)
if (stzSoundFile[0]) {
//Now make path to IndSound absolute, as it isn't registered
TCHAR stzSoundPath[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)stzSoundFile, (LPARAM)stzSoundPath);
+ PathToAbsoluteT(stzSoundFile, stzSoundPath);
PlaySound(stzSoundPath, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
return;
}
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp
index 5f9df7dfd1..bfa359d69a 100755
--- a/plugins/New_GPG/src/gpg_wrapper.cpp
+++ b/plugins/New_GPG/src/gpg_wrapper.cpp
@@ -74,7 +74,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
file_descriptor_sink sout(pout.sink, close_handle);
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
child c = execute(set_args(argv), bind_stdout(sout), /*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path)));
_child = &c;
@@ -185,7 +185,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, string *aoutp
// file_descriptor_source sin(pin.source, close_handle);
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
//execute(set_args(argv), bind_stdout(sout), bind_stdin(sin), show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path)));
child c = execute(set_args(argv), /*bind_stdin(sin), */inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path)));
@@ -230,7 +230,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, string *aoutp
ctx.environment["LC_ALL"] = "English";
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
ctx.work_directory = mir_path;
delete [] mir_path;
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index c70022a8d9..3b5f63ea19 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -860,7 +860,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
bool gpg_exists = false, lang_exists = false;
{
char *mir_path = (char*)mir_alloc(sizeof(char) * MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
tmp = mir_a2t(mir_path);
mir_free(mir_path);
@@ -888,20 +888,12 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, _T("Software\\GNU\\GnuPG"), _T("gpgProgram"), 0, path, &len) == ERROR_SUCCESS)?path:_T(""));
if(tmp[0])
- {
if(!boost::filesystem::exists(tmp))
- {
MessageBox(0, TranslateT("wrong gpg binary location found in system.\nplease choose another location"), TranslateT("Warning"), MB_OK);
- }
-/* char *mir_path = (char*)mir_alloc(MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
- SetCurrentDirectoryA(mir_path);
- mir_free(mir_path); */
- }
}
- else
- tmp = mir_wstrdup(path);
+ else tmp = mir_wstrdup(path);
mir_free(path);
+
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
bool bad_version = false;
if(gpg_exists/* && lang_exists*/)
@@ -942,7 +934,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
mir_free(tmp);
char *mir_path = (char*)mir_alloc(sizeof(char) * MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
strcat(mir_path, "\\gpg");
if(_access(mir_path, 0) != -1)
{
@@ -980,7 +972,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
@@ -998,7 +990,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
@@ -1015,7 +1007,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if(tmp[0])
{
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
delete [] mir_path;
if(!boost::filesystem::exists(tmp))
@@ -1093,7 +1085,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if(tmp[0])
{
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
delete [] mir_path;
if(!boost::filesystem::exists(tmp))
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 4e63d6f17d..32cc4160ac 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -548,7 +548,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
@@ -566,7 +566,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 8e56388172..b6e7cc8fc4 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -1135,7 +1135,7 @@ bool isGPGValid()
mir_free(tmp);
TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH);
char *mir_path = (char*)mir_alloc(MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
tmp = mir_a2t(mir_path);
mir_free(mir_path);
@@ -2207,7 +2207,7 @@ void clean_temp_dir()
{
using namespace boost::filesystem;
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
wstring path = toUTF16(mir_path);
SetCurrentDirectoryA(mir_path);
delete [] mir_path;
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index a4e12ee591..4f702b1931 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -858,7 +858,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName)
if (DBGetContactSettingString(NULL, "SkinSounds", pszSoundName, &dbv)==0) {
char szFull[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szFull);
+ PathToAbsolute(dbv.pszVal, szFull);
//NotifyEventHooks(hPlayEvent, 0, (LPARAM)szFull);
{
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp
index 2e7f8ba142..5e438cd934 100644
--- a/plugins/PackUpdater/Src/Utils.cpp
+++ b/plugins/PackUpdater/Src/Utils.cpp
@@ -290,7 +290,7 @@ static void CheckUpdates(void *)
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath);
else
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)tszBuff, (LPARAM)pluginFolgerName);
+ PathToAbsoluteT(tszBuff, pluginFolgerName);
if ((IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolgerName))) //check if plugin disabled or not exists
continue;
}
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index 1057196dbf..eba15ce208 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -564,7 +564,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
DBWriteContactSettingTString(NULL, "Chat", "LogDirectory", pszText1);
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)pszText1, (LPARAM)g_Settings.pszLogDir);
+ PathToAbsoluteT(pszText1, g_Settings.pszLogDir);
free(pszText1);
}
else {
diff --git a/plugins/SendScreenshotPlus/src/mir_icolib.cpp b/plugins/SendScreenshotPlus/src/mir_icolib.cpp
index 4255e2e461..5082fc80b8 100644
--- a/plugins/SendScreenshotPlus/src/mir_icolib.cpp
+++ b/plugins/SendScreenshotPlus/src/mir_icolib.cpp
@@ -101,13 +101,10 @@ LPTSTR IcoLib_GetDefaultIconFileName()
};
TCHAR absolute[MAX_PATH];
- for (INT i = 0; i < SIZEOF(path); i++)
- {
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)path[i], (LPARAM)absolute);
- if (PathFileExists(absolute))
- {
+ for (INT i = 0; i < SIZEOF(path); i++) {
+ PathToAbsoluteT(path[i], absolute);
+ if ( PathFileExists(absolute))
return path[i];
- }
}
return NULL;
}
@@ -130,13 +127,10 @@ static VOID IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
if (szIconPack)
{
TCHAR szAbsolutePath[MAX_PATH];
- HMODULE hIconDll;
+ PathToAbsoluteT(szIconPack, szAbsolutePath);
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)szIconPack, (LPARAM)szAbsolutePath);
-
- hIconDll = LoadLibrary(szAbsolutePath);
- if (hIconDll)
- {
+ HMODULE hIconDll = LoadLibrary(szAbsolutePath);
+ if (hIconDll) {
CHAR szFileVersion[64];
if (!LoadStringA(hIconDll, IDS_ICOPACKVERSION, szFileVersion, sizeof(szFileVersion)) ||
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp
index 4f5c86c811..02d20ea0ab 100644
--- a/plugins/SmileyAdd/src/general.cpp
+++ b/plugins/SmileyAdd/src/general.cpp
@@ -163,11 +163,11 @@ void pathToAbsolute(const bkstring& pSrc, bkstring& pOut)
{
TCHAR szExpPath[MAX_PATH];
ExpandEnvironmentStrings(pSrc.c_str(), szExpPath, SIZEOF(szExpPath));
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)szExpPath, (LPARAM)szOutPath);
+ PathToAbsoluteT(szExpPath, szOutPath);
}
else
{
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)szVarPath, (LPARAM)szOutPath);
+ PathToAbsoluteT(szVarPath, szOutPath);
mir_free(szVarPath);
}
pOut = szOutPath;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
index c00751dabe..132d5b4107 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
@@ -234,19 +234,17 @@ static VOID GetInitialDir(LPSTR pszInitialDir)
// is some standard path defined
if (!DB::Setting::GetStatic(0, MODNAME, "vCardPath", szRelative, SIZEOF(szRelative))) {
- if (!CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szRelative, (WPARAM)pszInitialDir))
+ if ( !PathToAbsolute(szRelative, pszInitialDir))
strcpy(pszInitialDir, szRelative);
}
else if (//try to use environment variables supported by pathpatch of db3xSA
!ServiceExists(MS_DB_GETPROFILEPATH_BASIC) ||
- !CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)PROFILEPATH "\\" PROFILENAME, (WPARAM)pszInitialDir)
- ) {
+ !PathToAbsolute(PROFILEPATH "\\" PROFILENAME, pszInitialDir)) {
// use standard path to absolute
- if (!CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"", (WPARAM)pszInitialDir))
+ if ( !PathToAbsolute("", pszInitialDir))
*pszInitialDir = 0;
}
- else
- *pszInitialDir = 0;
+ else *pszInitialDir = 0;
}
/**
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp
index 2b77314895..1cc6a5c59a 100644
--- a/plugins/UserInfoEx/src/mir_icolib.cpp
+++ b/plugins/UserInfoEx/src/mir_icolib.cpp
@@ -140,13 +140,10 @@ LPTSTR IcoLib_GetDefaultIconFileName()
};
TCHAR absolute[MAX_PATH];
- for (INT i = 0; i < SIZEOF(path); i++)
- {
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)path[i], (LPARAM)absolute);
- if (PathFileExists(absolute))
- {
+ for (INT i = 0; i < SIZEOF(path); i++) {
+ PathToAbsoluteT(path[i], absolute);
+ if ( PathFileExists(absolute))
return path[i];
- }
}
return NULL;
}
@@ -167,12 +164,10 @@ static VOID IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
{
if (szIconPack)
{
- TCHAR szAbsolutePath[MAX_PATH];
- HMODULE hIconDll;
-
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)szIconPack, (LPARAM)szAbsolutePath);
+ TCHAR szAbsolutePath[MAX_PATH];
+ PathToAbsoluteT(szIconPack, szAbsolutePath);
- hIconDll = LoadLibrary(szAbsolutePath);
+ HMODULE hIconDll = LoadLibrary(szAbsolutePath);
if (hIconDll)
{
CHAR szFileVersion[64];
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp
index 450538e02f..129fc95084 100644
--- a/plugins/UserInfoEx/src/svc_avatar.cpp
+++ b/plugins/UserInfoEx/src/svc_avatar.cpp
@@ -177,7 +177,7 @@ namespace NServices
absolute[0] = '\0';
// check if file exists
- if (!CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)absolute))
+ if ( !PathToAbsolute(dbv.pszVal, absolute))
{
FILE *f = fopen(absolute, "rb");
if (f) {
diff --git a/plugins/VersionInfo/src/utils.cpp b/plugins/VersionInfo/src/utils.cpp
index 79ab0b564e..b89eb94a46 100644
--- a/plugins/VersionInfo/src/utils.cpp
+++ b/plugins/VersionInfo/src/utils.cpp
@@ -86,10 +86,10 @@ TCHAR *RelativePathToAbsolute(TCHAR *szRelative, TCHAR *szAbsolute, size_t size)
{
if (size < MAX_PATH) {
TCHAR buffer[MAX_PATH]; //new path should be at least MAX_PATH chars
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM) szRelative, (LPARAM) buffer);
+ PathToAbsoluteT(szRelative, buffer);
_tcsncpy(szAbsolute, buffer, size);
}
- else CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM) szRelative, (LPARAM) szAbsolute);
+ else PathToAbsoluteT(szRelative, szAbsolute);
return szAbsolute;
}
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 96344c2f80..c5bc34e0ed 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -332,13 +332,7 @@ extern "C" int __declspec(dllexport) Load(void)
YAMN_STATUS = ID_STATUS_OFFLINE;
// we get the Miranda Root Path
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTET))
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)_T("."), (LPARAM)szMirandaDir);
- else {
- GetModuleFileName(GetModuleHandle(NULL), szMirandaDir, MAX_PATH);
- TCHAR* str2 = _tcsrchr(szMirandaDir, '\\');
- if (str2 != NULL) *str2 = 0;
- }
+ PathToAbsoluteT( _T("."), szMirandaDir);
// retrieve the current profile name
CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn