diff --git a/xpinstall/src/nsLoggingProgressNotifier.cpp b/xpinstall/src/nsLoggingProgressNotifier.cpp index e20c38de882d..a54b0fdcd0a1 100644 --- a/xpinstall/src/nsLoggingProgressNotifier.cpp +++ b/xpinstall/src/nsLoggingProgressNotifier.cpp @@ -270,14 +270,19 @@ nsLoggingProgressListener::OnItemScheduled(const PRUnichar* message ) } NS_IMETHODIMP -nsLoggingProgressListener::OnFinalizeProgress(const PRUnichar* message, PRInt32 itemNum, PRInt32 totNum ) +nsLoggingProgressListener::OnFinalizeProgress(const PRUnichar* aMessage, PRInt32 aItemNum, PRInt32 aTotNum ) { nsCString messageConverted; - messageConverted.AssignWithConversion(message); + + // this Lossy conversion is safe because the input source came from a + // similar fake-ascii-to-not-really-unicode conversion. + // If you use NS_CopyUnicodeToNative(), it'll crash under a true JA WinXP + // system as opposed to a EN winXP system changed to JA. + messageConverted.AssignWithConversion(aMessage); if (mLogStream == nsnull) return NS_ERROR_NULL_POINTER; - *mLogStream << " [" << (itemNum) << "/" << totNum << "]\t" << messageConverted.get() << nsEndl; + *mLogStream << " [" << (aItemNum) << "/" << aTotNum << "]\t" << messageConverted.get() << nsEndl; return NS_OK; } @@ -292,11 +297,11 @@ nsLoggingProgressListener::GetTime(char** aString) } NS_IMETHODIMP -nsLoggingProgressListener::OnLogComment(const PRUnichar* comment) +nsLoggingProgressListener::OnLogComment(const PRUnichar* aComment) { nsCString commentConverted; - commentConverted.AssignWithConversion(comment); + NS_CopyUnicodeToNative(nsDependentString(aComment), commentConverted); if (mLogStream == nsnull) return NS_ERROR_NULL_POINTER; *mLogStream << " ** " << commentConverted.get() << nsEndl; diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index c2af0b4a2b68..8f49bd4b8551 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -3482,7 +3482,7 @@ void RestoreInvisibleFlag(siC *siCNode) GetPrivateProfileString(siCNode->szReferenceName, "Attributes", "", szBuf, sizeof(szBuf), szFileIniConfig); lstrcpy(szAttribute, szBuf); - strupr(szAttribute); + CharUpperBuff(szAttribute, sizeof(szAttribute)); if(strstr(szAttribute, "INVISIBLE") || siCNode->bSupersede) siCNode->dwAttributes |= SIC_INVISIBLE; @@ -3497,7 +3497,7 @@ void RestoreAdditionalFlag(siC *siCNode) GetPrivateProfileString(siCNode->szReferenceName, "Attributes", "", szBuf, sizeof(szBuf), szFileIniConfig); lstrcpy(szAttribute, szBuf); - strupr(szAttribute); + CharUpperBuff(szAttribute, sizeof(szAttribute)); if(strstr(szAttribute, "ADDITIONAL") && !strstr(szAttribute, "NOTADDITIONAL")) siCNode->dwAttributes |= SIC_ADDITIONAL; @@ -4470,7 +4470,7 @@ DWORD ParseOSType(char *szOSType) DWORD dwOSType = 0; lstrcpy(szBuf, szOSType); - strupr(szBuf); + CharUpperBuff(szBuf, sizeof(szBuf)); if(strstr(szBuf, "WIN95 DEBUTE")) dwOSType |= OS_WIN95_DEBUTE; @@ -4500,7 +4500,7 @@ HRESULT ParseComponentAttributes(char *szAttribute, DWORD dwAttributes, BOOL bOv char szBuf[MAX_BUF]; lstrcpy(szBuf, szAttribute); - strupr(szBuf); + CharUpperBuff(szBuf, sizeof(szBuf)); if(bOverride != TRUE) { @@ -8391,8 +8391,8 @@ int AddGrePathToApplicationAppPathsKey() rv = APPPATH_GRE_PATH_SET; MozCopyStr(path, keyPathUpr, sizeof(keyPathUpr)); MozCopyStr(gGre.homePath, grePathUpr, sizeof(grePathUpr)); - strupr(grePathUpr); - strupr(keyPathUpr); + CharUpperBuff(grePathUpr, sizeof(grePathUpr)); + CharUpperBuff(keyPathUpr, sizeof(keyPathUpr)); if(!strstr(keyPathUpr, grePathUpr)) wsprintf(newPath, "%s;%s", gGre.homePath, path); else diff --git a/xpinstall/wizard/windows/uninstall/parser.c b/xpinstall/wizard/windows/uninstall/parser.c index fc39f4e9b413..12088d5b92d7 100644 --- a/xpinstall/wizard/windows/uninstall/parser.c +++ b/xpinstall/wizard/windows/uninstall/parser.c @@ -498,13 +498,13 @@ BOOL DetermineUnRegisterServer(sil *silInstallLogHead, LPSTR szFile) silInstallLogTemp = silInstallLogHead; iSharedFileCount = GetSharedFileCount(szFile); lstrcpy(szLCFile, szFile); - _strlwr(szLCFile); + CharLowerBuff(szLCFile, sizeof(szLCLine)); do { silInstallLogTemp = silInstallLogTemp->Prev; lstrcpy(szLCLine, silInstallLogTemp->szLine); - _strlwr(szLCLine); + CharLowerBuff(szLCLine, sizeof(szLCLine)); if((strstr(szLCLine, szLCFile) != NULL) && (strstr(szLCLine, KEY_INSTALLING_SHARED_FILE) != NULL) && @@ -570,7 +570,7 @@ DWORD Uninstall(sil* silInstallLogHead) { silInstallLogTemp = silInstallLogTemp->Prev; lstrcpy(szLCLine, silInstallLogTemp->szLine); - _strlwr(szLCLine); + CharLowerBuff(szLCLine, sizeof(szLCLine)); if(((szSubStr = strstr(szLCLine, KEY_WINDOWS_REGISTER_SERVER)) != NULL) && (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL)) diff --git a/xpinstall/wizard/windows/uninstall/rdi.c b/xpinstall/wizard/windows/uninstall/rdi.c index 4225d8339cb5..0fc353157428 100644 --- a/xpinstall/wizard/windows/uninstall/rdi.c +++ b/xpinstall/wizard/windows/uninstall/rdi.c @@ -223,7 +223,7 @@ BOOL DdeexecCheck(char *szKey, char *szValue) BOOL bPass = TRUE; lstrcpy(szKeyLower, szKey); - strlwr(szKeyLower); + CharLowerBuff(szKeyLower, sizeof(szKeyLower)); if(strstr(szKeyLower, szKddeexec) && CheckForNonPrintableChars(szValue)) bPass = FALSE; @@ -392,7 +392,7 @@ int GetUninstallAppPathName(char *szAppPathName, DWORD dwAppPathNameSize) } GetWinReg(hkRoot, szKey, "PathToExe", szAppPathName, dwAppPathNameSize); - strupr(szAppPathName); + CharUpperBuff(szAppPathName, dwAppPathNameSize); return(CMI_OK); } @@ -513,7 +513,7 @@ BOOL GetUnreadMailKeyList(char *szUninstallAppPathName, skn **sknWinRegKeyList) szBuf, &dwBufSize) == ERROR_SUCCESS) { - strupr(szBuf); + CharUpperBuff(szBuf, sizeof(szBuf)); if(strstr(szBuf, szUninstallAppPathName) != NULL) { bFoundAtLeastOne = TRUE;