--- trunk/reactos/lib/ole32/defaulthandler.c 2005-12-12 23:04:15 UTC (rev 20134)
+++ trunk/reactos/lib/ole32/defaulthandler.c 2005-12-12 23:53:06 UTC (rev 20135)
@@ -55,8 +55,11 @@
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
+#include "ole2.h"
+
+#include "compobj_private.h"
+
#include "wine/unicode.h"
-#include "ole2.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
@@ -108,6 +111,8 @@
IOleObject *pOleDelegate;
/* IPersistStorage delegate */
IPersistStorage *pPSDelegate;
+ /* IDataObject delegate */
+ IDataObject *pDataDelegate;
/* connection cookie for the advise on the delegate OLE object */
DWORD dwAdvConn;
@@ -307,9 +312,13 @@
IOleClientSite* pClientSite)
{
DefaultHandler *This = impl_from_IOleObject(iface);
+ HRESULT hr = S_OK;
TRACE("(%p, %p)\n", iface, pClientSite);
+ if (This->pOleDelegate)
+ hr = IOleObject_SetClientSite(This->pOleDelegate, pClientSite);
+
/*
* Make sure we release the previous client site if there
* was one.
@@ -371,6 +380,9 @@
debugstr_w(szContainerApp),
debugstr_w(szContainerObj));
+ if (This->pOleDelegate)
+ IOleObject_SetHostNames(This->pOleDelegate, szContainerApp, szContainerObj);
+
/* Be sure to cleanup before re-assinging the strings. */
HeapFree( GetProcessHeap(), 0, This->containerApp );
This->containerApp = NULL;
@@ -404,6 +416,12 @@
/* FIXME: call IOleCache_OnStop */
+ DataAdviseHolder_OnDisconnect(This->dataAdviseHolder);
+ if (This->pDataDelegate)
+ {
+ IDataObject_Release(This->pDataDelegate);
+ This->pDataDelegate = NULL;
+ }
if (This->pPSDelegate)
{
IPersistStorage_Release(This->pPSDelegate);
@@ -452,11 +470,16 @@
DWORD dwWhichMoniker,
IMoniker* pmk)
{
+ DefaultHandler *This = impl_from_IOleObject(iface);
+
TRACE("(%p, %ld, %p)\n",
iface,
dwWhichMoniker,
pmk);
+ if (This->pOleDelegate)
+ return IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk);
+
return S_OK;
}
@@ -478,6 +501,11 @@
TRACE("(%p, %ld, %ld, %p)\n",
iface, dwAssign, dwWhichMoniker, ppmk);
+ if (This->pOleDelegate)
+ return IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker,
+ ppmk);
+
+ /* FIXME: dwWhichMoniker == OLEWHICHMK_CONTAINER only? */
if (This->clientSite)
{
return IOleClientSite_GetMoniker(This->clientSite,
@@ -503,9 +531,14 @@
BOOL fCreation,
DWORD dwReserved)
{
+ DefaultHandler *This = impl_from_IOleObject(iface);
+
TRACE("(%p, %p, %d, %ld)\n",
iface, pDataObject, fCreation, dwReserved);
+ if (This->pOleDelegate)
+ return IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation,
+ dwReserved);
return OLE_E_NOTRUNNING;
}
@@ -521,9 +554,15 @@
DWORD dwReserved,
IDataObject** ppDataObject)
{
+ DefaultHandler *This = impl_from_IOleObject(iface);
+
TRACE("(%p, %ld, %p)\n",
iface, dwReserved, ppDataObject);
+ if (This->pOleDelegate)
+ return IOleObject_GetClipboardData(This->pOleDelegate, dwReserved,
+ ppDataObject);
+
return OLE_E_NOTRUNNING;
}
@@ -536,8 +575,17 @@
HWND hwndParent,
LPCRECT lprcPosRect)
{
- FIXME(": Stub\n");
- return E_NOTIMPL;
+ DefaultHandler *This = impl_from_IOleObject(iface);
+ IRunnableObject *pRunnableObj = (IRunnableObject *)&This->lpvtblIRunnableObject;
+ HRESULT hr;
+
+ TRACE("(%ld, %p, %p, %ld, %p, %s)\n", iVerb, lpmsg, pActiveSite, lindex, hwndParent, wine_dbgstr_rect(lprcPosRect));
+
+ hr = IRunnableObject_Run(pRunnableObj, NULL);
+ if (FAILED(hr)) return hr;
+
+ return IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite,
+ lindex, hwndParent, lprcPosRect);
}
/************************************************************************
@@ -650,8 +698,14 @@
DWORD dwDrawAspect,
SIZEL* psizel)
{
+ DefaultHandler *This = impl_from_IOleObject(iface);
+
TRACE("(%p, %lx, (%ld x %ld))\n", iface,
dwDrawAspect, psizel->cx, psizel->cy);
+
+ if (This->pOleDelegate)
+ IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel);
+
return OLE_E_NOTRUNNING;
}
@@ -676,8 +730,10 @@
TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
+ if (This->pOleDelegate)
+ return IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel);
+
hres = IUnknown_QueryInterface(This->dataCache, &IID_IViewObject2, (void**)&cacheView);
-
if (FAILED(hres))
return E_UNEXPECTED;
@@ -824,7 +880,7 @@
}
/************************************************************************
- * DefaultHandler_SetExtent (IOleObject)
+ * DefaultHandler_SetColorScheme (IOleObject)
*
* This method is meaningless if the server is not running
*
@@ -834,7 +890,13 @@
IOleObject* iface,
struct tagLOGPALETTE* pLogpal)
{
+ DefaultHandler *This = impl_from_IOleObject(iface);
+
TRACE("(%p, %p))\n", iface, pLogpal);
+
+ if (This->pOleDelegate)
+ return IOleObject_SetColorScheme(This->pOleDelegate, pLogpal);
+
return OLE_E_NOTRUNNING;
}
@@ -1212,24 +1274,29 @@
if (This->pOleDelegate)
return S_OK;
- hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IOleObject, (void **)&This->pOleDelegate);
+ hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_LOCAL_SERVER,
+ &IID_IOleObject, (void **)&This->pOleDelegate);
if (FAILED(hr))
return hr;
- hr = IOleObject_Advise(This->pOleDelegate, (IAdviseSink *)&This->lpvtblIAdviseSink, &This->dwAdvConn);
+ hr = IOleObject_Advise(This->pOleDelegate,
+ (IAdviseSink *)&This->lpvtblIAdviseSink,
+ &This->dwAdvConn);
if (SUCCEEDED(hr) && This->clientSite)
hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite);
if (SUCCEEDED(hr))
{
- IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, (void **)&This->pPSDelegate);
+ IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage,
+ (void **)&This->pPSDelegate);
if (This->pPSDelegate)
hr = IPersistStorage_InitNew(This->pPSDelegate, NULL);
}
if (SUCCEEDED(hr) && This->containerApp)
- hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp, This->containerObj);
+ hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp,
+ This->containerObj);
/* FIXME: do more stuff here:
* - IOleObject_GetMiscStatus
@@ -1237,8 +1304,16 @@
* - IOleCache_OnRun
*/
- /* FIXME: if we failed, Close the object */
+ if (SUCCEEDED(hr))
+ hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject,
+ (void **)&This->pDataDelegate);
+ if (SUCCEEDED(hr) && This->dataAdviseHolder)
+ hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
+
+ if (FAILED(hr))
+ DefaultHandler_Stop(This);
+
return hr;
}
@@ -1510,6 +1585,7 @@
This->containerObj = NULL;
This->pOleDelegate = NULL;
This->pPSDelegate = NULL;
+ This->pDataDelegate = NULL;
This->dwAdvConn = 0;
--- trunk/reactos/lib/ole32/ole32.spec 2005-12-12 23:04:15 UTC (rev 20134)
+++ trunk/reactos/lib/ole32/ole32.spec 2005-12-12 23:53:06 UTC (rev 20135)
@@ -1,8 +1,8 @@
@ stdcall BindMoniker(ptr long ptr ptr)
-@ stub CLIPFORMAT_UserFree
-@ stub CLIPFORMAT_UserMarshal
-@ stub CLIPFORMAT_UserSize
-@ stub CLIPFORMAT_UserUnmarshal
+@ stdcall CLIPFORMAT_UserFree(ptr ptr)
+@ stdcall CLIPFORMAT_UserMarshal(ptr ptr ptr)
+@ stdcall CLIPFORMAT_UserSize(ptr long ptr)
+@ stdcall CLIPFORMAT_UserUnmarshal(ptr ptr ptr)
@ stdcall CLSIDFromProgID(wstr ptr)
@ stdcall CLSIDFromString(wstr ptr)
@ stdcall CoAddRefServerProcess()
@@ -107,30 +107,34 @@
@ stdcall GetHGlobalFromStream(ptr ptr)
@ stub GetHookInterface
@ stdcall GetRunningObjectTable(long ptr)
-@ stub HACCEL_UserFree
-@ stub HACCEL_UserMarshal
-@ stub HACCEL_UserSize
-@ stub HACCEL_UserUnmarshal
-@ stub HBITMAP_UserFree
-@ stub HBITMAP_UserMarshal
-@ stub HBITMAP_UserSize
-@ stub HBITMAP_UserUnmarshal
+@ stdcall HACCEL_UserFree(ptr ptr)
+@ stdcall HACCEL_UserMarshal(ptr ptr ptr)
+@ stdcall HACCEL_UserSize(ptr long ptr)
+@ stdcall HACCEL_UserUnmarshal(ptr ptr ptr)
+@ stdcall HBITMAP_UserFree(ptr ptr)
+@ stdcall HBITMAP_UserMarshal(ptr ptr ptr)
+@ stdcall HBITMAP_UserSize(ptr long ptr)
+@ stdcall HBITMAP_UserUnmarshal(ptr ptr ptr)
@ stub HBRUSH_UserFree
@ stub HBRUSH_UserMarshal
@ stub HBRUSH_UserSize
@ stub HBRUSH_UserUnmarshal
-@ stub HENHMETAFILE_UserFree
-@ stub HENHMETAFILE_UserMarshal
-@ stub HENHMETAFILE_UserSize
-@ stub HENHMETAFILE_UserUnmarshal
-@ stub HGLOBAL_UserFree
-@ stub HGLOBAL_UserMarshal
-@ stub HGLOBAL_UserSize
-@ stub HGLOBAL_UserUnmarshal
-@ stub HMENU_UserFree
-@ stub HMENU_UserMarshal
-@ stub HMENU_UserSize
-@ stub HMENU_UserUnmarshal
+@ stdcall HDC_UserFree(ptr ptr)
+@ stdcall HDC_UserMarshal(ptr ptr ptr)
+@ stdcall HDC_UserSize(ptr long ptr)
+@ stdcall HDC_UserUnmarshal(ptr ptr ptr)
+@ stdcall HENHMETAFILE_UserFree(ptr ptr)
+@ stdcall HENHMETAFILE_UserMarshal(ptr ptr ptr)
+@ stdcall HENHMETAFILE_UserSize(ptr long ptr)
+@ stdcall HENHMETAFILE_UserUnmarshal(ptr ptr ptr)
+@ stdcall HGLOBAL_UserFree(ptr ptr)
+@ stdcall HGLOBAL_UserMarshal(ptr ptr ptr)
+@ stdcall HGLOBAL_UserSize(ptr long ptr)
+@ stdcall HGLOBAL_UserUnmarshal(ptr ptr ptr)
+@ stdcall HMENU_UserFree(ptr ptr)
+@ stdcall HMENU_UserMarshal(ptr ptr ptr)
+@ stdcall HMENU_UserSize(ptr long ptr)
+@ stdcall HMENU_UserUnmarshal(ptr ptr ptr)
@ stub HMETAFILEPICT_UserFree
@ stub HMETAFILEPICT_UserMarshal
@ stub HMETAFILEPICT_UserSize
@@ -139,14 +143,14 @@
@ stub HMETAFILE_UserMarshal
@ stub HMETAFILE_UserSize
@ stub HMETAFILE_UserUnmarshal
-@ stub HPALETTE_UserFree
-@ stub HPALETTE_UserMarshal
-@ stub HPALETTE_UserSize
-@ stub HPALETTE_UserUnmarshal
-@ stub HWND_UserFree
-@ stub HWND_UserMarshal
-@ stub HWND_UserSize
-@ stub HWND_UserUnmarshal
+@ stdcall HPALETTE_UserFree(ptr ptr)
+@ stdcall HPALETTE_UserMarshal(ptr ptr ptr)
+@ stdcall HPALETTE_UserSize(ptr long ptr)
+@ stdcall HPALETTE_UserUnmarshal(ptr ptr ptr)
+@ stdcall HWND_UserFree(ptr ptr)
+@ stdcall HWND_UserMarshal(ptr ptr ptr)
+@ stdcall HWND_UserSize(ptr long ptr)
+@ stdcall HWND_UserUnmarshal(ptr ptr ptr)
@ stdcall IIDFromString(wstr ptr) CLSIDFromString
@ stub I_RemoteMain
@ stdcall IsAccelerator(long long ptr long)
@@ -227,14 +231,14 @@
@ stdcall RegisterDragDrop(long ptr)
@ stdcall ReleaseStgMedium(ptr)
@ stdcall RevokeDragDrop(long)
-@ stub SNB_UserFree
-@ stub SNB_UserMarshal
-@ stub SNB_UserSize
-@ stub SNB_UserUnmarshal
-@ stub STGMEDIUM_UserFree
-@ stub STGMEDIUM_UserMarshal
-@ stub STGMEDIUM_UserSize
-@ stub STGMEDIUM_UserUnmarshal
+@ stdcall SNB_UserFree(ptr ptr)
+@ stdcall SNB_UserMarshal(ptr ptr ptr)
+@ stdcall SNB_UserSize(ptr long ptr)
+@ stdcall SNB_UserUnmarshal(ptr ptr ptr)
+@ stdcall STGMEDIUM_UserFree(ptr ptr)
+@ stdcall STGMEDIUM_UserMarshal(ptr ptr ptr)
+@ stdcall STGMEDIUM_UserSize(ptr long ptr)
+@ stdcall STGMEDIUM_UserUnmarshal(ptr ptr ptr)
@ stdcall SetConvertStg(ptr long)
@ stub SetDocumentBitStg
@ stdcall SetErrorInfo(long ptr)
--- trunk/reactos/lib/ole32/ole32res.rc 2005-12-12 23:04:15 UTC (rev 20134)
+++ trunk/reactos/lib/ole32/ole32res.rc 2005-12-12 23:53:06 UTC (rev 20135)
@@ -62,22 +62,22 @@
/* BINRES drag_move.cur */
1 CURSOR drag_move.cur
/* {
- '00 00 02 00 01 00 20 20 00 00 12 00 16 00 30 01'
+ '00 00 02 00 01 00 20 20 00 00 01 00 01 00 30 01'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 01 00 00 00 00 00 00 01 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 05 55 00 00 0A AA 80 00 04 01 00 00 08 00'
- '80 00 04 01 00 00 08 00 80 00 05 55 00 00 0A EA'
+ '80 00 04 01 00 00 08 00 80 00 05 55 00 00 0A AA'
'80 00 00 C0 00 00 01 80 00 00 01 80 00 00 03 00'
'00 00 23 00 00 00 36 00 00 00 3E 00 00 00 3F C0'
'00 00 3F 80 00 00 3F 00 00 00 3E 00 00 00 3C 00'
'00 00 38 00 00 00 30 00 00 00 20 00 00 00 00 00'
'00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
- 'FF FF FA AA FF FF F5 55 7F FF FB FE FF FF F7 FF'
- '7F FF FB FE FF FF F7 FF 7F FF FA AA FF FF F5 15'
+ 'FF FF F0 00 7F FF F0 00 7F FF F3 FE 7F FF F3 FE'
+ '7F FF F3 FE 7F FF F3 FE 7F FF F0 00 7F FF F0 00'
'7F FF FE 1F FF FF FC 3F FF FF BC 3F FF FF 98 7F'
'FF FF 88 7F FF FF 80 FF FF FF 80 0F FF FF 80 1F'
'FF FF 80 3F FF FF 80 7F FF FF 80 FF FF FF 81 FF'
@@ -95,15 +95,15 @@
'00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 07 F0 00 00 07 70 00 00 07'
'70 00 05 54 10 00 0A A7 70 00 04 07 70 00 08 07'
- 'F0 00 04 00 00 00 08 00 80 00 05 55 00 00 0A EA'
+ 'F0 00 04 00 00 00 08 00 80 00 05 55 00 00 0A AA'
'80 00 00 C0 00 00 01 80 00 00 01 80 00 00 03 00'
'00 00 23 00 00 00 36 00 00 00 3E 00 00 00 3F C0'
'00 00 3F 80 00 00 3F 00 00 00 3E 00 00 00 3C 00'
'00 00 38 00 00 00 30 00 00 00 20 00 00 00 00 00'
'00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF'
'FF FF FF F0 07 FF FF F0 07 FF FF F0 07 FF FF F0'
- '07 FF FA A0 07 FF F5 50 07 FF FB F0 07 FF F7 F0'
- '07 FF FB F0 07 FF F7 FF 7F FF FA AA FF FF F5 15'
+ '07 FF F0 00 07 FF F0 00 07 FF F3 F0 07 FF F3 F0'
+ '07 FF F3 F0 07 FF F3 FE 7F FF F0 00 7F FF F0 00'
'7F FF FE 1F FF FF FC 3F FF FF BC 3F FF FF 98 7F'
'FF FF 88 7F FF FF 80 FF FF FF 80 0F FF FF 80 1F'
'FF FF 80 3F FF FF 80 7F FF FF 80 FF FF FF 81 FF'
@@ -114,22 +114,22 @@
/* BINRES drag_link.cur */
3 CURSOR drag_link.cur
/* {
- '00 00 02 00 01 00 20 20 00 00 12 00 16 00 30 01'
+ '00 00 02 00 01 00 20 20 00 00 01 00 01 00 30 01'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 01 00 00 00 00 00 00 01 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 07 F0 00 00 06 F0 00 00 06'
'F0 00 05 57 50 00 0A A7 90 00 04 07 10 00 08 07'
- 'F0 00 04 00 00 00 08 00 80 00 05 55 00 00 0A EA'
+ 'F0 00 04 00 00 00 08 00 80 00 05 55 00 00 0A AA'
'80 00 00 C0 00 00 01 80 00 00 01 80 00 00 03 00'
'00 00 23 00 00 00 36 00 00 00 3E 00 00 00 3F C0'
'00 00 3F 80 00 00 3F 00 00 00 3E 00 00 00 3C 00'
'00 00 38 00 00 00 30 00 00 00 20 00 00 00 00 00'
'00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF'
'FF FF FF F0 07 FF FF F0 07 FF FF F0 07 FF FF F0'
- '07 FF FA A0 07 FF F5 50 07 FF FB F0 07 FF F7 F0'
- '07 FF FB F0 07 FF F7 FF 7F FF FA AA FF FF F5 15'
+ '07 FF F0 00 07 FF F0 00 07 FF F3 F0 07 FF F3 F0'
+ '07 FF F3 F0 07 FF F3 FE 7F FF F0 00 7F FF F0 00'
'7F FF FE 1F FF FF FC 3F FF FF BC 3F FF FF 98 7F'
'FF FF 88 7F FF FF 80 FF FF FF 80 0F FF FF 80 1F'
'FF FF 80 3F FF FF 80 7F FF FF 80 FF FF FF 81 FF'