diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/AssocMgr | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AssocMgr')
-rw-r--r-- | plugins/AssocMgr/src/assoclist.cpp | 8 | ||||
-rw-r--r-- | plugins/AssocMgr/src/dde.cpp | 12 | ||||
-rw-r--r-- | plugins/AssocMgr/src/main.cpp | 10 | ||||
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 44 |
4 files changed, 37 insertions, 37 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 495cb4f125..7305022b0b 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -218,14 +218,14 @@ static ASSOCDATA* CopyAssocItem(const ASSOCDATA *assoc) assoc2 = (ASSOCDATA*)mir_alloc(sizeof(ASSOCDATA));
if (assoc2 == NULL) return NULL;
assoc2->pszClassName = mir_strdup(assoc->pszClassName);
- assoc2->pszDescription = mir_tstrdup(assoc->pszDescription);
+ assoc2->pszDescription = mir_wstrdup(assoc->pszDescription);
assoc2->hInstance = assoc->hInstance;
assoc2->nIconResID = assoc->nIconResID;
assoc2->pszService = mir_strdup(assoc->pszService);
assoc2->flags = assoc->flags;
assoc2->pszFileExt = mir_strdup(assoc->pszFileExt);
assoc2->pszMimeType = mir_strdup(assoc->pszMimeType);
- assoc2->pszVerbDesc = mir_tstrdup(assoc->pszVerbDesc);
+ assoc2->pszVerbDesc = mir_wstrdup(assoc->pszVerbDesc);
if (assoc2->pszClassName == NULL || assoc2->pszDescription == NULL ||
(assoc2->pszFileExt == NULL && assoc->pszFileExt != NULL)) {
mir_free(assoc2->pszClassName); // does NULL check
@@ -268,9 +268,9 @@ static wchar_t* GetAssocTypeDesc(const ASSOCDATA *assoc) {
static wchar_t szDesc[32];
if (assoc->pszFileExt == NULL)
- mir_sntprintf(szDesc, L"%hs:", assoc->pszClassName);
+ mir_snwprintf(szDesc, L"%hs:", assoc->pszClassName);
else
- mir_sntprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
+ mir_snwprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
return szDesc;
}
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index aca64350e7..f6c52a67df 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -79,7 +79,7 @@ static wchar_t* GetExecuteParam(wchar_t **ppszString) *(p++) = 0;
if (fQuoted && *p == ',') p++;
}
- else p = &pszParam[mir_tstrlen(pszParam)];
+ else p = &pszParam[mir_wstrlen(pszParam)];
*ppszString = p;
return pszParam;
}
@@ -115,10 +115,10 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA if (pszArg != NULL) {
/* we are inside miranda here, we make it async so the shell does
* not timeout regardless what the plugins try to do. */
- if (!mir_tstrcmpi(pszAction, L"file"))
- CallFunctionAsync(FileActionAsync, mir_tstrdup(pszArg));
- else if (!mir_tstrcmpi(pszAction, L"url"))
- CallFunctionAsync(UrlActionAsync, mir_tstrdup(pszArg));
+ if (!mir_wstrcmpi(pszAction, L"file"))
+ CallFunctionAsync(FileActionAsync, mir_wstrdup(pszArg));
+ else if (!mir_wstrcmpi(pszAction, L"url"))
+ CallFunctionAsync(UrlActionAsync, mir_wstrdup(pszArg));
}
GlobalUnlock(hCommand);
}
@@ -170,7 +170,7 @@ static HANDLE StartupMainProcess(wchar_t *pszDatabasePath) p = wcsrchr(szPath, '\\');
if (p != NULL) { *p = 0; p = wcsrchr(szPath, '\\'); }
if (p == NULL) return NULL;
- mir_tstrcpy(++p, L"miranda32.exe");
+ mir_wstrcpy(++p, L"miranda32.exe");
/* inherit startup data from RunDll32 process */
STARTUPINFO si;
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp index 4f0c116c36..ddc2075d52 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -48,27 +48,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static void InstallFile(const wchar_t *pszFileName,const wchar_t *pszDestSubDir)
{
wchar_t szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
- if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_tstrlen(pszFileName)))
+ if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_wstrlen(pszFileName)))
return;
wchar_t *p = wcsrchr(szFileFrom,'\\');
if (p != NULL)
*(++p) = 0;
- mir_tstrcat(szFileFrom,pszFileName); /* buffer safe */
+ mir_wstrcat(szFileFrom,pszFileName); /* buffer safe */
HANDLE hFile = CreateFile(szFileFrom,0,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);
if (hFile == INVALID_HANDLE_VALUE)
return;
CloseHandle(hFile);
- if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_tstrlen(pszDestSubDir)-(int)mir_tstrlen(pszFileName)))
+ if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_wstrlen(pszDestSubDir)-(int)mir_wstrlen(pszFileName)))
return;
p = wcsrchr(szFileTo,'\\');
if (p)
*(++p)=0;
- mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
+ mir_wstrcat(szFileTo,pszDestSubDir); /* buffer safe */
CreateDirectory(szFileTo,NULL);
- mir_tstrcat(szFileTo,pszFileName); /* buffer safe */
+ mir_wstrcat(szFileTo,pszFileName); /* buffer safe */
if ( !MoveFile(szFileFrom,szFileTo) && GetLastError() == ERROR_ALREADY_EXISTS) {
DeleteFile(szFileTo);
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 3f079b7810..842ce654a3 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -33,7 +33,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
- mir_sntprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
+ mir_snwprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
MessageBox(NULL, szMsg, TranslateT("Registry warning"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL);
if (pszErr != NULL) LocalFree(pszErr);
mir_free(pszInfo2); /* does NULL check */
@@ -133,7 +133,7 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) if (p)
*p = 0;
}
- else mir_tstrcpy(szDbFile, L"%1"); /* buffer safe */
+ else mir_wstrcpy(szDbFile, L"%1"); /* buffer safe */
if ( !GetModuleFileName(fMirExe ? NULL : hInst, szExe, _countof(szExe)))
return NULL;
@@ -147,7 +147,7 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) /* ensure the command line is not too long */
GetShortPathName(szExe, szExe, _countof(szExe));
/* surround by quotes if failed */
- size_t len = mir_tstrlen(szExe);
+ size_t len = mir_wstrlen(szExe);
if ( wcschr(szExe,' ') != NULL && (len+2) < _countof(szExe)) {
memmove(szExe, szExe+1, (len+1)*sizeof(wchar_t));
szExe[len+2] = szExe[0] = '\"';
@@ -156,15 +156,15 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) }
wchar_t tszBuffer[1024];
- mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
- return mir_tstrdup(tszBuffer);
+ mir_snwprintf(tszBuffer, pszFmt, szExe, szDbFile);
+ return mir_wstrdup(tszBuffer);
}
static BOOL IsValidRunCommand(const wchar_t *pszRunCmd)
{
wchar_t *buf,*pexe,*pargs;
wchar_t szFullExe[MAX_PATH],*pszFilePart;
- buf=mir_tstrcpy((wchar_t*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
+ buf=mir_wstrcpy((wchar_t*)_alloca((mir_wstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
/* split into executable path and arguments */
if (buf[0]=='\"') {
pargs=wcschr(&buf[1],'\"');
@@ -178,7 +178,7 @@ static BOOL IsValidRunCommand(const wchar_t *pszRunCmd) }
if (SearchPath(NULL,pexe,L".exe",_countof(szFullExe),szFullExe,&pszFilePart)) {
if (pszFilePart!=NULL)
- if (!mir_tstrcmpi(pszFilePart,L"rundll32.exe") || !mir_tstrcmpi(pszFilePart,L"rundll.exe")) {
+ if (!mir_wstrcmpi(pszFilePart,L"rundll32.exe") || !mir_wstrcmpi(pszFilePart,L"rundll.exe")) {
/* split into dll path and arguments */
if (pargs[0]=='\"') {
++pargs;
@@ -203,7 +203,7 @@ wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID) if ((cch=GetModuleFileName(hModule,szModule,_countof(szModule))) != 0) {
pszIconLoc=(wchar_t*)mir_alloc((cch+=8)*sizeof(wchar_t));
if (pszIconLoc!=NULL)
- mir_sntprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
+ mir_snwprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
}
return pszIconLoc;
}
@@ -216,7 +216,7 @@ wchar_t *MakeAppFileName(BOOL fMirExe) psz=wcsrchr(szExe,'\\');
if (psz!=NULL) ++psz;
else psz=szExe;
- return mir_tstrdup(psz);
+ return mir_wstrdup(psz);
}
return NULL;
}
@@ -253,7 +253,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const HKEY hSubKey;
LONG res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
if (!res) {
- res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(wchar_t));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_wstrlen(pszVal)+1)*sizeof(wchar_t));
RegCloseKey(hSubKey);
}
return res;
@@ -262,9 +262,9 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const // hKey must have been opened with KEY_SET_VALUE access right
static void SetRegStrPrefixValue(HKEY hKey,const wchar_t *pszValPrefix,const wchar_t *pszVal)
{
- size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(wchar_t);
+ size_t dwSize = (mir_wstrlen(pszVal)+mir_wstrlen(pszValPrefix)+1)*sizeof(wchar_t);
wchar_t *pszStr = (wchar_t*)_alloca(dwSize);
- mir_tstrcat(mir_tstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
+ mir_wstrcat(mir_wstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE*)pszStr, (int)dwSize);
}
@@ -304,7 +304,7 @@ static BOOL IsRegStrValue(HKEY hKey,const wchar_t *pszValName,const wchar_t *psz BOOL fSame=FALSE;
wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
- fSame=!mir_tstrcmp(pszVal,pszCmpVal);
+ fSame=!mir_wstrcmp(pszVal,pszCmpVal);
mir_free(pszVal);
}
return fSame;
@@ -601,7 +601,7 @@ BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,cons if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,L"URL:",pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_wstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,L"DefaultIcon",pszIconLoc);
/* url protocol */
@@ -629,16 +629,16 @@ BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,cons if ((res=RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if (pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
- else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_wstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_wstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -993,7 +993,7 @@ void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wcha /* filename */
if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
- RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,L"NoOpenWith");
else RegSetValueEx(hExeKey,L"NoOpenWith",0,REG_SZ,NULL,0);
@@ -1006,14 +1006,14 @@ void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wcha /* verb */
if (!RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_wstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_wstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -1101,7 +1101,7 @@ void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt wchar_t *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(wchar_t));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_wstrlen(pszFileDesc)+1)*sizeof(wchar_t));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1154,7 +1154,7 @@ BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd) /* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_wstrlen(pszRunCmd)+1)*sizeof(wchar_t));
RegCloseKey(hRunKey);
}
return fSuccess;
|