MS-compatible but interface contract violating return value for QueryInterface with NULL ppvObject.

svn path=/trunk/; revision=57317
This commit is contained in:
Mike Nordell 2012-09-17 20:27:02 +00:00
parent c3b0c6cca2
commit 7152be13fb
2 changed files with 16 additions and 11 deletions

View file

@ -24,17 +24,18 @@ Index: msxml3.spec
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 ) )

View file

@ -89,7 +89,11 @@ static HRESULT WINAPI xmlnodelist_QueryInterface(
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 ) ||