bClassExists = TRUE;
bClassExists = PR_TRUE;
ClassImplementsCategory(const CLSID &clsid, const CATID &catid, PRBool &bClassExists){    bClassExists = ClassExists(clsid);    // Non existent classes won't implement any category...    if(!bClassExists)        return PR_FALSE;    // CLSID exists, so try checking what categories it implements    bClassExists = TRUE;    CComPtr<ICatInformation> catInfo;    HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL,        CLSCTX_INPROC_SERVER, __uuidof(ICatInformation), (LPVOID*) &catInfo);    if(catInfo == NULL)        return PR_FALSE; // Must fail if we can't open the category manager        // See what categories the class implements    CComPtr<IEnumCATID> enumCATID;    if(FAILED(catInfo->EnumImplCategoriesOfClass(clsid, &enumCATID)))        return PR_FALSE; // Can't enumerate classes in category so fail    // Search for matching categories    BOOL bFound = FALSE;    CATID catidNext = GUID_NULL;    while (enumCATID->Next(1, &catidNext, NULL) == S_OK)    {        if(::IsEqualCATID(catid, catidNext))            return PR_TRUE; // Match    }    return PR_FALSE;}