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)
...
@@ -303,7 +303,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Reset(LPENUMFORMATETC iface)
return
S_OK
;
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)
* OLEClipbrd_IEnumFORMATETC_Clone (IEnumFORMATETC)
...
@@ -321,8 +321,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone
...
@@ -321,8 +321,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone
if
(
!
ppenum
)
if
(
!
ppenum
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
*
ppenum
=
OLEClipbrd_IEnumFORMATETC_Construct
(
This
->
countFmt
,
hr
=
enum_fmtetc_construct
(
This
->
countFmt
,
This
->
pFmt
,
ppenum
);
This
->
pFmt
)
;
if
(
FAILED
(
hr
))
return
hr
;
/* FIXME: This is wrong! */
/* FIXME: This is wrong! */
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenum
)))
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenum
)))
...
@@ -343,21 +343,20 @@ static const IEnumFORMATETCVtbl efvt =
...
@@ -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
* Creates an IEnumFORMATETC enumerator from an array of FORMATETC
* Structures.
* Structures.
* NOTE: this does not AddRef the interface.
* NOTE: this does not AddRef the interface.
*/
*/
static
HRESULT
enum_fmtetc_construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[],
IEnumFORMATETC
**
obj
)
static
LPENUMFORMATETC
OLEClipbrd_IEnumFORMATETC_Construct
(
UINT
cfmt
,
const
FORMATETC
afmt
[])
{
{
enum_fmtetc
*
ef
;
enum_fmtetc
*
ef
;
DWORD
size
=
cfmt
*
sizeof
(
FORMATETC
);
DWORD
size
=
cfmt
*
sizeof
(
FORMATETC
);
*
obj
=
NULL
;
ef
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ef
));
ef
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ef
));
if
(
!
ef
)
if
(
!
ef
)
return
E_OUTOFMEMORY
;
return
NULL
;
ef
->
ref
=
0
;
ef
->
ref
=
0
;
ef
->
lpVtbl
=
&
efvt
;
ef
->
lpVtbl
=
&
efvt
;
...
@@ -370,11 +369,12 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM
...
@@ -370,11 +369,12 @@ static LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORM
else
else
{
{
HeapFree
(
GetProcessHeap
(),
0
,
ef
);
HeapFree
(
GetProcessHeap
(),
0
,
ef
);
return
NULL
;
return
E_OUTOFMEMORY
;
}
}
TRACE
(
"(%p)->()
\n
"
,
ef
);
TRACE
(
"(%p)->()
\n
"
,
ef
);
return
(
LPENUMFORMATETC
)
ef
;
*
obj
=
(
IEnumFORMATETC
*
)
ef
;
return
S_OK
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -1042,14 +1042,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
...
@@ -1042,14 +1042,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
afmt
[
i
].
tymed
=
TYMED_HGLOBAL
;
afmt
[
i
].
tymed
=
TYMED_HGLOBAL
;
}
}
/*
hr
=
enum_fmtetc_construct
(
cfmt
,
afmt
,
ppenumFormatEtc
);
* Create an EnumFORMATETC enumerator and return an
if
(
FAILED
(
hr
))
* EnumFORMATETC after bumping up its ref count
HANDLE_ERROR
(
hr
);
*/
*
ppenumFormatEtc
=
OLEClipbrd_IEnumFORMATETC_Construct
(
cfmt
,
afmt
);
if
(
!
(
*
ppenumFormatEtc
))
HANDLE_ERROR
(
E_OUTOFMEMORY
);
/* FIXME: This is wrong! */
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenumFormatEtc
)))
if
(
FAILED
(
hr
=
IEnumFORMATETC_AddRef
(
*
ppenumFormatEtc
)))
HANDLE_ERROR
(
hr
);
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