switching windows narrow char system calls to wide char b=418703 r=bsmedberg a=beltzner

This commit is contained in:
2008-03-05 13:39:29 -08:00
parent 2f10818340
commit 932f8e936f
58 changed files with 525 additions and 550 deletions

View File

@@ -108,8 +108,8 @@ private:
* HasMoreElements reads mLetter.
* GetNext advances mLetter.
*/
nsCString mDrives;
const char *mLetter;
nsString mDrives;
const PRUnichar *mLetter;
};
//----------------------------------------------------------------------------
@@ -2952,7 +2952,7 @@ nsresult nsDriveEnumerator::Init()
/* The string is null terminated */
if (!EnsureStringLength(mDrives, length+1))
return NS_ERROR_OUT_OF_MEMORY;
if (!GetLogicalDriveStrings(length, mDrives.BeginWriting()))
if (!GetLogicalDriveStringsW(length, mDrives.BeginWriting()))
return NS_ERROR_FAILURE;
mLetter = mDrives.get();
return NS_OK;
@@ -2982,8 +2982,9 @@ NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext)
*aNext = nsnull;
return NS_OK;
}
NS_ConvertASCIItoUTF16 drive(mLetter);
nsString drive(mDrives);
mLetter += drive.Length() + 1;
nsILocalFile *file;
nsresult rv =
NS_NewLocalFile(drive, PR_FALSE, &file);