nsIComponentManager* compMgr; rv = servMgr->GetService(kComponentManagerCID, nsIComponentManager::GetIID(), (nsISupports**)&compMgr); if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterComponent(kCMimeMimeObjectClassAccessCID, path); if (NS_FAILED(rv)) finalResult = rv; rv = compMgr->UnregisterComponent(kCMimeConverterCID, path); if (NS_FAILED(rv)) finalResult = rv; rv = compMgr->UnregisterComponent(kINetPluginMIMECID, path); if (NS_FAILED(rv)) finalResult = rv; rv = compMgr->UnregisterComponent(kCMsgHeaderParserCID, path); if (NS_FAILED(rv)) finalResult = rv; rv = compMgr->UnregisterComponent(kCIMimeURLUtilsCID, path); if (NS_FAILED(rv)) finalResult = rv;
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char *path){  nsresult rv;  nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));  if (NS_FAILED(rv)) return rv;  nsIComponentManager* compMgr;  rv = servMgr->GetService(kComponentManagerCID,                            nsIComponentManager::GetIID(),                            (nsISupports**)&compMgr);  if (NS_FAILED(rv)) return rv;#ifdef NS_DEBUG  printf("*** Mime being unregistered\n");#endif  rv = compMgr->UnregisterComponent(kCMimeMimeObjectClassAccessCID, path);  if (NS_FAILED(rv)) goto done;  if (NS_FAILED(rv)) goto done;  rv = compMgr->UnregisterComponent(kCMimeConverterCID, path);  if (NS_FAILED(rv)) goto done;	rv = compMgr->UnregisterComponent(kINetPluginMIMECID, path);  if (NS_FAILED(rv)) goto done;  rv = compMgr->UnregisterComponent(kCMsgHeaderParserCID, path);  if (NS_FAILED(rv)) goto done;  rv = compMgr->UnregisterComponent(kCIMimeURLUtilsCID, path);  if (NS_FAILED(rv)) goto done;  done:  (void)servMgr->ReleaseService(kComponentManagerCID, compMgr);  return rv;}