Bug 422786 - reduce narrow Windows API calls in rdf, original patch by Brad Lassey <blassey@mozilla.com>, r=ted.mielczarek
authorBrian Crowder <crowder@fiverocks.com>
Wed, 27 Aug 2008 14:44:55 -0700
changeset 18483 f97dbb2beaab52db99dc169051cc0c68174be8ad
parent 18482 5431d8b5909d20d69354d337bee4d1dc17329e3e
child 18484 e3d348de9ee2450c957f1e77b36c5654c408aaba
push idunknown
push userunknown
push dateunknown
reviewersted
bugs422786
milestone1.9.1a2pre
Bug 422786 - reduce narrow Windows API calls in rdf, original patch by Brad Lassey <blassey@mozilla.com>, r=ted.mielczarek
rdf/datasource/src/nsFileSystemDataSource.cpp
--- a/rdf/datasource/src/nsFileSystemDataSource.cpp
+++ b/rdf/datasource/src/nsFileSystemDataSource.cpp
@@ -923,24 +923,25 @@ FileSystemDataSource::GetVolumeList(nsIS
 
         volumes->AppendElement(vol);
     }
 #endif
 
 #if defined (XP_WIN) && !defined (WINCE)
 
     PRInt32         driveType;
-    char            drive[32];
+    PRUnichar       drive[32];
     PRInt32         volNum;
     char            *url;
 
     for (volNum = 0; volNum < 26; volNum++)
     {
-        sprintf(drive, "%c:\\", volNum + 'A');
-        driveType = GetDriveType(drive);
+        swprintf( drive, L"%c:\\", volNum + (PRUnichar)'A');
+
+        driveType = GetDriveTypeW(drive);
         if (driveType != DRIVE_UNKNOWN && driveType != DRIVE_NO_ROOT_DIR)
         {
             if (nsnull != (url = PR_smprintf("file:///%c|/", volNum + 'A')))
             {
                 rv = mRDFService->GetResource(nsDependentCString(url),
                                               getter_AddRefs(vol));
                 PR_Free(url);