if (theServiceManager->GetService(kMemoryCID, NS_GET_IID(nsIMemory), (void**)&theMemoryAllocator) != NS_OK)
nsresult NSGetFactory(nsISupports* serviceManager, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory){	nsresult result = NS_OK;	if (theServiceManager == NULL) {		if (serviceManager->QueryInterface(NS_GET_IID(nsIServiceManager), (void **)&theServiceManager) != NS_OK)			return NS_ERROR_FAILURE;		// Our global operator new wants to use nsIMalloc to do all of its allocation.		// This should be available from the Service Manager.		if (theServiceManager->GetService(kMemoryCID, NS_GET_IID(nsIMemory), (void**)&theMemoryAllocator) != NS_OK)			return NS_ERROR_FAILURE;	}	if (aClass.Equals(kPluginCID)) {		MRJPlugin* pluginFactory = new MRJPlugin();		pluginFactory->AddRef();		*aFactory = pluginFactory;		return NS_OK;	}	return NS_NOINTERFACE;}