--- /home/pork/QI-rewrite/src/xpcom/base/nsISupportsBase.h
+++ /home/pork/QI-rewrite/src/xpcom/base/nsISupportsBase.h
@@ -86,1 +86,1 @@
-  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) = 0;
+  NS_IMETHOD_(void*) QueryInterface(REFNSIID aIID) = 0;
--- /home/pork/QI-rewrite/src/xpcom/glue/nsISupportsUtils.h
+++ /home/pork/QI-rewrite/src/xpcom/glue/nsISupportsUtils.h
@@ -202,2 +202,1 @@
-    return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType),
-                                   reinterpret_cast<void**>(aDestination));
+    return ((*aDestination = (nsIInputStream *) aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType))) ? NS_OK : NS_ERROR_OUT_OF_MEMORY);
