NS_IMETHOD GetNext(nsISupports **result) { nsresult rv; PRBool hasMore; rv = HasMoreElements(&hasMore); if (NS_FAILED(rv)) return rv;
NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext) { #ifdef WINCE nsILocalFile *file; nsresult rv = NS_NewNativeLocalFile(nsDependentCString("\\"), PR_FALSE, &file); *aNext = file; #else  if (!*mLetter) { *aNext = nsnull; return NS_OK; } const char *drive = mLetter; mLetter += strlen(drive) + 1; nsILocalFile *file; nsresult rv = NS_NewNativeLocalFile(nsDependentCString(drive), PR_FALSE, &file);
        NS_IMETHOD GetNext(nsISupports **result)        {            nsresult rv;            PRBool hasMore;            rv = HasMoreElements(&hasMore);            if (NS_FAILED(rv)) return rv;            *result = mNext;        // might return nsnull            NS_IF_ADDREF(*result);            mNext = nsnull;            return NS_OK;        }