do_GetService("mozilla.categorymanager.1", &rv);
do_GetService("@mozilla.org/categorymanager;1", &rv);
CategoryCreateService( const char *category ){    nsresult rv = NS_OK;    int nFailed = 0;     nsCOMPtr<nsICategoryManager> categoryManager =         do_GetService("mozilla.categorymanager.1", &rv);    if (!categoryManager) return rv;    nsCOMPtr<nsISimpleEnumerator> enumerator;    rv = categoryManager->EnumerateCategory(category,             getter_AddRefs(enumerator));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsISupports> entry;    while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry))))    {        // From here on just skip any error we get.        nsCOMPtr<nsISupportsString> catEntry = do_QueryInterface(entry, &rv);        if (NS_FAILED(rv))        {            nFailed++;            continue;        }        nsXPIDLCString entryString;        rv = catEntry->GetData(getter_Copies(entryString));        if (NS_FAILED(rv))        {            nFailed++;            continue;        }		nsXPIDLCString contractID;		rv = categoryManager->GetCategoryEntry(category,(const char *)entryString, getter_Copies(contractID));		if (NS_FAILED(rv))        {            nFailed++;            continue;        }#ifdef DEBUG_HTTP_STARTUP_CATEGORY        printf("HTTP Handler: Instantiating contractid %s \                in http startup category.\n", (const char *)contractID);#endif /* DEBUG_HTTP_STARTUP_CATEGORY */        nsCOMPtr<nsISupports> instance = do_GetService(contractID, &rv);        if (NS_FAILED(rv))        {            nFailed++;        }    }    return (nFailed ? NS_ERROR_FAILURE : NS_OK);}