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
e01794d4
Commit
e01794d4
authored
Jun 29, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Accept a NULL output container pointer in AtlAxAttachControl.
parent
29dd5235
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
4 deletions
+127
-4
atl_ax.c
dlls/atl/atl_ax.c
+3
-2
Makefile.in
dlls/atl/tests/Makefile.in
+2
-1
atl_ax.c
dlls/atl/tests/atl_ax.c
+122
-0
module.c
dlls/atl/tests/module.c
+0
-1
No files found.
dlls/atl/atl_ax.c
View file @
e01794d4
...
...
@@ -1044,10 +1044,11 @@ HRESULT WINAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUn
TRACE
(
"%p %p %p
\n
"
,
pControl
,
hWnd
,
ppUnkContainer
);
*
ppUnkContainer
=
NULL
;
if
(
!
pControl
)
return
E_INVALIDARG
;
hr
=
IOCS_Create
(
hWnd
,
pControl
,
&
pUnkContainer
);
if
(
SUCCEEDED
(
hr
)
)
if
(
SUCCEEDED
(
hr
)
&&
ppUnkContainer
)
{
*
ppUnkContainer
=
(
IUnknown
*
)
pUnkContainer
;
}
...
...
dlls/atl/tests/Makefile.in
View file @
e01794d4
...
...
@@ -3,9 +3,10 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
atl.dll
IMPORTS
=
atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 kernel32
IMPORTS
=
uuid
atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 kernel32
C_SRCS
=
\
atl_ax.c
\
module.c
@MAKE_TEST_RULES@
dlls/atl/tests/atl_ax.c
0 → 100644
View file @
e01794d4
/*
* Unit tests for Active Template Library ActiveX functions
*
* Copyright 2010 Andrew Nguyen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include <wine/test.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winnls.h>
#include <winerror.h>
#include <winnt.h>
#include <wtypes.h>
#include <olectl.h>
#include <ocidl.h>
#include <exdisp.h>
HRESULT
WINAPI
AtlAxAttachControl
(
IUnknown
*
,
HWND
,
IUnknown
**
);
static
ATOM
register_class
(
void
)
{
WNDCLASSA
wndclassA
;
wndclassA
.
style
=
0
;
wndclassA
.
lpfnWndProc
=
DefWindowProc
;
wndclassA
.
cbClsExtra
=
0
;
wndclassA
.
cbWndExtra
=
0
;
wndclassA
.
hInstance
=
GetModuleHandleA
(
NULL
);
wndclassA
.
hIcon
=
NULL
;
wndclassA
.
hCursor
=
LoadCursorA
(
NULL
,
IDC_ARROW
);
wndclassA
.
hbrBackground
=
(
HBRUSH
)(
COLOR_BTNFACE
+
1
);
wndclassA
.
lpszMenuName
=
NULL
;
wndclassA
.
lpszClassName
=
"WineAtlTestClass"
;
return
RegisterClassA
(
&
wndclassA
);
}
static
void
test_AtlAxAttachControl
(
void
)
{
HWND
hwnd
=
CreateWindowA
(
"WineAtlTestClass"
,
"Wine ATL Test Window"
,
0
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
NULL
,
NULL
,
NULL
,
NULL
);
HRESULT
hr
;
IUnknown
*
pObj
,
*
pContainer
;
hr
=
AtlAxAttachControl
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
pContainer
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
AtlAxAttachControl
(
NULL
,
NULL
,
&
pContainer
);
ok
(
hr
==
E_INVALIDARG
,
"Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
ok
(
pContainer
==
(
IUnknown
*
)
0xdeadbeef
,
"Expected the output container pointer to be untouched, got %p
\n
"
,
pContainer
);
hr
=
AtlAxAttachControl
(
NULL
,
hwnd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_WebBrowser
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IOleObject
,
(
void
**
)
&
pObj
);
ok
(
hr
==
S_OK
,
"Expected CoCreateInstance to return S_OK, got 0x%08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"Couldn't obtain a test IOleObject instance
\n
"
);
return
;
}
hr
=
AtlAxAttachControl
(
pObj
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Expected AtlAxAttachControl to return S_FALSE, got 0x%08x
\n
"
,
hr
);
pContainer
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
AtlAxAttachControl
(
pObj
,
NULL
,
&
pContainer
);
todo_wine
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
)
IUnknown_Release
(
pContainer
);
hr
=
AtlAxAttachControl
(
pObj
,
hwnd
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected AtlAxAttachControl to return S_OK, got 0x%08x
\n
"
,
hr
);
IUnknown_Release
(
pObj
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
atl_ax
)
{
if
(
!
register_class
())
return
;
CoInitialize
(
NULL
);
test_AtlAxAttachControl
();
CoUninitialize
();
}
dlls/atl/tests/module.c
View file @
e01794d4
...
...
@@ -32,7 +32,6 @@
#include <winnls.h>
#include <winerror.h>
#include <winnt.h>
#include <initguid.h>
#include <wtypes.h>
#include <olectl.h>
#include <ocidl.h>
...
...
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