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
25f1b058
Commit
25f1b058
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: Change the enum formatetc constructor to return HRESULT.
parent
1cc023c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
clipboard.c
dlls/ole32/clipboard.c
+14
-17
No files found.
dlls/ole32/clipboard.c
View file @
25f1b058
...
...
@@ -303,7 +303,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Reset(LPENUMFORMATETC iface)
return
S_OK
;
}
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[]
);
static
HRESULT
enum_fmtetc_construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[],
IEnumFORMATETC
**
obj
);
/************************************************************************
* OLEClipbrd_IEnumFORMATETC_Clone (IEnumFORMATETC)
...
...
@@ -321,8 +321,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone
if
(
!
ppenum
)
return
E_INVALIDARG
;
*
ppenum
=
OLEClipbrd_IEnumFORMATETC_Construct
(
This
->
countFmt
,
This
->
pFmt
)
;
hr
=
enum_fmtetc_construct
(
This
->
countFmt
,
This
->
pFmt
,
ppenum
);
if
(
FAILED
(
hr
))
return
hr
;
/* FIXME: This is wrong! */
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenum
)))
...
...
@@ -343,21 +343,20 @@ static const IEnumFORMATETCVtbl efvt =
};
/************************************************************************
*
OLEClipbrd_IEnumFORMATETC_C
onstruct
*
enum_fmtetc_c
onstruct
*
* Creates an IEnumFORMATETC enumerator from an array of FORMATETC
* Structures.
* NOTE: this does not AddRef the interface.
*/
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[])
static
HRESULT
enum_fmtetc_construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[],
IEnumFORMATETC
**
obj
)
{
enum_fmtetc
*
ef
;
DWORD
size
=
cfmt
*
sizeof
(
FORMATETC
);
*
obj
=
NULL
;
ef
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ef
));
if
(
!
ef
)
return
NULL
;
if
(
!
ef
)
return
E_OUTOFMEMORY
;
ef
->
ref
=
0
;
ef
->
lpVtbl
=
&
efvt
;
...
...
@@ -370,11 +369,12 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM
else
{
HeapFree
(
GetProcessHeap
(),
0
,
ef
);
return
NULL
;
return
E_OUTOFMEMORY
;
}
TRACE
(
"(%p)->()
\n
"
,
ef
);
return
(
LPENUMFORMATETC
)
ef
;
*
obj
=
(
IEnumFORMATETC
*
)
ef
;
return
S_OK
;
}
/***********************************************************************
...
...
@@ -1042,14 +1042,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
afmt
[
i
].
tymed
=
TYMED_HGLOBAL
;
}
/*
* Create an EnumFORMATETC enumerator and return an
* EnumFORMATETC after bumping up its ref count
*/
*
ppenumFormatEtc
=
OLEClipbrd_IEnumFORMATETC_Construct
(
cfmt
,
afmt
);
if
(
!
(
*
ppenumFormatEtc
))
HANDLE_ERROR
(
E_OUTOFMEMORY
);
hr
=
enum_fmtetc_construct
(
cfmt
,
afmt
,
ppenumFormatEtc
);
if
(
FAILED
(
hr
))
HANDLE_ERROR
(
hr
);
/* FIXME: This is wrong! */
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenumFormatEtc
)))
HANDLE_ERROR
(
hr
);
...
...
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