From fec8156cc3dd4ce9757d5240465acbd6d97c6d3a Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sun, 29 Apr 2007 17:46:50 +0100 Subject: [PATCH] atl: Implement AtlComQIPtrAssign. --- dlls/atl/atl.spec | 2 +- dlls/atl/atl_main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index 6204c5d8cf8..cbeecb625ef 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -23,7 +23,7 @@ 28 stdcall AtlPixelToHiMetric(ptr ptr) 29 stub AtlDevModeW2A 30 stdcall AtlComPtrAssign(ptr ptr) -31 stub AtlComQIPtrAssign +31 stdcall AtlComQIPtrAssign(ptr ptr ptr) 32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) 34 stub AtlGetVersion 35 stub AtlAxDialogBoxW diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 3b5703e9d66..d4d950aa3a3 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -208,6 +208,18 @@ IUnknown* WINAPI AtlComPtrAssign(IUnknown** pp, IUnknown *p) return p; } +IUnknown* WINAPI AtlComQIPtrAssign(IUnknown** pp, IUnknown *p, REFIID riid) +{ + IUnknown *new_p = NULL; + + TRACE("(%p %p %s)\n", pp, p, debugstr_guid(riid)); + + if (p) IUnknown_QueryInterface(p, riid, (void **)&new_p); + if (*pp) IUnknown_Release(*pp); + *pp = new_p; + return new_p; +} + HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, void** ppvObject) {