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
2b390f01
Commit
2b390f01
authored
Apr 18, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Simplify error handling in AtlAxAttachControl().
parent
68f2b878
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
23 deletions
+13
-23
atl_ax.c
dlls/atl/atl_ax.c
+11
-17
atl_ax.c
dlls/atl/tests/atl_ax.c
+2
-6
No files found.
dlls/atl/atl_ax.c
View file @
2b390f01
...
...
@@ -949,12 +949,15 @@ static HRESULT IOCS_Init( IOCS *This )
/**********************************************************************
* Create new instance of Atl host component and attach it to window *
*/
static
HRESULT
IOCS_Create
(
HWND
hWnd
,
IUnknown
*
pUnkControl
,
I
OCS
**
ppSite
)
static
HRESULT
IOCS_Create
(
HWND
hWnd
,
IUnknown
*
pUnkControl
,
I
Unknown
**
container
)
{
HRESULT
hr
;
IOCS
*
This
;
*
ppSite
=
NULL
;
if
(
!
container
)
return
S_OK
;
*
container
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IOCS
));
if
(
!
This
)
...
...
@@ -975,7 +978,7 @@ static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IOCS **ppSite )
if
(
SUCCEEDED
(
hr
)
)
hr
=
IOCS_Init
(
This
);
if
(
SUCCEEDED
(
hr
)
)
*
ppSite
=
This
;
*
container
=
(
IUnknown
*
)
&
This
->
IOleClientSite_iface
;
else
IOCS_Release
(
This
);
...
...
@@ -1102,26 +1105,17 @@ HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd,
/***********************************************************************
* AtlAxAttachControl [atl100.@]
*/
HRESULT
WINAPI
AtlAxAttachControl
(
IUnknown
*
pControl
,
HWND
hWnd
,
IUnknown
**
ppUnkC
ontainer
)
HRESULT
WINAPI
AtlAxAttachControl
(
IUnknown
*
control
,
HWND
hWnd
,
IUnknown
**
c
ontainer
)
{
IOCS
*
pUnkContainer
;
HRESULT
hr
;
TRACE
(
"%p %p %p
\n
"
,
pControl
,
hWnd
,
ppUnkContainer
);
TRACE
(
"(%p %p %p)
\n
"
,
control
,
hWnd
,
container
);
if
(
!
pC
ontrol
)
if
(
!
c
ontrol
)
return
E_INVALIDARG
;
hr
=
IOCS_Create
(
hWnd
,
pControl
,
&
pUnkContainer
);
if
(
SUCCEEDED
(
hr
)
&&
ppUnkContainer
)
{
*
ppUnkContainer
=
(
IUnknown
*
)
pUnkContainer
;
}
if
(
!
hWnd
)
return
S_FALSE
;
return
hr
;
hr
=
IOCS_Create
(
hWnd
,
control
,
container
);
return
hWnd
?
hr
:
S_FALSE
;
}
/**********************************************************************
...
...
dlls/atl/tests/atl_ax.c
View file @
2b390f01
...
...
@@ -97,14 +97,10 @@ static void test_AtlAxAttachControl(void)
hr
=
pAtlAxAttachControl
(
pObj
,
NULL
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Expected AtlAxAttachControl to return S_FALSE, got 0x%08x
\n
"
,
hr
);
pContainer
=
(
IUnknown
*
)
0xdeadbeef
;
pContainer
=
NULL
;
hr
=
pAtlAxAttachControl
(
pObj
,
NULL
,
&
pContainer
);
ok
(
hr
==
S_FALSE
,
"Expected AtlAxAttachControl to return S_FALSE, got 0x%08x
\n
"
,
hr
);
ok
(
pContainer
!=
(
IUnknown
*
)
0xdeadbeef
&&
pContainer
!=
NULL
,
"Expected the output container pointer to be initialized to non-NULL, got %p
\n
"
,
pContainer
);
if
(
pContainer
!=
(
IUnknown
*
)
0xdeadbeef
&&
pContainer
!=
NULL
)
ok
(
pContainer
!=
NULL
,
"got %p
\n
"
,
pContainer
);
IUnknown_Release
(
pContainer
);
hr
=
pAtlAxAttachControl
(
pObj
,
hwnd
,
NULL
);
...
...
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