NS_WITH_SERVICE(nsICategoryManager, catman, "mozilla.categorymanager.1", &rv);
NS_WITH_SERVICE(nsICategoryManager, catman, "@mozilla.org/categorymanager;1", &rv);
static void TestCategoryManmager(){    printf("\n");        nsresult rv;    NS_WITH_SERVICE(nsICategoryManager, catman, "mozilla.categorymanager.1", &rv);    if(NS_SUCCEEDED(rv) && catman)    {        printf("got category manager\n");             nsCOMPtr<nsISimpleEnumerator> e;        rv = catman->EnumerateCategory("foo", getter_AddRefs(e));        if(NS_SUCCEEDED(rv) && e)        {            printf("got enumerator\n");            nsCOMPtr<nsISupports> el;            rv = e->GetNext(getter_AddRefs(el));            if(NS_SUCCEEDED(rv) && el)            {                printf("e.GetNext() succeeded\n");            }            else            {                printf("e.GetNext() failed with result %0x\n", (int)rv);                        ShowXPCException();            }                                }        else            printf("get of enumerator failed with result %0x\n", (int)rv);            }    else        printf("!!! can't get category manager\n");        printf("\n");    }