r = rjc, a = brendan
OS/2 bringup continues on M16 - Adding an XP_OS2 only path
This commit is contained in:
mkaply%us.ibm.com 2000-05-25 14:33:17 +00:00
Родитель 67e14638ca
Коммит d7086a1fcb
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -1008,6 +1008,32 @@ FileSystemDataSource::GetVolumeList(nsISimpleEnumerator** aResult)
volumes->AppendElement(vol);
#endif
#ifdef XP_OS2
ULONG ulDriveNo = 0;
ULONG ulDriveMap = 0;
char *url;
rv = DosQueryCurrentDisk(&ulDriveNo, &ulDriveMap);
if (NS_FAILED(rv))
return rv;
for (int volNum = 0; volNum < 26; volNum++)
{
if (((ulDriveMap << (31 - volNum)) >> 31))
{
if (nsnull != (url = PR_smprintf("file:///%c|/", volNum + 'A')))
{
rv = gRDFService->GetResource(url, getter_AddRefs(vol));
PR_Free(url);
if (NS_FAILED(rv)) return rv;
volumes->AppendElement(vol);
}
}
}
#endif
nsISimpleEnumerator* result = new nsArrayEnumerator(volumes);
if (! result)
return NS_ERROR_OUT_OF_MEMORY;