From 66aa3dc834a4e3778d9dd9b74cc464a5d304f613 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 27 Mar 2010 04:17:56 +0300 Subject: [PATCH] shlwapi: Complete IUnknown_SetOwner call. --- .gitignore | 1 + dlls/shlwapi/ordinal.c | 37 +++++++++++++++++-------------------- dlls/uuid/uuid.c | 1 + include/Makefile.in | 1 + include/shdeprecated.idl | 31 +++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 include/shdeprecated.idl diff --git a/.gitignore b/.gitignore index bb19dadf57b..6ea657de14f 100644 --- a/.gitignore +++ b/.gitignore @@ -193,6 +193,7 @@ include/qedit.h include/richole.h include/sensevts.h include/servprov.h +include/shdeprecated.h include/shldisp.h include/shobjidl.h include/shtypes.h diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 70c32856d00..bb17734f070 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -42,6 +42,7 @@ #include "mmsystem.h" #include "objbase.h" #include "exdisp.h" +#include "shdeprecated.h" #include "shlobj.h" #include "shlwapi.h" #include "shellapi.h" @@ -1349,36 +1350,32 @@ HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd) /************************************************************************* * @ [SHLWAPI.173] * - * Call a method on as as yet unidentified object. + * Call a SetOwner method of IShellService from specified object. * * PARAMS - * pUnk [I] Object supporting the unidentified interface, - * arg [I] Argument for the call on the object. + * iface [I] Object that supports IShellService + * pUnk [I] Argument for the SetOwner call * * RETURNS - * S_OK. + * Corresponding return value from last call or E_FAIL for null input */ -HRESULT WINAPI IUnknown_SetOwner(IUnknown *pUnk, ULONG arg) +HRESULT WINAPI IUnknown_SetOwner(IUnknown *iface, IUnknown *pUnk) { - static const GUID guid_173 = { - 0x5836fb00, 0x8187, 0x11cf, { 0xa1,0x2b,0x00,0xaa,0x00,0x4a,0xe8,0x37 } - }; - IMalloc *pUnk2; + IShellService *service; + HRESULT hr; - TRACE("(%p,%d)\n", pUnk, arg); + TRACE("(%p, %p)\n", iface, pUnk); - /* Note: arg may not be a ULONG and pUnk2 is for sure not an IMalloc - - * We use this interface as its vtable entry is compatible with the - * object in question. - * FIXME: Find out what this object is and where it should be defined. - */ - if (pUnk && - SUCCEEDED(IUnknown_QueryInterface(pUnk, &guid_173, (void**)&pUnk2))) + if (!iface) return E_FAIL; + + hr = IUnknown_QueryInterface(iface, &IID_IShellService, (void**)&service); + if (hr == S_OK) { - IMalloc_Alloc(pUnk2, arg); /* Faked call!! */ - IMalloc_Release(pUnk2); + hr = IShellService_SetOwner(service, pUnk); + IShellService_Release(service); } - return S_OK; + + return hr; } /************************************************************************* diff --git a/dlls/uuid/uuid.c b/dlls/uuid/uuid.c index 5a1a255bd3c..f8d19e24471 100644 --- a/dlls/uuid/uuid.c +++ b/dlls/uuid/uuid.c @@ -47,6 +47,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); #include "docobj.h" #include "exdisp.h" +#include "shdeprecated.h" #include "shlguid.h" #include "shlobj.h" #include "shldisp.h" diff --git a/include/Makefile.in b/include/Makefile.in index ce35804e43a..c9570f001c8 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -77,6 +77,7 @@ PUBLIC_IDL_H_SRCS = \ richole.idl \ sensevts.idl \ servprov.idl \ + shdeprecated.idl \ shldisp.idl \ shobjidl.idl \ shtypes.idl \ diff --git a/include/shdeprecated.idl b/include/shdeprecated.idl new file mode 100644 index 00000000000..304b0875224 --- /dev/null +++ b/include/shdeprecated.idl @@ -0,0 +1,31 @@ +/* + * Deprecated shell interfaces + * + * Copyright (C) 2010 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "objidl.idl"; + +[ + object, + local, + uuid(5836fb00-8187-11cf-a12b-00aa004ae837) +] +interface IShellService : IUnknown +{ + HRESULT SetOwner( [in] IUnknown *pUnk ); +}