rv =  manager->QueryInterface(NS_GET_IID(nsIEventStateManager), (void **) aInstancePtrResult);
rv = CallQueryInterface(manager, aInstancePtrResult);
nsresult NS_NewEventStateManager(nsIEventStateManager** aInstancePtrResult){  nsresult rv;  NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr");  if (nsnull == aInstancePtrResult) {    return NS_ERROR_NULL_POINTER;  }  nsIEventStateManager* manager = new nsEventStateManager();  if (nsnull == manager) {    return NS_ERROR_OUT_OF_MEMORY;  }  rv =  manager->QueryInterface(NS_GET_IID(nsIEventStateManager),                                 (void **) aInstancePtrResult);  if (NS_FAILED(rv)) return rv;  return manager->Init();}