Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b1a00245
Commit
b1a00245
authored
Nov 17, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve IConnectionPoint handling.
parent
bcb42011
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
86 deletions
+112
-86
events.c
dlls/shdocvw/events.c
+106
-76
shdocvw.h
dlls/shdocvw/shdocvw.h
+6
-10
No files found.
dlls/shdocvw/events.c
View file @
b1a00245
...
...
@@ -27,10 +27,15 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
static
IConnectionPointImpl
SHDOCVW_ConnectionPoint
;
typedef
struct
{
const
IConnectionPointVtbl
*
lpConnectionPointVtbl
;
static
const
GUID
IID_INotifyDBEvents
=
{
0xdb526cc0
,
0xd188
,
0x11cd
,
{
0xad
,
0x48
,
0x00
,
0xaa
,
0x00
,
0x3c
,
0x9c
,
0xb6
}
};
WebBrowser
*
webbrowser
;
IID
iid
;
}
ConnectionPoint
;
#define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
/**********************************************************************
* Implement the IConnectionPointContainer interface
...
...
@@ -70,27 +75,31 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
{
WebBrowser
*
This
=
CONPTCONT_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppCP
);
if
(
!
ppCP
)
{
WARN
(
"ppCP == NULL
\n
"
);
return
E_POINTER
;
}
/* For now, return the same IConnectionPoint object for both
* event interface requests.
*/
if
(
IsEqualGUID
(
&
IID_INotifyDBEvents
,
riid
))
{
TRACE
(
"Returning connection point %p for IID_INotifyDBEvents
\n
"
,
&
SHDOCVW_ConnectionPoint
);
*
ppCP
=
(
LPCONNECTIONPOINT
)
&
SHDOCVW_ConnectionPoint
;
return
S_OK
;
*
ppCP
=
NULL
;
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents2
,
riid
))
{
TRACE
(
"(%p)->(DIID_DWebBrowserEvents2 %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_wbe2
;
}
else
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents
,
riid
))
{
TRACE
(
"(%p)->(DIID_DWebBrowserEvents %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_wbe
;
}
else
if
(
IsEqualGUID
(
&
IID_IPropertyNotifySink
,
riid
))
{
TRACE
(
"(%p)->(IID_IPropertyNotifySink %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_pns
;
}
else
if
(
IsEqualGUID
(
&
IID_IPropertyNotifySink
,
riid
))
{
TRACE
(
"Returning connection point %p for IID_IPropertyNotifySink
\n
"
,
&
SHDOCVW_ConnectionPoint
);
*
ppCP
=
(
LPCONNECTIONPOINT
)
&
SHDOCVW_ConnectionPoint
;
if
(
*
ppCP
)
{
IConnectionPoint_AddRef
(
*
ppCP
);
return
S_OK
;
}
return
E_FAIL
;
WARN
(
"Unsupported IID %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
#undef CONPTCONT_THIS
...
...
@@ -109,97 +118,118 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl =
* Implement the IConnectionPoint interface
*/
static
HRESULT
WINAPI
WBCP_QueryInterface
(
LPCONNECTIONPOINT
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
#define CONPOINT_THIS(iface) DEFINE_THIS(ConnectionPoint, ConnectionPoint, iface)
static
HRESULT
WINAPI
ConnectionPoint_QueryInterface
(
IConnectionPoint
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
)
);
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
*
ppv
=
NULL
;
static
ULONG
WINAPI
WBCP_AddRef
(
LPCONNECTIONPOINT
iface
)
{
SHDOCVW_LockModule
();
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CONPOINT
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IConnectionPoint
,
riid
))
{
TRACE
(
"(%p)->(IID_IConnectionPoint %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CONPOINT
(
This
);
}
return
2
;
/* non-heap based object */
if
(
*
ppv
)
{
IWebBrowser2_AddRef
(
WEBBROWSER
(
This
->
webbrowser
));
return
S_OK
;
}
WARN
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
WBCP_Release
(
LPCONNECTIONPOINT
iface
)
static
ULONG
WINAPI
ConnectionPoint_AddRef
(
IConnectionPoint
*
iface
)
{
SHDOCVW_UnlockModule
();
return
1
;
/* non-heap based object */
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
return
IWebBrowser2_AddRef
(
WEBBROWSER
(
This
->
webbrowser
));
}
static
HRESULT
WINAPI
WBCP_GetConnectionInterface
(
LPCONNECTIONPOINT
iface
,
IID
*
pIId
)
static
ULONG
WINAPI
ConnectionPoint_Release
(
IConnectionPoint
*
iface
)
{
FIXME
(
"stub: %s
\n
"
,
debugstr_guid
(
pIId
)
);
return
S_OK
;
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
return
IWebBrowser2_Release
(
WEBBROWSER
(
This
->
webbrowser
))
;
}
/* Get this connection point's owning container */
static
HRESULT
WINAPI
WBCP_GetConnectionPointContainer
(
LPCONNECTIONPOINT
iface
,
LPCONNECTIONPOINTCONTAINER
*
ppCPC
)
static
HRESULT
WINAPI
ConnectionPoint_GetConnectionInterface
(
IConnectionPoint
*
iface
,
IID
*
pIID
)
{
FIXME
(
"stub: IConnectionPointContainer = %p
\n
"
,
*
ppCPC
);
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pIID
);
memcpy
(
pIID
,
&
This
->
iid
,
sizeof
(
IID
));
return
S_OK
;
}
/* Connect the pUnkSink event-handling implementation (in the control site)
* to this connection point. Return a handle to this connection in
* pdwCookie (for later use in Unadvise()).
*/
static
HRESULT
WINAPI
WBCP_Advise
(
LPCONNECTIONPOINT
iface
,
LPUNKNOWN
pUnkSink
,
DWORD
*
pdwCookie
)
static
HRESULT
WINAPI
ConnectionPoint_GetConnectionPointContainer
(
IConnectionPoint
*
iface
,
IConnectionPointContainer
**
ppCPC
)
{
static
int
new_cookie
;
FIXME
(
"stub: IUnknown = %p, connection cookie = %ld
\n
"
,
pUnkSink
,
*
pdwCookie
);
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
*
pdwCookie
=
++
new_cookie
;
TRACE
(
"Returning cookie = %ld
\n
"
,
*
pdwCookie
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppCPC
);
*
ppCPC
=
CONPTCONT
(
This
->
webbrowser
);
return
S_OK
;
}
/* Disconnect this implementation from the connection point. */
static
HRESULT
WINAPI
WBCP_Unadvise
(
LPCONNECTIONPOINT
iface
,
DWORD
dwCookie
)
static
HRESULT
WINAPI
ConnectionPoint_Advise
(
IConnectionPoint
*
iface
,
IUnknown
*
pUnkSink
,
DWORD
*
pdwCookie
)
{
FIXME
(
"stub: cookie to disconnect = %lx
\n
"
,
dwCookie
);
return
S_OK
;
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pUnkSink
,
pdwCookie
);
return
E_NOTIMPL
;
}
/* Get a list of connections in this connection point. */
static
HRESULT
WINAPI
WBCP_EnumConnections
(
LPCONNECTIONPOINT
iface
,
LPENUMCONNECTIONS
*
ppEnum
)
static
HRESULT
WINAPI
ConnectionPoint_Unadvise
(
IConnectionPoint
*
iface
,
DWORD
dwCookie
)
{
FIXME
(
"stub: IEnumConnections = %p
\n
"
,
*
ppEnum
);
return
S_OK
;
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
FIXME
(
"(%p)->(%ld)
\n
"
,
This
,
dwCookie
);
return
E_NOTIMPL
;
}
/**********************************************************************
* IConnectionPoint virtual function table for IE Web Browser component
*/
static
HRESULT
WINAPI
ConnectionPoint_EnumConnections
(
IConnectionPoint
*
iface
,
IEnumConnections
**
ppEnum
)
{
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
ppEnum
);
return
E_NOTIMPL
;
}
static
const
IConnectionPointVtbl
WBCP_Vtbl
=
#undef CONPOINT_THIS
static
const
IConnectionPointVtbl
ConnectionPointVtbl
=
{
WBCP
_QueryInterface
,
WBCP
_AddRef
,
WBCP
_Release
,
WBCP
_GetConnectionInterface
,
WBCP
_GetConnectionPointContainer
,
WBCP
_Advise
,
WBCP
_Unadvise
,
WBCP
_EnumConnections
ConnectionPoint
_QueryInterface
,
ConnectionPoint
_AddRef
,
ConnectionPoint
_Release
,
ConnectionPoint
_GetConnectionInterface
,
ConnectionPoint
_GetConnectionPointContainer
,
ConnectionPoint
_Advise
,
ConnectionPoint
_Unadvise
,
ConnectionPoint
_EnumConnections
};
static
IConnectionPointImpl
SHDOCVW_ConnectionPoint
=
{
&
WBCP_Vtbl
};
static
void
ConnectionPoint_Create
(
WebBrowser
*
wb
,
REFIID
riid
,
IConnectionPoint
**
cp
)
{
ConnectionPoint
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ConnectionPoint
));
ret
->
lpConnectionPointVtbl
=
&
ConnectionPointVtbl
;
ret
->
webbrowser
=
wb
;
memcpy
(
&
ret
->
iid
,
riid
,
sizeof
(
IID
));
*
cp
=
CONPOINT
(
ret
);
}
void
WebBrowser_Events_Init
(
WebBrowser
*
This
)
{
This
->
lpConnectionPointContainerVtbl
=
&
ConnectionPointContainerVtbl
;
ConnectionPoint_Create
(
This
,
&
DIID_DWebBrowserEvents2
,
&
This
->
cp_wbe2
);
ConnectionPoint_Create
(
This
,
&
DIID_DWebBrowserEvents
,
&
This
->
cp_wbe
);
ConnectionPoint_Create
(
This
,
&
IID_IPropertyNotifySink
,
&
This
->
cp_pns
);
}
dlls/shdocvw/shdocvw.h
View file @
b1a00245
...
...
@@ -94,6 +94,12 @@ typedef struct {
RECT
pos_rect
;
RECT
clip_rect
;
OLEINPLACEFRAMEINFO
frameinfo
;
/* Connection points */
IConnectionPoint
*
cp_wbe2
;
IConnectionPoint
*
cp_wbe
;
IConnectionPoint
*
cp_pns
;
}
WebBrowser
;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
...
...
@@ -128,16 +134,6 @@ void WebBrowser_OleObject_Destroy(WebBrowser*);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
/**********************************************************************
* IConnectionPoint declaration for SHDOCVW.DLL
*/
typedef
struct
{
/* IUnknown fields */
const
IConnectionPointVtbl
*
lpVtbl
;
LONG
ref
;
}
IConnectionPointImpl
;
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
/**********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment