shlwapi: Complete IUnknown_SetOwner call.

This commit is contained in:
Nikolay Sivov 2010-03-27 04:17:56 +03:00 committed by Alexandre Julliard
parent 442364c1be
commit 66aa3dc834
5 changed files with 51 additions and 20 deletions

1
.gitignore vendored
View File

@ -193,6 +193,7 @@ include/qedit.h
include/richole.h include/richole.h
include/sensevts.h include/sensevts.h
include/servprov.h include/servprov.h
include/shdeprecated.h
include/shldisp.h include/shldisp.h
include/shobjidl.h include/shobjidl.h
include/shtypes.h include/shtypes.h

View File

@ -42,6 +42,7 @@
#include "mmsystem.h" #include "mmsystem.h"
#include "objbase.h" #include "objbase.h"
#include "exdisp.h" #include "exdisp.h"
#include "shdeprecated.h"
#include "shlobj.h" #include "shlobj.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "shellapi.h" #include "shellapi.h"
@ -1349,36 +1350,32 @@ HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
/************************************************************************* /*************************************************************************
* @ [SHLWAPI.173] * @ [SHLWAPI.173]
* *
* Call a method on as as yet unidentified object. * Call a SetOwner method of IShellService from specified object.
* *
* PARAMS * PARAMS
* pUnk [I] Object supporting the unidentified interface, * iface [I] Object that supports IShellService
* arg [I] Argument for the call on the object. * pUnk [I] Argument for the SetOwner call
* *
* RETURNS * 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 = { IShellService *service;
0x5836fb00, 0x8187, 0x11cf, { 0xa1,0x2b,0x00,0xaa,0x00,0x4a,0xe8,0x37 } HRESULT hr;
};
IMalloc *pUnk2;
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 - if (!iface) return E_FAIL;
* We use this interface as its vtable entry is compatible with the
* object in question. hr = IUnknown_QueryInterface(iface, &IID_IShellService, (void**)&service);
* FIXME: Find out what this object is and where it should be defined. if (hr == S_OK)
*/
if (pUnk &&
SUCCEEDED(IUnknown_QueryInterface(pUnk, &guid_173, (void**)&pUnk2)))
{ {
IMalloc_Alloc(pUnk2, arg); /* Faked call!! */ hr = IShellService_SetOwner(service, pUnk);
IMalloc_Release(pUnk2); IShellService_Release(service);
} }
return S_OK;
return hr;
} }
/************************************************************************* /*************************************************************************

View File

@ -47,6 +47,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#include "docobj.h" #include "docobj.h"
#include "exdisp.h" #include "exdisp.h"
#include "shdeprecated.h"
#include "shlguid.h" #include "shlguid.h"
#include "shlobj.h" #include "shlobj.h"
#include "shldisp.h" #include "shldisp.h"

View File

@ -77,6 +77,7 @@ PUBLIC_IDL_H_SRCS = \
richole.idl \ richole.idl \
sensevts.idl \ sensevts.idl \
servprov.idl \ servprov.idl \
shdeprecated.idl \
shldisp.idl \ shldisp.idl \
shobjidl.idl \ shobjidl.idl \
shtypes.idl \ shtypes.idl \

31
include/shdeprecated.idl Normal file
View File

@ -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 );
}