Module: wine Branch: master Commit: c0fbbe7d910716b15607e3c988ee35614a2a2046 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0fbbe7d910716b15607e3c988...
Author: Huw Davies huw@codeweavers.com Date: Tue Mar 17 14:33:33 2009 +0000
ole32: Use IsEqualIID rather than memcmp.
---
dlls/ole32/clipboard.c | 24 ++++-------------------- 1 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index f9eefe8..8e997ec 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -730,40 +730,24 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( void** ppvObject) { ole_clipbrd *This = impl_from_IDataObject(iface); - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObject); + TRACE("(%p)->(IID:%s, %p)\n", This, debugstr_guid(riid), ppvObject);
- /* - * Perform a sanity check on the parameters. - */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG;
- /* - * Initialize the return parameter. - */ *ppvObject = 0;
- /* - * Compare the riid with the interface IDs implemented by this object. - */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (IsEqualIID(&IID_IUnknown, riid) || + IsEqualIID(&IID_IDataObject, riid)) { *ppvObject = iface; } - else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) - { - *ppvObject = &This->lpvtbl; - } - else /* We only support IUnknown and IDataObject */ + else { WARN( "() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; }
- /* - * Query Interface always increases the reference count by one when it is - * successful. - */ IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;