diff options
Diffstat (limited to 'plugins/AssocMgr/src')
-rw-r--r-- | plugins/AssocMgr/src/assoclist.cpp | 2 | ||||
-rw-r--r-- | plugins/AssocMgr/src/dde.cpp | 4 | ||||
-rw-r--r-- | plugins/AssocMgr/src/main.cpp | 10 | ||||
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 72 | ||||
-rw-r--r-- | plugins/AssocMgr/src/test.cpp | 14 | ||||
-rw-r--r-- | plugins/AssocMgr/src/utils.cpp | 2 |
6 files changed, 52 insertions, 52 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index a1dce06bdf..7d12f4686f 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -527,7 +527,7 @@ static INT_PTR ServiceAddNewUrlType(WPARAM, LPARAM lParam) return 1;
if(utd->pszService == NULL)
return 2;
- if(utd->pszProtoPrefix == NULL || utd->pszProtoPrefix[lstrlenA(utd->pszProtoPrefix)-1]!= ':')
+ if(utd->pszProtoPrefix == NULL || utd->pszProtoPrefix[mir_strlen(utd->pszProtoPrefix)-1]!= ':')
return 2;
char *pszClassName = MakeUrlClassName(utd->pszProtoPrefix);
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index 71e719e760..641e193359 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -80,7 +80,7 @@ static TCHAR* GetExecuteParam(TCHAR **ppszString) if(p!=NULL) {
*(p++)=0;
if(fQuoted && *p==_T(',')) p++;
- } else p=&pszParam[lstrlen(pszParam)];
+ } else p=&pszParam[mir_tstrlen(pszParam)];
*ppszString=p;
return pszParam;
}
@@ -173,7 +173,7 @@ static HANDLE StartupMainProcess(TCHAR *pszDatabasePath) p=_tcsrchr(szPath,_T('\\'));
if(p!=NULL) { *p=0; p=_tcsrchr(szPath,_T('\\')); }
if(p==NULL) return NULL;
- lstrcpy(++p,_T("miranda32.exe"));
+ mir_tstrcpy(++p,_T("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 a40c0ecd34..fcf1d3543e 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -48,27 +48,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
{
TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
- if ( !GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
+ if ( !GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-mir_tstrlen(pszFileName)))
return;
TCHAR *p = _tcsrchr(szFileFrom,_T('\\'));
if (p != NULL)
*(++p) = 0;
- lstrcat(szFileFrom,pszFileName); /* buffer safe */
+ mir_tstrcat(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,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
+ if ( !GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-mir_tstrlen(pszDestSubDir)-mir_tstrlen(pszFileName)))
return;
p = _tcsrchr(szFileTo,_T('\\'));
if (p)
*(++p)=0;
- lstrcat(szFileTo,pszDestSubDir); /* buffer safe */
+ mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
CreateDirectory(szFileTo,NULL);
- lstrcat(szFileTo,pszFileName); /* buffer safe */
+ mir_tstrcat(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 9fa97d0e61..ded3aca55b 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -98,7 +98,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, // mir_free() the return value
char *MakeFileClassName(const char *pszFileExt)
{
- int cbLen = lstrlenA(pszFileExt)+12;
+ int cbLen = mir_strlen(pszFileExt)+12;
char *pszClass = (char*)mir_alloc(cbLen);
if (pszClass != NULL)
/* using correctly formated PROGID */
@@ -112,7 +112,7 @@ char *MakeUrlClassName(const char *pszUrl) char *pszClass = mir_strdup(pszUrl);
if (pszClass != NULL)
/* remove trailing : */
- pszClass[lstrlenA(pszClass)-1]=0;
+ pszClass[mir_strlen(pszClass)-1]=0;
return pszClass;
}
@@ -133,7 +133,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) if (p)
*p = 0;
}
- else lstrcpy(szDbFile, _T("%1")); /* buffer safe */
+ else mir_tstrcpy(szDbFile, _T("%1")); /* buffer safe */
if ( !GetModuleFileName(fMirExe ? NULL : hInst, szExe, SIZEOF(szExe)))
return NULL;
@@ -147,7 +147,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) /* ensure the command line is not too long */
GetShortPathName(szExe, szExe, SIZEOF(szExe));
/* surround by quotes if failed */
- DWORD len = lstrlen(szExe);
+ DWORD len = mir_tstrlen(szExe);
if ( _tcschr(szExe,_T(' ')) != NULL && (len+2) < SIZEOF(szExe)) {
MoveMemory(szExe, szExe+1, (len+1)*sizeof(TCHAR));
szExe[len+2] = szExe[0] = _T('\"');
@@ -164,7 +164,7 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd) {
TCHAR *buf,*pexe,*pargs;
TCHAR szFullExe[MAX_PATH],*pszFilePart;
- buf=lstrcpy((TCHAR*)_alloca((lstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
+ buf=mir_tstrcpy((TCHAR*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
/* split into executable path and arguments */
if (buf[0]==_T('\"')) {
pargs=_tcschr(&buf[1],_T('\"'));
@@ -253,7 +253,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const T 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,(lstrlen(pszVal)+1)*sizeof(TCHAR));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(mir_tstrlen(pszVal)+1)*sizeof(TCHAR));
RegCloseKey(hSubKey);
}
return res;
@@ -262,10 +262,10 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const T // hKey must have been opened with KEY_SET_VALUE access right
static void SetRegStrPrefixValue(HKEY hKey,const TCHAR *pszValPrefix,const TCHAR *pszVal)
{
- DWORD dwSize=(lstrlen(pszVal)+lstrlen(pszValPrefix)+1)*sizeof(TCHAR);
+ DWORD dwSize=(mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(TCHAR);
TCHAR *pszStr=(TCHAR*)mir_alloc(dwSize);
if (pszStr==NULL) return;
- lstrcat(lstrcpy(pszStr,pszValPrefix),pszVal); /* buffer safe */
+ mir_tstrcat(mir_tstrcpy(pszStr,pszValPrefix),pszVal); /* buffer safe */
RegSetValueEx(hKey,NULL,0,REG_SZ,(BYTE*)pszStr,dwSize);
mir_free(pszStr);
}
@@ -381,7 +381,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe if ((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
if (nMaxSubKeyLen>nMaxValNameLen) nMaxValNameLen=nMaxSubKeyLen;
/* prepare buffer */
- nDbPrefixLen=(DWORD)lstrlenA(*param->ppszDbPrefix)+lstrlenA(pszSubKey)+1;
+ nDbPrefixLen=(DWORD)mir_strlen(*param->ppszDbPrefix)+mir_strlen(pszSubKey)+1;
cchName=nDbPrefixLen+nMaxValNameLen+3;
if (cchName>*param->pdwDbPrefixSize) {
pszName=(char*)mir_realloc(*param->ppszDbPrefix,cchName);
@@ -389,7 +389,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe *param->ppszDbPrefix=pszName;
*param->pdwDbPrefixSize=cchName;
}
- lstrcatA(lstrcatA(*param->ppszDbPrefix,pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(*param->ppszDbPrefix,pszSubKey),"\\"); /* buffer safe */
/* enum values */
pszName=(char*)mir_alloc(nMaxValNameLen+1);
if (nMaxValSize==0) nMaxValSize=1;
@@ -401,7 +401,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe cbData=nMaxValSize;
if ((res=RegEnumValueA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
(*param->ppszDbPrefix)[nDbPrefixLen]=0;
- lstrcatA(*param->ppszDbPrefix,pszName); /* buffer safe */
+ mir_strcat(*param->ppszDbPrefix,pszName); /* buffer safe */
ptszName=a2t(pszName);
if (ptszName!=NULL) {
if (!RegQueryValueEx(hKey,ptszName,NULL,&dwType,pData,&cbData)) {
@@ -444,7 +444,7 @@ static void BackupRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPrefi param.ppszDbPrefix=(char**)&pszDbPrefix;
pszDbPrefix=mir_strdup(pszDbPrefix);
if (pszDbPrefix!=NULL) {
- dwDbPrefixSize=lstrlenA(pszDbPrefix)+1;
+ dwDbPrefixSize=mir_strlen(pszDbPrefix)+1;
BackupRegTree_Worker(hKey,pszSubKey,¶m);
mir_free((char*)pszDbPrefix);
}
@@ -461,18 +461,18 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref DWORD dwType,cbData;
BYTE *pData;
- int nDbPrefixLen=lstrlenA(pszDbPrefix);
- int nPrefixWithSubKeyLen=nDbPrefixLen+lstrlenA(pszSubKey)+1;
+ int nDbPrefixLen=mir_strlen(pszDbPrefix);
+ int nPrefixWithSubKeyLen=nDbPrefixLen+mir_strlen(pszSubKey)+1;
char *pszPrefixWithSubKey=(char*)mir_alloc(nPrefixWithSubKeyLen+1);
if (pszPrefixWithSubKey==NULL) return ERROR_OUTOFMEMORY;
- lstrcatA(lstrcatA(lstrcpyA(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(mir_strcpy(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
LONG res=ERROR_NO_MORE_ITEMS;
if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
pszSuffix=&ppszSettings[i][nDbPrefixLen];
/* key hierachy */
- pkeys=lstrcpyA((char*)_alloca(lstrlenA(pszSuffix)+1),pszSuffix);
+ pkeys=mir_strcpy((char*)_alloca(mir_strlen(pszSuffix)+1),pszSuffix);
pnext=pkeys;
while((pnext=strchr(pnext+1,_T('\\')))!=NULL) pslash=pnext;
if (pslash!=NULL) {
@@ -512,9 +512,9 @@ static void DeleteRegTreeBackup(const char *pszSubKey,const char *pszDbPrefix) char **ppszSettings;
int nSettingsCount,i;
- char *pszPrefixWithSubKey=(char*)mir_alloc(lstrlenA(pszDbPrefix)+lstrlenA(pszSubKey)+2);
+ char *pszPrefixWithSubKey=(char*)mir_alloc(mir_strlen(pszDbPrefix)+mir_strlen(pszSubKey)+2);
if (pszPrefixWithSubKey==NULL) return;
- lstrcatA(lstrcatA(lstrcpyA(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
+ mir_strcat(mir_strcat(mir_strcpy(pszPrefixWithSubKey,pszDbPrefix),pszSubKey),"\\"); /* buffer safe */
if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
@@ -594,7 +594,7 @@ static BOOL Opera6_GetIniFilePath(TCHAR *szIniFile) /* path */
mir_free(p);
p=GetRegStrValue(hExeKey,_T("Path"));
- len=lstrlen(p);
+ len=mir_tstrlen(p);
if (p[len-1]==_T('\\')) p[len-1]=0;
fSuccess=(p!=NULL && ExpandEnvironmentStrings(p,szPath,MAX_PATH));
}
@@ -604,15 +604,15 @@ static BOOL Opera6_GetIniFilePath(TCHAR *szIniFile) if (fSuccess) {
TCHAR szFileBuf[MAX_PATH+34];
/* operadef6.ini */
- lstrcat(lstrcpy(szFileBuf,szPath),_T("\\operadef6.ini")); /* buffer safe */
+ mir_tstrcat(mir_tstrcpy(szFileBuf,szPath),_T("\\operadef6.ini")); /* buffer safe */
/* If enabled Opera will use Windows profiles to store individual user settings */
if (GetPrivateProfileInt(_T("System"),_T("Multi User"),0,szFileBuf)==1) {
p=_tcsrchr(szPath,'\\');
- lstrcpy(szFileBuf,_T("%APPDATA%\\Opera")); /* buffer safe */
- if (p!=NULL) lstrcat(szFileBuf,p); /* buffer safe */
- } else lstrcpy(szFileBuf,szPath);
+ mir_tstrcpy(szFileBuf,_T("%APPDATA%\\Opera")); /* buffer safe */
+ if (p!=NULL) mir_tstrcat(szFileBuf,p); /* buffer safe */
+ } else mir_tstrcpy(szFileBuf,szPath);
/* opera6.ini */
- lstrcat(szFileBuf,_T("\\profile\\opera6.ini")); /* buffer safe */
+ mir_tstrcat(szFileBuf,_T("\\profile\\opera6.ini")); /* buffer safe */
fSuccess=ExpandEnvironmentStrings(szFileBuf,szIniFile,MAX_PATH)!=0;
}
/* check file existstance */
@@ -690,7 +690,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,_T("URL:"),pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(lstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(mir_tstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,_T("DefaultIcon"),pszIconLoc);
/* url protocol */
@@ -718,16 +718,16 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const if ((res=RegCreateKeyEx(hShellKey,_T("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,(lstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(mir_tstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,_T("application"),pszDdeApp);
/* topic */
@@ -922,9 +922,9 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p }
mir_free(pszPrevClass); /* does NULL check */
/* class name */
- fSuccess=!RegSetValueExA(hExtKey,NULL,0,REG_SZ,(BYTE*)pszClassName,lstrlenA(pszClassName)+1);
+ fSuccess=!RegSetValueExA(hExtKey,NULL,0,REG_SZ,(BYTE*)pszClassName,mir_strlen(pszClassName)+1);
/* mime type e.g. "application/x-icq" */
- if (pszMimeType!=NULL) RegSetValueExA(hExtKey,"Content Type",0,REG_SZ,(BYTE*)pszMimeType,lstrlenA(pszMimeType)+1);
+ if (pszMimeType!=NULL) RegSetValueExA(hExtKey,"Content Type",0,REG_SZ,(BYTE*)pszMimeType,mir_strlen(pszMimeType)+1);
/* perceived type e.g. text (WinXP+) */
if (fIsText) RegSetValueEx(hExtKey,_T("PerceivedType"),0,REG_SZ,(BYTE*)_T("text"),5*sizeof(TCHAR));
RegCloseKey(hExtKey);
@@ -1028,7 +1028,7 @@ BOOL AddRegMimeType(const char *pszMimeType,const char *pszFileExt,const TCHAR * if (!RegCreateKeyExA(hDbKey,pszMimeType,0,NULL,0,KEY_QUERY_VALUE|KEY_SET_VALUE,NULL,&hTypeKey,NULL)) {
/* file ext */
if (RegQueryValueExA(hTypeKey,"Extension",NULL,NULL,NULL,NULL)) /* only set if not present */
- fSuccess=!RegSetValueExA(hTypeKey,"Extension",0,REG_SZ,(BYTE*)pszFileExt,lstrlenA(pszFileExt)+1);
+ fSuccess=!RegSetValueExA(hTypeKey,"Extension",0,REG_SZ,(BYTE*)pszFileExt,mir_strlen(pszFileExt)+1);
RegCloseKey(hTypeKey);
/* Opera support */
Opera6_AddKnownMimeType(pszMimeType,pszFileExt,pszDescription);
@@ -1086,7 +1086,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR /* 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,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,_T("NoOpenWith"));
else RegSetValueEx(hExeKey,_T("NoOpenWith"),0,REG_SZ,NULL,0);
@@ -1099,14 +1099,14 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR /* verb */
if (!RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,_T("application"),pszDdeApp);
/* topic */
@@ -1194,7 +1194,7 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c TCHAR *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(lstrlen(pszFileDesc)+1)*sizeof(TCHAR));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(mir_tstrlen(pszFileDesc)+1)*sizeof(TCHAR));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1247,7 +1247,7 @@ BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd) /* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(lstrlen(pszRunCmd)+1)*sizeof(TCHAR));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR));
RegCloseKey(hRunKey);
}
return fSuccess;
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 6d6ba9add4..41cb0548de 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -225,7 +225,7 @@ static HANDLE hServiceOpenFile; static void TrimString(char *str)
{
int len,start;
- len=lstrlenA(str);
+ len=mir_strlen(str);
while(str[0]!='\0' && (unsigned char)str[len-1]<=' ') str[--len]=0;
for(start=0;str[start] && (unsigned char)str[start]<=' ';++start);
MoveMemory(str,str+start,len-start+1);
@@ -348,11 +348,11 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam) sep=strchr(line,'=');
if(sep==NULL) { info.type=0; break; } /* format error */
*(sep++)='\0';
- if (!lstrcmpA("UIN",line)) lstrcpynA(info.uin,sep,sizeof(info.uin)); /* buffer safe */
- else if (!lstrcmpA("Email",line)) lstrcpynA(info.email,sep,sizeof(info.email)); /* buffer safe */
- else if (!lstrcmpA("NickName",line)) lstrcpynA(info.nick,sep,sizeof(info.nick)); /* buffer safe */
- else if (!lstrcmpA("FirstName",line)) lstrcpynA(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
- else if (!lstrcmpA("LastName",line)) lstrcpynA(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
+ if (!lstrcmpA("UIN",line)) mir_strncpy(info.uin,sep,sizeof(info.uin)); /* buffer safe */
+ else if (!lstrcmpA("Email",line)) mir_strncpy(info.email,sep,sizeof(info.email)); /* buffer safe */
+ else if (!lstrcmpA("NickName",line)) mir_strncpy(info.nick,sep,sizeof(info.nick)); /* buffer safe */
+ else if (!lstrcmpA("FirstName",line)) mir_strncpy(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
+ else if (!lstrcmpA("LastName",line)) mir_strncpy(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
}
fclose(fp);
switch(info.type) {
@@ -707,7 +707,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) */
/* user id */
arg=strchr(jid=arg,'?');
- if(arg==NULL) arg+=lstrlenA(arg); /* points to terminating nul */
+ if(arg==NULL) arg+=mir_strlen(arg); /* points to terminating nul */
else *(arg++)=0;
if (*jid==0) return 1; /* parse failed */
/* send a message to a contact */
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp index 031ec3b6e9..d1d5dad270 100644 --- a/plugins/AssocMgr/src/utils.cpp +++ b/plugins/AssocMgr/src/utils.cpp @@ -118,7 +118,7 @@ BOOL EnumDbPrefixSettings(const char *pszModule,const char *pszSettingPrefix,cha param.settings=NULL;
param.nSettingsCount=0;
param.pszPrefix=pszSettingPrefix;
- param.nPrefixLen=lstrlenA(pszSettingPrefix);
+ param.nPrefixLen=mir_strlen(pszSettingPrefix);
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
*pnSettingsCount=param.nSettingsCount;
*pSettings=param.settings;
|