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
71f41e5d
Commit
71f41e5d
authored
Dec 11, 2006
by
Christoph Frick
Committed by
Alexandre Julliard
Dec 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Utilize IDirectInputDevice2AImpl_Acquire/Unacquire.
parent
f37f598d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+21
-18
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
71f41e5d
...
...
@@ -605,26 +605,29 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat(
static
HRESULT
WINAPI
JoystickAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
HRESULT
res
;
TRACE
(
"(this=%p)
\n
"
,
This
);
if
(
This
->
joyfd
!=-
1
)
return
S_FALSE
;
if
(
This
->
df
==
NULL
)
{
return
DIERR_INVALIDPARAM
;
}
if
(
-
1
==
(
This
->
joyfd
=
open
(
This
->
joydev
->
device
,
O_RDWR
)))
{
if
(
-
1
==
(
This
->
joyfd
=
open
(
This
->
joydev
->
device
,
O_RDONLY
)))
{
/* Couldn't open the device at all */
perror
(
This
->
joydev
->
device
);
return
DIERR_NOTFOUND
;
}
else
{
/* Couldn't open in r/w but opened in read-only. */
WARN
(
"Could not open %s in read-write mode. Force feedback will be disabled.
\n
"
,
This
->
joydev
->
device
);
res
=
IDirectInputDevice2AImpl_Acquire
(
iface
);
if
(
res
==
DI_OK
)
{
if
(
-
1
==
(
This
->
joyfd
=
open
(
This
->
joydev
->
device
,
O_RDWR
)))
{
if
(
-
1
==
(
This
->
joyfd
=
open
(
This
->
joydev
->
device
,
O_RDONLY
)))
{
/* Couldn't open the device at all */
perror
(
This
->
joydev
->
device
);
IDirectInputDevice2AImpl_Unacquire
(
iface
);
return
DIERR_NOTFOUND
;
}
else
{
/* Couldn't open in r/w but opened in read-only. */
WARN
(
"Could not open %s in read-write mode. Force feedback will be disabled.
\n
"
,
This
->
joydev
->
device
);
}
}
}
return
0
;
return
res
;
}
/******************************************************************************
...
...
@@ -633,15 +636,15 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
static
HRESULT
WINAPI
JoystickAImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
HRESULT
res
;
TRACE
(
"(this=%p)
\n
"
,
This
);
if
(
This
->
joyfd
!=-
1
)
{
close
(
This
->
joyfd
);
This
->
joyfd
=
-
1
;
return
DI_OK
;
res
=
IDirectInputDevice2AImpl_Unacquire
(
iface
);
if
(
res
==
DI_OK
&&
This
->
joyfd
!=-
1
)
{
close
(
This
->
joyfd
)
;
This
->
joyfd
=
-
1
;
}
else
return
DI_NOEFFECT
;
return
res
;
}
/*
...
...
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