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
a2c10f4d
Commit
a2c10f4d
authored
Apr 29, 2019
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Don't return unsupported interfaces.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c50b19c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
97 deletions
+52
-97
dinput_main.c
dlls/dinput/dinput_main.c
+18
-32
dinput.c
dlls/dinput/tests/dinput.c
+15
-31
dinput.c
dlls/dinput8/tests/dinput.c
+19
-34
No files found.
dlls/dinput/dinput_main.c
View file @
a2c10f4d
...
...
@@ -566,53 +566,39 @@ static HRESULT WINAPI IDirectInputAImpl_QueryInterface(LPDIRECTINPUT7A iface, RE
if
(
!
riid
||
!
ppobj
)
return
E_POINTER
;
*
ppobj
=
NULL
;
#if DIRECTINPUT_VERSION == 0x0700
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInputA
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput2A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput7A
,
riid
))
{
IsEqualGUID
(
&
IID_IDirectInputA
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput2A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput7A
,
riid
))
*
ppobj
=
&
This
->
IDirectInput7A_iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
return
DI_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirectInputW
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput2W
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput7W
,
riid
))
{
else
if
(
IsEqualGUID
(
&
IID_IDirectInputW
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput2W
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput7W
,
riid
))
*
ppobj
=
&
This
->
IDirectInput7W_iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
return
DI_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirectInput8A
,
riid
))
{
#else
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput8A
,
riid
))
*
ppobj
=
&
This
->
IDirectInput8A_iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
return
DI_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirectInput8W
,
riid
))
{
else
if
(
IsEqualGUID
(
&
IID_IDirectInput8W
,
riid
))
*
ppobj
=
&
This
->
IDirectInput8W_iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
return
DI_OK
;
}
#endif
if
(
IsEqualGUID
(
&
IID_IDirectInputJoyConfig8
,
riid
))
{
*
ppobj
=
&
This
->
IDirectInputJoyConfig8_iface
;
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
if
(
*
ppobj
)
{
IUnknown_AddRef
(
(
IUnknown
*
)
*
ppobj
);
return
DI_OK
;
}
FIXME
(
"Unsupported interface: %s
\n
"
,
debugstr_guid
(
riid
));
*
ppobj
=
NULL
;
WARN
(
"Unsupported interface: %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
...
...
dlls/dinput/tests/dinput.c
View file @
a2c10f4d
...
...
@@ -269,23 +269,19 @@ static void test_QueryInterface(void)
&
IID_IDirectInput2A
,
&
IID_IDirectInput2W
,
&
IID_IDirectInput7A
,
&
IID_IDirectInput7W
};
static
const
struct
{
REFIID
riid
;
int
test_todo
;
}
no_interface_list
[]
=
static
const
REFIID
no_interface_list
[]
=
{
{
&
IID_IDirectInput8A
,
1
}
,
{
&
IID_IDirectInput8W
,
1
}
,
{
&
IID_IDirectInputDeviceA
}
,
{
&
IID_IDirectInputDeviceW
}
,
{
&
IID_IDirectInputDevice2A
}
,
{
&
IID_IDirectInputDevice2W
}
,
{
&
IID_IDirectInputDevice7A
}
,
{
&
IID_IDirectInputDevice7W
}
,
{
&
IID_IDirectInputDevice8A
}
,
{
&
IID_IDirectInputDevice8W
}
,
{
&
IID_IDirectInputEffect
}
,
&
IID_IDirectInput8A
,
&
IID_IDirectInput8W
,
&
IID_IDirectInputDeviceA
,
&
IID_IDirectInputDeviceW
,
&
IID_IDirectInputDevice2A
,
&
IID_IDirectInputDevice2W
,
&
IID_IDirectInputDevice7A
,
&
IID_IDirectInputDevice7W
,
&
IID_IDirectInputDevice8A
,
&
IID_IDirectInputDevice8W
,
&
IID_IDirectInputEffect
,
};
IDirectInputA
*
pDI
;
...
...
@@ -323,21 +319,9 @@ static void test_QueryInterface(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
no_interface_list
);
i
++
)
{
pUnk
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectInput_QueryInterface
(
pDI
,
no_interface_list
[
i
].
riid
,
(
void
**
)
&
pUnk
);
if
(
no_interface_list
[
i
].
test_todo
)
{
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
todo_wine
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
if
(
pUnk
)
IUnknown_Release
(
pUnk
);
}
else
{
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
hr
=
IDirectInput_QueryInterface
(
pDI
,
no_interface_list
[
i
],
(
void
**
)
&
pUnk
);
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
IDirectInput_Release
(
pDI
);
...
...
dlls/dinput8/tests/dinput.c
View file @
a2c10f4d
...
...
@@ -222,27 +222,23 @@ static void test_QueryInterface(void)
{
static
REFIID
iid_list
[]
=
{
&
IID_IUnknown
,
&
IID_IDirectInput8A
,
&
IID_IDirectInput8W
,
&
IID_IDirectInputJoyConfig8
};
static
const
struct
{
REFIID
riid
;
int
test_todo
;
}
no_interface_list
[]
=
static
const
REFIID
no_interface_list
[]
=
{
{
&
IID_IDirectInputA
,
1
}
,
{
&
IID_IDirectInputW
,
1
}
,
{
&
IID_IDirectInput2A
,
1
}
,
{
&
IID_IDirectInput2W
,
1
}
,
{
&
IID_IDirectInput7A
,
1
}
,
{
&
IID_IDirectInput7W
,
1
}
,
{
&
IID_IDirectInputDeviceA
}
,
{
&
IID_IDirectInputDeviceW
}
,
{
&
IID_IDirectInputDevice2A
}
,
{
&
IID_IDirectInputDevice2W
}
,
{
&
IID_IDirectInputDevice7A
}
,
{
&
IID_IDirectInputDevice7W
}
,
{
&
IID_IDirectInputDevice8A
}
,
{
&
IID_IDirectInputDevice8W
}
,
{
&
IID_IDirectInputEffect
}
,
&
IID_IDirectInputA
,
&
IID_IDirectInputW
,
&
IID_IDirectInput2A
,
&
IID_IDirectInput2W
,
&
IID_IDirectInput7A
,
&
IID_IDirectInput7W
,
&
IID_IDirectInputDeviceA
,
&
IID_IDirectInputDeviceW
,
&
IID_IDirectInputDevice2A
,
&
IID_IDirectInputDevice2W
,
&
IID_IDirectInputDevice7A
,
&
IID_IDirectInputDevice7W
,
&
IID_IDirectInputDevice8A
,
&
IID_IDirectInputDevice8W
,
&
IID_IDirectInputEffect
,
};
IDirectInput8A
*
pDI
;
...
...
@@ -292,21 +288,10 @@ static void test_QueryInterface(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
no_interface_list
);
i
++
)
{
pUnk
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectInput8_QueryInterface
(
pDI
,
no_interface_list
[
i
].
riid
,
(
void
**
)
&
pUnk
);
if
(
no_interface_list
[
i
].
test_todo
)
{
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput8_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
todo_wine
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
hr
=
IDirectInput8_QueryInterface
(
pDI
,
no_interface_list
[
i
],
(
void
**
)
&
pUnk
);
if
(
pUnk
)
IUnknown_Release
(
pUnk
);
}
else
{
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput8_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
ok
(
hr
==
E_NOINTERFACE
,
"[%d] IDirectInput8_QueryInterface returned 0x%08x
\n
"
,
i
,
hr
);
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
IDirectInput8_Release
(
pDI
);
...
...
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