|
|
|
@ -0,0 +1,369 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2014 Andrew Eikum 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
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
#include "initguid.h"
|
|
|
|
|
#include "windef.h"
|
|
|
|
|
#include "winbase.h"
|
|
|
|
|
#include "ole2.h"
|
|
|
|
|
#include "rpcproxy.h"
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
|
|
#include "packager_classes.h"
|
|
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(packager);
|
|
|
|
|
|
|
|
|
|
static HINSTANCE g_instance;
|
|
|
|
|
|
|
|
|
|
struct Package {
|
|
|
|
|
IOleObject IOleObject_iface;
|
|
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline struct Package *impl_from_IOleObject(IOleObject *iface)
|
|
|
|
|
{
|
|
|
|
|
return CONTAINING_RECORD(iface, struct Package, IOleObject_iface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **obj)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
|
IsEqualGUID(riid, &IID_IOleObject)) {
|
|
|
|
|
TRACE("(%p)->(IID_IOleObject, %p)\n", This, obj);
|
|
|
|
|
*obj = &This->IOleObject_iface;
|
|
|
|
|
}else {
|
|
|
|
|
FIXME("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
|
*obj = NULL;
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*obj);
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI OleObject_Release(IOleObject *iface)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
|
|
if(!ref)
|
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, pClientSite);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppClientSite);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(0x%x)\n", This, dwSaveOption);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwWhichMoniker, pmk);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %d, %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation,
|
|
|
|
|
DWORD dwReserved)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p, 0x%x, %d)\n", This, pDataObject, fCreation, dwReserved);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwReserved, ppDataObject);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite,
|
|
|
|
|
LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, iVerb);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppEnumOleVerb);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Update(IOleObject *iface)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, pClsid);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwFormOfType, pszUserType);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwDrawAspect, psizel);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwDrawAspect, psizel);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d)\n", This, dwConnection);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppenumAdvise);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwAspect, pdwStatus);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal)
|
|
|
|
|
{
|
|
|
|
|
struct Package *This = impl_from_IOleObject(iface);
|
|
|
|
|
FIXME("(%p)->(%p)\n", This, pLogpal);
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const IOleObjectVtbl OleObject_Vtbl = {
|
|
|
|
|
OleObject_QueryInterface,
|
|
|
|
|
OleObject_AddRef,
|
|
|
|
|
OleObject_Release,
|
|
|
|
|
OleObject_SetClientSite,
|
|
|
|
|
OleObject_GetClientSite,
|
|
|
|
|
OleObject_SetHostNames,
|
|
|
|
|
OleObject_Close,
|
|
|
|
|
OleObject_SetMoniker,
|
|
|
|
|
OleObject_GetMoniker,
|
|
|
|
|
OleObject_InitFromData,
|
|
|
|
|
OleObject_GetClipboardData,
|
|
|
|
|
OleObject_DoVerb,
|
|
|
|
|
OleObject_EnumVerbs,
|
|
|
|
|
OleObject_Update,
|
|
|
|
|
OleObject_IsUpToDate,
|
|
|
|
|
OleObject_GetUserClassID,
|
|
|
|
|
OleObject_GetUserType,
|
|
|
|
|
OleObject_SetExtent,
|
|
|
|
|
OleObject_GetExtent,
|
|
|
|
|
OleObject_Advise,
|
|
|
|
|
OleObject_Unadvise,
|
|
|
|
|
OleObject_EnumAdvise,
|
|
|
|
|
OleObject_GetMiscStatus,
|
|
|
|
|
OleObject_SetColorScheme
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI PackageCF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(static)->(%s, %p)\n", debugstr_guid(riid), obj);
|
|
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) ||
|
|
|
|
|
IsEqualGUID(&IID_IClassFactory, riid))
|
|
|
|
|
*obj = iface;
|
|
|
|
|
else
|
|
|
|
|
*obj = NULL;
|
|
|
|
|
|
|
|
|
|
if(*obj){
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*obj);
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FIXME("Unknown interface: %s\n", debugstr_guid(riid));
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI PackageCF_AddRef(IClassFactory *iface)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(static)\n");
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ULONG WINAPI PackageCF_Release(IClassFactory *iface)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(static)\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI PackageCF_CreateInstance(IClassFactory *iface, IUnknown *outer,
|
|
|
|
|
REFIID iid, void **obj)
|
|
|
|
|
{
|
|
|
|
|
struct Package *package;
|
|
|
|
|
|
|
|
|
|
TRACE("(static)->(%p, %s, %p)\n", outer, wine_dbgstr_guid(iid), obj);
|
|
|
|
|
|
|
|
|
|
package = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*package));
|
|
|
|
|
if(!package)
|
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
|
|
package->IOleObject_iface.lpVtbl = &OleObject_Vtbl;
|
|
|
|
|
|
|
|
|
|
return IOleObject_QueryInterface(&package->IOleObject_iface, iid, obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI PackageCF_LockServer(IClassFactory *iface, BOOL fLock)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(%p)->(%x)\n", iface, fLock);
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const IClassFactoryVtbl PackageCF_Vtbl = {
|
|
|
|
|
PackageCF_QueryInterface,
|
|
|
|
|
PackageCF_AddRef,
|
|
|
|
|
PackageCF_Release,
|
|
|
|
|
PackageCF_CreateInstance,
|
|
|
|
|
PackageCF_LockServer
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static IClassFactory PackageCF = {
|
|
|
|
|
&PackageCF_Vtbl
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(%s, %s, %p)\n", wine_dbgstr_guid(clsid), wine_dbgstr_guid(iid), obj);
|
|
|
|
|
|
|
|
|
|
if(IsEqualGUID(clsid, &CLSID_Package))
|
|
|
|
|
return IClassFactory_QueryInterface(&PackageCF, iid, obj);
|
|
|
|
|
|
|
|
|
|
FIXME("Unknown CLSID: %s\n", wine_dbgstr_guid(clsid));
|
|
|
|
|
|
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
|
|
|
|
{
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
|
{
|
|
|
|
|
return __wine_register_resources(g_instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
|
{
|
|
|
|
|
return __wine_unregister_resources(g_instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
|
|
|
|
{
|
|
|
|
|
TRACE("(%p, %u, %p)\n", instance, reason, reserved);
|
|
|
|
|
|
|
|
|
|
switch(reason){
|
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
|
g_instance = instance;
|
|
|
|
|
DisableThreadLibraryCalls(instance);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|