Added a framework for testing CreateProcess and a few tests.
[wine] / dlls / shdocvw / connect.c
1 /*
2  *      CConnectionPointImpl
3  *      FIXME - stub
4  *
5  * Copyright 2001 John R. Sheets (for CodeWeavers)
6  * Copyright 2002 Hidenori Takeshima
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "config.h"
24
25 #include <string.h>
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "wingdi.h"
29 #include "ole2.h"
30
31 #include "wine/obj_base.h"
32 #include "wine/obj_storage.h"
33 #include "wine/obj_misc.h"
34 #include "wine/obj_moniker.h"
35 #include "wine/obj_inplace.h"
36 #include "wine/obj_dataobject.h"
37 #include "wine/obj_oleobj.h"
38 #include "wine/obj_oleaut.h"
39 #include "wine/obj_olefont.h"
40 #include "wine/obj_dragdrop.h"
41 #include "wine/obj_oleview.h"
42 #include "wine/obj_control.h"
43 #include "wine/obj_connection.h"
44 #include "wine/obj_property.h"
45 #include "wine/obj_oleundo.h"
46 #include "wine/obj_webbrowser.h"
47
48 #include "wine/debug.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
50
51 #include "shdocvw.h"
52
53
54 typedef struct CConnectionPointImpl
55 {
56         COMIMPL_IUnkImpl vfunk; /* must be the first member of this struct */
57         struct { ICOM_VFIELD(IConnectionPoint); } vfcpoint;
58
59         /* CConnectionPointImpl variables */
60
61 } CConnectionPointImpl;
62
63 #define CConnectionPointImpl_THIS(iface,member) CConnectionPointImpl* This = ((CConnectionPointImpl*)(((char*)iface)-offsetof(CConnectionPointImpl,member)))
64
65
66 static COMIMPL_IFEntry IFEntries[] =
67 {
68   { &IID_IConnectionPoint, offsetof(CConnectionPointImpl,vfcpoint)-offsetof(CConnectionPointImpl,vfunk) },
69 };
70
71 /***************************************************************************
72  *
73  *      CConnectionPointImpl::IConnectionPoint
74  */
75
76 /**********************************************************************
77  * Implement the IConnectionPoint interface
78  */
79
80 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
81                                           REFIID riid, LPVOID *ppobj)
82 {
83         CConnectionPointImpl_THIS(iface,vfcpoint);
84
85         TRACE("(%p)->()\n",This);
86
87         return IUnknown_QueryInterface(This->vfunk.punkControl,riid,ppobj);
88 }
89
90 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
91 {
92         CConnectionPointImpl_THIS(iface,vfcpoint);
93
94         TRACE("(%p)->()\n",This);
95
96         return IUnknown_AddRef(This->vfunk.punkControl);
97 }
98
99 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
100 {
101         CConnectionPointImpl_THIS(iface,vfcpoint);
102
103         TRACE("(%p)->()\n",This);
104
105         return IUnknown_Release(This->vfunk.punkControl);
106 }
107
108 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
109 {
110     FIXME("stub: %s\n", debugstr_guid(pIId));
111     return E_NOTIMPL;
112 }
113
114 /* Get this connection point's owning container */
115 static HRESULT WINAPI
116 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
117                                  LPCONNECTIONPOINTCONTAINER *ppCPC)
118 {
119     FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
120     return E_NOTIMPL;
121 }
122
123 /* Connect the pUnkSink event-handling implementation (in the control site)
124  * to this connection point.  Return a handle to this connection in
125  * pdwCookie (for later use in Unadvise()).
126  */
127 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
128                                   LPUNKNOWN pUnkSink, DWORD *pdwCookie)
129 {
130     FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
131 #if 0
132     static int new_cookie;
133
134     FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
135     *pdwCookie = ++new_cookie;
136     TRACE ("Returning cookie = %ld\n", *pdwCookie);
137 #endif
138
139     return E_NOTIMPL;
140 }
141
142 /* Disconnect this implementation from the connection point. */
143 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
144                                     DWORD dwCookie)
145 {
146     FIXME("stub: cookie to disconnect = %ld\n", dwCookie);
147     return E_NOTIMPL;
148 }
149
150 /* Get a list of connections in this connection point. */
151 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
152                                            LPENUMCONNECTIONS *ppEnum)
153 {
154     FIXME("stub: IEnumConnections = %p\n", *ppEnum);
155     return E_NOTIMPL;
156 }
157
158 /**********************************************************************
159  * IConnectionPoint virtual function table for IE Web Browser component
160  */
161
162 static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl = 
163 {
164     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
165     WBCP_QueryInterface,
166     WBCP_AddRef,
167     WBCP_Release,
168     WBCP_GetConnectionInterface,
169     WBCP_GetConnectionPointContainer,
170     WBCP_Advise,
171     WBCP_Unadvise,
172     WBCP_EnumConnections
173 };
174
175 /***************************************************************************
176  *
177  *      new/delete CConnectionPointImpl
178  *
179  */
180
181 static void CConnectionPointImpl_Destructor(IUnknown* iface)
182 {
183         CConnectionPointImpl_THIS(iface,vfunk);
184
185         FIXME("(%p)\n",This);
186
187         /* destructor */
188 }
189
190 HRESULT CConnectionPointImpl_AllocObj(IUnknown* punkOuter,void** ppobj)
191 {
192         CConnectionPointImpl*   This;
193
194         This = (CConnectionPointImpl*)COMIMPL_AllocObj( sizeof(CConnectionPointImpl) );
195         if ( This == NULL ) return E_OUTOFMEMORY;
196         COMIMPL_IUnkInit( &This->vfunk, punkOuter );
197         This->vfunk.pEntries = IFEntries;
198         This->vfunk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
199         This->vfunk.pOnFinalRelease = CConnectionPointImpl_Destructor;
200
201         ICOM_VTBL(&This->vfcpoint) = &WBCP_Vtbl;
202
203         /* constructor */
204
205         return S_OK;
206 }
207
208
209