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
75a17709
Commit
75a17709
authored
Jun 27, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jun 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Remove duplicate code.
parent
47708a77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
56 deletions
+16
-56
dinput_main.c
dlls/dinput/dinput_main.c
+16
-56
No files found.
dlls/dinput/dinput_main.c
View file @
75a17709
...
...
@@ -297,62 +297,6 @@ static HRESULT WINAPI IDirectInputWImpl_QueryInterface(LPDIRECTINPUT7W iface, RE
return
E_FAIL
;
}
static
HRESULT
WINAPI
IDirectInputAImpl_CreateDevice
(
LPDIRECTINPUT7A
iface
,
REFGUID
rguid
,
LPDIRECTINPUTDEVICEA
*
pdev
,
LPUNKNOWN
punk
)
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
HRESULT
ret_value
=
DIERR_DEVICENOTREG
;
int
i
;
TRACE
(
"(this=%p,%s,%p,%p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
pdev
,
punk
);
if
(
pdev
==
NULL
)
{
WARN
(
"invalid pointer: pdev == NULL
\n
"
);
return
E_POINTER
;
}
if
(
rguid
==
NULL
)
{
WARN
(
"invalid pointer: rguid == NULL
\n
"
);
return
E_POINTER
;
}
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
if
(
!
dinput_devices
[
i
]
->
create_deviceA
)
continue
;
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceA
(
This
,
rguid
,
NULL
,
pdev
))
==
DI_OK
)
return
DI_OK
;
if
(
ret
==
DIERR_NOINTERFACE
)
ret_value
=
DIERR_NOINTERFACE
;
}
return
ret_value
;
}
static
HRESULT
WINAPI
IDirectInputWImpl_CreateDevice
(
LPDIRECTINPUT7W
iface
,
REFGUID
rguid
,
LPDIRECTINPUTDEVICEW
*
pdev
,
LPUNKNOWN
punk
)
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
HRESULT
ret_value
=
DIERR_DEVICENOTREG
;
int
i
;
TRACE
(
"(this=%p,%s,%p,%p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
pdev
,
punk
);
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
if
(
!
dinput_devices
[
i
]
->
create_deviceW
)
continue
;
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceW
(
This
,
rguid
,
NULL
,
pdev
))
==
DI_OK
)
return
DI_OK
;
if
(
ret
==
DIERR_NOINTERFACE
)
ret_value
=
DIERR_NOINTERFACE
;
}
return
ret_value
;
}
static
HRESULT
WINAPI
IDirectInputAImpl_Initialize
(
LPDIRECTINPUT7A
iface
,
HINSTANCE
hinst
,
DWORD
x
)
{
TRACE
(
"(this=%p,%p,%x)
\n
"
,
iface
,
hinst
,
x
);
...
...
@@ -406,6 +350,8 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R
TRACE
(
"(%p)->(%s, %s, %p, %p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
debugstr_guid
(
riid
),
pvOut
,
lpUnknownOuter
);
if
(
!
rguid
||
!
pvOut
)
return
E_POINTER
;
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
...
...
@@ -429,6 +375,8 @@ static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, R
TRACE
(
"(%p)->(%s, %s, %p, %p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
debugstr_guid
(
riid
),
pvOut
,
lpUnknownOuter
);
if
(
!
rguid
||
!
pvOut
)
return
E_POINTER
;
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
...
...
@@ -443,6 +391,18 @@ static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, R
return
ret_value
;
}
static
HRESULT
WINAPI
IDirectInputAImpl_CreateDevice
(
LPDIRECTINPUT7A
iface
,
REFGUID
rguid
,
LPDIRECTINPUTDEVICEA
*
pdev
,
LPUNKNOWN
punk
)
{
return
IDirectInput7AImpl_CreateDeviceEx
(
iface
,
rguid
,
NULL
,
(
LPVOID
*
)
pdev
,
punk
);
}
static
HRESULT
WINAPI
IDirectInputWImpl_CreateDevice
(
LPDIRECTINPUT7W
iface
,
REFGUID
rguid
,
LPDIRECTINPUTDEVICEW
*
pdev
,
LPUNKNOWN
punk
)
{
return
IDirectInput7WImpl_CreateDeviceEx
(
iface
,
rguid
,
NULL
,
(
LPVOID
*
)
pdev
,
punk
);
}
static
HRESULT
WINAPI
IDirectInput8AImpl_QueryInterface
(
LPDIRECTINPUT8A
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
...
...
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