Author: mnordell
Date: Mon Sep 17 20:27:02 2012
New Revision: 57317
URL:
http://svn.reactos.org/svn/reactos?rev=57317&view=rev
Log:
MS-compatible but interface contract violating return value for QueryInterface with NULL
ppvObject.
Modified:
trunk/reactos/dll/win32/msxml3/msxml3_ros.diff
trunk/reactos/dll/win32/msxml3/nodelist.c
Modified: trunk/reactos/dll/win32/msxml3/msxml3_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/msxml3_ro…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/msxml3_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/msxml3_ros.diff [iso-8859-1] Mon Sep 17 20:27:02 2012
@@ -24,17 +24,18 @@
Index: nodelist.c
===================================================================
---- nodelist.c (revision 57307)
+--- nodelist.c (revision 57316)
+++ nodelist.c (working copy)
-@@ -87,6 +87,11 @@
+@@ -89,7 +89,11 @@
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
+ if (!ppvObject)
+ {
+- return E_POINTER;
++ /* NOTE: Interface documentation for IUnknown explicitly states
++ * this case should return E_POINTER. Empirical data proves
++ * MS violates this contract and instead return E_INVALIDARG.
++ */
++ return E_INVALIDARG;
+ }
-+ if (!ppvObject)
-+ {
-+ return E_POINTER;
-+ }
-+
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
- IsEqualGUID( riid, &IID_IDispatch ) ||
- IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
Modified: trunk/reactos/dll/win32/msxml3/nodelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/nodelist.…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] Mon Sep 17 20:27:02 2012
@@ -89,7 +89,11 @@
if (!ppvObject)
{
- return E_POINTER;
+ /* NOTE: Interface documentation for IUnknown explicitly states
+ * this case should return E_POINTER. Empirical data proves
+ * MS violates this contract and instead return E_INVALIDARG.
+ */
+ return E_INVALIDARG;
}
if ( IsEqualGUID( riid, &IID_IUnknown ) ||