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
1cc023c5
Commit
1cc023c5
authored
Mar 26, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Mar 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Don't hold a reference on the parent IDataObject.
parent
12139643
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
28 deletions
+6
-28
clipboard.c
dlls/ole32/clipboard.c
+6
-28
No files found.
dlls/ole32/clipboard.c
View file @
1cc023c5
...
...
@@ -159,13 +159,6 @@ typedef struct enum_fmtetc
UINT
pos
;
/* current enumerator position */
UINT
countFmt
;
/* number of EnumFORMATETC's in array */
LPFORMATETC
pFmt
;
/* array of EnumFORMATETC's */
/*
* IUnknown implementation of the parent data object.
*/
IUnknown
*
pUnkDataObj
;
}
enum_fmtetc
;
static
inline
enum_fmtetc
*
impl_from_IEnumFORMATETC
(
IEnumFORMATETC
*
iface
)
...
...
@@ -207,20 +200,12 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_QueryInterface
/************************************************************************
* OLEClipbrd_IEnumFORMATETC_AddRef (IUnknown)
*
* Since enumerating formats only makes sense when our data object is around,
* we insure that it stays as long as we stay by calling our parents IUnknown
* for AddRef and Release. But since we are not controlled by the lifetime of
* the outer object, we still keep our own reference count in order to
* free ourselves.
*/
static
ULONG
WINAPI
OLEClipbrd_IEnumFORMATETC_AddRef
(
LPENUMFORMATETC
iface
)
{
enum_fmtetc
*
This
=
impl_from_IEnumFORMATETC
(
iface
);
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
This
->
ref
);
if
(
This
->
pUnkDataObj
)
IUnknown_AddRef
(
This
->
pUnkDataObj
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
...
...
@@ -236,9 +221,6 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface)
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
This
->
ref
);
if
(
This
->
pUnkDataObj
)
IUnknown_Release
(
This
->
pUnkDataObj
);
/* Release parent data object */
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
{
...
...
@@ -321,8 +303,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Reset(LPENUMFORMATETC iface)
return
S_OK
;
}
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[],
LPUNKNOWN
pUnkDataObj
);
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[]);
/************************************************************************
* OLEClipbrd_IEnumFORMATETC_Clone (IEnumFORMATETC)
...
...
@@ -341,8 +322,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone
return
E_INVALIDARG
;
*
ppenum
=
OLEClipbrd_IEnumFORMATETC_Construct
(
This
->
countFmt
,
This
->
pFmt
,
This
->
pUnkDataObj
);
This
->
pFmt
);
/* FIXME: This is wrong! */
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenum
)))
...
...
@@ -363,15 +343,14 @@ static const IEnumFORMATETCVtbl efvt =
};
/************************************************************************
* OLEClipbrd_IEnumFORMATETC_Construct
(UINT, const FORMATETC, LPUNKNOWN)
* OLEClipbrd_IEnumFORMATETC_Construct
*
* Creates an IEnumFORMATETC enumerator from an array of FORMATETC
* Structures.
pUnkOuter is the outer unknown for reference counting only.
* Structures.
* NOTE: this does not AddRef the interface.
*/
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[],
LPUNKNOWN
pUnkDataObj
)
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[])
{
enum_fmtetc
*
ef
;
DWORD
size
=
cfmt
*
sizeof
(
FORMATETC
);
...
...
@@ -382,7 +361,6 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM
ef
->
ref
=
0
;
ef
->
lpVtbl
=
&
efvt
;
ef
->
pUnkDataObj
=
pUnkDataObj
;
ef
->
pos
=
0
;
ef
->
countFmt
=
cfmt
;
...
...
@@ -1068,7 +1046,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
* Create an EnumFORMATETC enumerator and return an
* EnumFORMATETC after bumping up its ref count
*/
*
ppenumFormatEtc
=
OLEClipbrd_IEnumFORMATETC_Construct
(
cfmt
,
afmt
,
(
LPUNKNOWN
)
iface
);
*
ppenumFormatEtc
=
OLEClipbrd_IEnumFORMATETC_Construct
(
cfmt
,
afmt
);
if
(
!
(
*
ppenumFormatEtc
))
HANDLE_ERROR
(
E_OUTOFMEMORY
);
...
...
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