nsRegistryDataSource::QueryInterface(const nsIID& aIID, void** aResult) { NS_PRECONDITION(aResult != nsnull, "null ptr"); if (! aResult) return NS_ERROR_NULL_POINTER;  if (aIID.Equals(NS_GET_IID(nsIRDFDataSource)) || aIID.Equals(NS_GET_IID(nsISupports))) { *aResult = NS_STATIC_CAST(nsIRDFDataSource*, this); } else if (aIID.Equals(NS_GET_IID(nsIRegistryDataSource))) { *aResult = NS_STATIC_CAST(nsIRegistryDataSource*, this); } else { *aResult = nsnull; return NS_NOINTERFACE; }  NS_ADDREF(NS_REINTERPRET_CAST(nsISupports*, *aResult)); return NS_OK; }
NS_IMPL_ISUPPORTS(nsRegistryDataSource::SubkeyEnumerator, NS_GET_IID(nsISimpleEnumerator));
nsRegistryDataSource::QueryInterface(const nsIID& aIID, void** aResult){    NS_PRECONDITION(aResult != nsnull, "null ptr");    if (! aResult)        return NS_ERROR_NULL_POINTER;    if (aIID.Equals(NS_GET_IID(nsIRDFDataSource)) ||        aIID.Equals(NS_GET_IID(nsISupports))) {        *aResult = NS_STATIC_CAST(nsIRDFDataSource*, this);    }    else if (aIID.Equals(NS_GET_IID(nsIRegistryDataSource))) {        *aResult = NS_STATIC_CAST(nsIRegistryDataSource*, this);    }    else {        *aResult = nsnull;        return NS_NOINTERFACE;    }    NS_ADDREF(NS_REINTERPRET_CAST(nsISupports*, *aResult));    return NS_OK;}