nsCOMPtr<nsIPref> pPref(do_GetService(kPrefCID, &result));
nsCOMPtr<nsIPref> pPref(do_GetService(NS_PREF_CONTRACTID, &result));
static nsresult dir_CreateTokenListFromWholePref(const char *pref, char ***outList, PRInt32 *outCount){    nsresult result = NS_OK;    nsCOMPtr<nsIPref> pPref(do_GetService(kPrefCID, &result));     if (NS_FAILED(result)) 		return result;	char *commaSeparatedList = nsnull;	if (PREF_NOERROR == pPref->CopyCharPref(pref, &commaSeparatedList) && commaSeparatedList)	{		char *tmpList = commaSeparatedList;		*outCount = 1;		while (*tmpList)			if (*tmpList++ == ',')				(*outCount)++;		*outList = (char**) PR_Malloc(*outCount * sizeof(char*));		if (*outList)		{			PRInt32 i;			char *token = XP_STRTOK(commaSeparatedList, ", ");			for (i = 0; i < *outCount; i++)			{                (*outList)[i] = nsCRT::strdup(token);				token = XP_STRTOK(nsnull, ", ");			}		}		else			result = NS_ERROR_OUT_OF_MEMORY;		PR_Free (commaSeparatedList);	}	else		result = NS_ERROR_FAILURE;	return result;}