Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b9d77540
Commit
b9d77540
authored
Nov 28, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delegate advises to the remote object to enable the client to receive
data change notifications.
parent
fc17683f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
compobj_private.h
dlls/ole32/compobj_private.h
+4
-0
defaulthandler.c
dlls/ole32/defaulthandler.c
+20
-1
oleobj.c
dlls/ole32/oleobj.c
+32
-1
No files found.
dlls/ole32/compobj_private.h
View file @
b9d77540
...
...
@@ -263,4 +263,8 @@ extern HINSTANCE OLE32_hInstance; /* FIXME: make static */
#define CHARS_IN_GUID 39
/* including NULL */
/* Exported non-interface Data Advise Holder functions */
HRESULT
DataAdviseHolder_OnConnect
(
IDataAdviseHolder
*
iface
,
IDataObject
*
pDelegate
);
void
DataAdviseHolder_OnDisconnect
(
IDataAdviseHolder
*
iface
);
#endif
/* __WINE_OLE_COMPOBJ_H */
dlls/ole32/defaulthandler.c
View file @
b9d77540
...
...
@@ -55,8 +55,11 @@
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "ole2.h"
#include "compobj_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -108,6 +111,8 @@ struct DefaultHandler
IOleObject
*
pOleDelegate
;
/* IPersistStorage delegate */
IPersistStorage
*
pPSDelegate
;
/* IDataObject delegate */
IDataObject
*
pDataDelegate
;
/* connection cookie for the advise on the delegate OLE object */
DWORD
dwAdvConn
;
...
...
@@ -411,6 +416,12 @@ static void WINAPI DefaultHandler_Stop(DefaultHandler *This)
/* 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
);
...
...
@@ -1284,6 +1295,13 @@ static HRESULT WINAPI DefaultHandler_Run(
* - IOleCache_OnRun
*/
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
);
...
...
@@ -1558,6 +1576,7 @@ static DefaultHandler* DefaultHandler_Construct(
This
->
containerObj
=
NULL
;
This
->
pOleDelegate
=
NULL
;
This
->
pPSDelegate
=
NULL
;
This
->
pDataDelegate
=
NULL
;
This
->
dwAdvConn
=
0
;
...
...
dlls/ole32/oleobj.c
View file @
b9d77540
...
...
@@ -351,6 +351,7 @@ typedef struct DataAdviseConnection {
IAdviseSink
*
sink
;
FORMATETC
fmat
;
DWORD
advf
;
DWORD
remote_connection
;
}
DataAdviseConnection
;
typedef
struct
DataAdviseHolder
...
...
@@ -362,6 +363,9 @@ typedef struct DataAdviseHolder
DataAdviseConnection
*
Connections
;
}
DataAdviseHolder
;
/* this connection has also has been advised to the delegate data object */
#define WINE_ADVF_REMOTE 0x80000000
/******************************************************************************
* DataAdviseHolder_Destructor
*/
...
...
@@ -520,7 +524,7 @@ static HRESULT WINAPI DataAdviseHolder_Advise(
*/
This
->
Connections
[
index
].
sink
=
pAdvise
;
memcpy
(
&
(
This
->
Connections
[
index
].
fmat
),
pFetc
,
sizeof
(
FORMATETC
));
This
->
Connections
[
index
].
advf
=
advf
;
This
->
Connections
[
index
].
advf
=
advf
&
~
WINE_ADVF_REMOTE
;
if
(
This
->
Connections
[
index
].
sink
!=
NULL
)
{
IAdviseSink_AddRef
(
This
->
Connections
[
index
].
sink
);
...
...
@@ -636,6 +640,33 @@ static const IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable =
DataAdviseHolder_SendOnDataChange
};
HRESULT
DataAdviseHolder_OnConnect
(
IDataAdviseHolder
*
iface
,
IDataObject
*
pDelegate
)
{
DataAdviseHolder
*
This
=
(
DataAdviseHolder
*
)
iface
;
DWORD
index
;
HRESULT
hr
=
S_OK
;
for
(
index
=
0
;
index
<
This
->
maxCons
;
index
++
)
{
if
(
This
->
Connections
[
index
].
sink
!=
NULL
)
{
hr
=
IDataObject_DAdvise
(
pDelegate
,
&
This
->
Connections
[
index
].
fmat
,
This
->
Connections
[
index
].
advf
,
This
->
Connections
[
index
].
sink
,
&
This
->
Connections
[
index
].
remote_connection
);
if
(
FAILED
(
hr
))
break
;
This
->
Connections
[
index
].
advf
|=
WINE_ADVF_REMOTE
;
}
}
/* FIXME: store pDelegate somewhere */
return
hr
;
}
void
DataAdviseHolder_OnDisconnect
(
IDataAdviseHolder
*
iface
)
{
/* FIXME: Unadvise all remote interfaces */
}
/******************************************************************************
* DataAdviseHolder_Constructor
*/
...
...
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