Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
22663565
Commit
22663565
authored
Feb 07, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Add some CoCreateInstance and aggregation tests.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c3686f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
dinput.c
dlls/dinput/tests/dinput.c
+67
-0
No files found.
dlls/dinput/tests/dinput.c
View file @
22663565
...
...
@@ -76,6 +76,41 @@ static BOOL CALLBACK dummy_callback(const DIDEVICEINSTANCEA *instance, void *con
return
DIENUM_STOP
;
}
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
iid
,
void
**
obj
)
{
ok
(
0
,
"unexpected call %s
\n
"
,
debugstr_guid
(
iid
)
);
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
*
obj
=
(
IUnknown
*
)
iface
;
return
S_OK
;
}
ok
(
0
,
"unexpected call %s
\n
"
,
debugstr_guid
(
iid
)
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
2
;
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
1
;
}
static
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
,
};
static
IUnknown
outer
=
{
&
outer_vtbl
};
static
void
test_CoCreateInstance
(
DWORD
version
)
{
static
const
struct
...
...
@@ -113,6 +148,7 @@ static void test_CoCreateInstance( DWORD version )
IDirectInputDeviceA
*
device
;
IDirectInputA
*
dinput
;
IUnknown
*
unknown
;
HRESULT
hr
;
LONG
ref
;
int
i
;
...
...
@@ -127,6 +163,14 @@ static void test_CoCreateInstance( DWORD version )
return
;
}
if
(
version
<
0x800
)
hr
=
CoCreateInstance
(
&
CLSID_DirectInput
,
&
outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectInputA
,
(
void
**
)
&
unknown
);
else
hr
=
CoCreateInstance
(
&
CLSID_DirectInput8
,
&
outer
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectInput8A
,
(
void
**
)
&
unknown
);
todo_wine
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"CoCreateInstance returned %#x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unknown
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
create_device_tests
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
...
...
@@ -204,6 +248,14 @@ static void test_DirectInputCreate( DWORD version )
HRESULT
hr
;
int
i
;
unknown
=
(
void
*
)
0xdeadbeef
;
hr
=
DirectInputCreateW
(
hInstance
,
version
,
(
IDirectInputW
**
)
&
unknown
,
&
outer
);
todo_wine_if
(
version
==
0x800
)
ok
(
hr
==
DI_OK
,
"DirectInputCreateW returned %#x
\n
"
,
hr
);
todo_wine_if
(
version
<=
0x700
)
ok
(
unknown
==
NULL
,
"got IUnknown %p
\n
"
,
unknown
);
if
(
unknown
)
IUnknown_Release
(
unknown
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
create_tests
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
...
...
@@ -271,6 +323,14 @@ static void test_DirectInputCreateEx( DWORD version )
return
;
}
unknown
=
(
void
*
)
0xdeadbeef
;
hr
=
pDirectInputCreateEx
(
hInstance
,
version
,
&
IID_IDirectInputW
,
(
void
**
)
&
unknown
,
&
outer
);
todo_wine_if
(
version
==
0x800
)
ok
(
hr
==
DI_OK
,
"DirectInputCreateW returned %#x
\n
"
,
hr
);
todo_wine_if
(
version
<=
0x700
)
ok
(
unknown
==
NULL
,
"got IUnknown %p
\n
"
,
unknown
);
if
(
unknown
)
IUnknown_Release
(
unknown
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
create_tests
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
...
...
@@ -356,6 +416,13 @@ static void test_DirectInput8Create( DWORD version )
HRESULT
hr
;
int
i
;
unknown
=
(
void
*
)
0xdeadbeef
;
hr
=
DirectInput8Create
(
hInstance
,
version
,
&
IID_IDirectInput8W
,
(
void
**
)
&
unknown
,
&
outer
);
ok
(
hr
==
DI_OK
,
"DirectInputCreateW returned %#x
\n
"
,
hr
);
todo_wine
ok
(
unknown
==
NULL
,
"got IUnknown %p
\n
"
,
unknown
);
if
(
unknown
)
IUnknown_Release
(
unknown
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
create_tests
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
...
...
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