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
fb1082ae
Commit
fb1082ae
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: Combine all Release functionality into base class.
parent
d2966c2d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
138 deletions
+24
-138
device.c
dlls/dinput/device.c
+16
-4
joystick_linux.c
dlls/dinput/joystick_linux.c
+2
-41
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+2
-35
keyboard.c
dlls/dinput/keyboard.c
+2
-27
mouse.c
dlls/dinput/mouse.c
+2
-31
No files found.
dlls/dinput/device.c
View file @
fb1082ae
...
@@ -677,8 +677,21 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
...
@@ -677,8 +677,21 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
)
return
ref
;
if
(
ref
)
return
ref
;
DeleteCriticalSection
(
&
This
->
crit
);
IDirectInputDevice_Unacquire
(
iface
);
/* Reset the FF state, free all effects, etc */
IDirectInputDevice8_SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_queue
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_queue
);
/* Free data format */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_format
.
wine_df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
data_format
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
dinput
);
This
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
DI_OK
;
return
DI_OK
;
...
@@ -1173,9 +1186,8 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
...
@@ -1173,9 +1186,8 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIRECTINPUTDEVICE8A
iface
,
DWORD
dwFlags
)
DWORD
dwFlags
)
{
{
FIXME
(
"(this=%p,0x%08x): stub!
\n
"
,
TRACE
(
"(%p) 0x%08x:
\n
"
,
iface
,
dwFlags
);
iface
,
dwFlags
);
return
DI_NOEFFECT
;
return
DI_OK
;
}
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects
(
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects
(
...
...
dlls/dinput/joystick_linux.c
View file @
fb1082ae
...
@@ -632,45 +632,6 @@ const struct dinput_device joystick_linux_device = {
...
@@ -632,45 +632,6 @@ const struct dinput_device joystick_linux_device = {
};
};
/******************************************************************************
/******************************************************************************
* Joystick
*/
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
IDirectInputDevice_Unacquire
(
iface
);
/* Free the device name */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
name
);
/* Free the axis map */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
axis_map
);
/* Free the data queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_queue
);
/* Free the properties */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
props
);
/* release the data transform filter */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
base
.
data_format
);
This
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
base
.
dinput
);
DeleteCriticalSection
(
&
This
->
base
.
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
/******************************************************************************
* Acquire : gets exclusive control of the joystick
* Acquire : gets exclusive control of the joystick
*/
*/
static
HRESULT
WINAPI
JoystickAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
static
HRESULT
WINAPI
JoystickAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
...
@@ -1214,7 +1175,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
...
@@ -1214,7 +1175,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
{
{
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_AddRef
,
IDirectInputDevice2AImpl_AddRef
,
Joystick
AImpl_Release
,
IDirectInputDevice2
AImpl_Release
,
JoystickAImpl_GetCapabilities
,
JoystickAImpl_GetCapabilities
,
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_EnumObjects
,
JoystickAImpl_GetProperty
,
JoystickAImpl_GetProperty
,
...
@@ -1256,7 +1217,7 @@ static const IDirectInputDevice8WVtbl SysJoystickWvt =
...
@@ -1256,7 +1217,7 @@ static const IDirectInputDevice8WVtbl SysJoystickWvt =
{
{
IDirectInputDevice2WImpl_QueryInterface
,
IDirectInputDevice2WImpl_QueryInterface
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
Release
)
Joystick
AImpl_Release
,
XCAST
(
Release
)
IDirectInputDevice2
AImpl_Release
,
XCAST
(
GetCapabilities
)
JoystickAImpl_GetCapabilities
,
XCAST
(
GetCapabilities
)
JoystickAImpl_GetCapabilities
,
IDirectInputDevice2WImpl_EnumObjects
,
IDirectInputDevice2WImpl_EnumObjects
,
XCAST
(
GetProperty
)
JoystickAImpl_GetProperty
,
XCAST
(
GetProperty
)
JoystickAImpl_GetProperty
,
...
...
dlls/dinput/joystick_linuxinput.c
View file @
fb1082ae
...
@@ -502,39 +502,6 @@ const struct dinput_device joystick_linuxinput_device = {
...
@@ -502,39 +502,6 @@ const struct dinput_device joystick_linuxinput_device = {
};
};
/******************************************************************************
/******************************************************************************
* Joystick
*/
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
IDirectInputDevice_Unacquire
(
iface
);
/* Reset the FF state, free all effects, etc */
IDirectInputDevice8_SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
/* Free the data queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_queue
);
/* release the data transform filter */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
base
.
data_format
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
base
.
dinput
);
This
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
base
.
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
/******************************************************************************
* Acquire : gets exclusive control of the joystick
* Acquire : gets exclusive control of the joystick
*/
*/
static
HRESULT
WINAPI
JoystickAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
static
HRESULT
WINAPI
JoystickAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
...
@@ -1325,7 +1292,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
...
@@ -1325,7 +1292,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
{
{
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_AddRef
,
IDirectInputDevice2AImpl_AddRef
,
Joystick
AImpl_Release
,
IDirectInputDevice2
AImpl_Release
,
JoystickAImpl_GetCapabilities
,
JoystickAImpl_GetCapabilities
,
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_EnumObjects
,
JoystickAImpl_GetProperty
,
JoystickAImpl_GetProperty
,
...
@@ -1367,7 +1334,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
...
@@ -1367,7 +1334,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
{
{
IDirectInputDevice2WImpl_QueryInterface
,
IDirectInputDevice2WImpl_QueryInterface
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
Release
)
Joystick
AImpl_Release
,
XCAST
(
Release
)
IDirectInputDevice2
AImpl_Release
,
XCAST
(
GetCapabilities
)
JoystickAImpl_GetCapabilities
,
XCAST
(
GetCapabilities
)
JoystickAImpl_GetCapabilities
,
IDirectInputDevice2WImpl_EnumObjects
,
IDirectInputDevice2WImpl_EnumObjects
,
XCAST
(
GetProperty
)
JoystickAImpl_GetProperty
,
XCAST
(
GetProperty
)
JoystickAImpl_GetProperty
,
...
...
dlls/dinput/keyboard.c
View file @
fb1082ae
...
@@ -271,31 +271,6 @@ const struct dinput_device keyboard_device = {
...
@@ -271,31 +271,6 @@ const struct dinput_device keyboard_device = {
keyboarddev_create_deviceW
keyboarddev_create_deviceW
};
};
static
ULONG
WINAPI
SysKeyboardAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
IDirectInputDevice_Unacquire
(
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_queue
);
/* Free data format */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
base
.
data_format
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
base
.
dinput
);
This
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
base
.
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
DI_OK
;
}
static
HRESULT
WINAPI
SysKeyboardAImpl_GetDeviceState
(
static
HRESULT
WINAPI
SysKeyboardAImpl_GetDeviceState
(
LPDIRECTINPUTDEVICE8A
iface
,
DWORD
len
,
LPVOID
ptr
LPDIRECTINPUTDEVICE8A
iface
,
DWORD
len
,
LPVOID
ptr
)
)
...
@@ -487,7 +462,7 @@ static const IDirectInputDevice8AVtbl SysKeyboardAvt =
...
@@ -487,7 +462,7 @@ static const IDirectInputDevice8AVtbl SysKeyboardAvt =
{
{
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_AddRef
,
IDirectInputDevice2AImpl_AddRef
,
SysKeyboard
AImpl_Release
,
IDirectInputDevice2
AImpl_Release
,
SysKeyboardAImpl_GetCapabilities
,
SysKeyboardAImpl_GetCapabilities
,
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_GetProperty
,
IDirectInputDevice2AImpl_GetProperty
,
...
@@ -529,7 +504,7 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt =
...
@@ -529,7 +504,7 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt =
{
{
IDirectInputDevice2WImpl_QueryInterface
,
IDirectInputDevice2WImpl_QueryInterface
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
Release
)
SysKeyboard
AImpl_Release
,
XCAST
(
Release
)
IDirectInputDevice2
AImpl_Release
,
XCAST
(
GetCapabilities
)
SysKeyboardAImpl_GetCapabilities
,
XCAST
(
GetCapabilities
)
SysKeyboardAImpl_GetCapabilities
,
IDirectInputDevice2WImpl_EnumObjects
,
IDirectInputDevice2WImpl_EnumObjects
,
XCAST
(
GetProperty
)
IDirectInputDevice2AImpl_GetProperty
,
XCAST
(
GetProperty
)
IDirectInputDevice2AImpl_GetProperty
,
...
...
dlls/dinput/mouse.c
View file @
fb1082ae
...
@@ -254,35 +254,6 @@ const struct dinput_device mouse_device = {
...
@@ -254,35 +254,6 @@ const struct dinput_device mouse_device = {
* SysMouseA (DInput Mouse support)
* SysMouseA (DInput Mouse support)
*/
*/
/******************************************************************************
* Release : release the mouse buffer.
*/
static
ULONG
WINAPI
SysMouseAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
IDirectInputDevice_Unacquire
(
iface
);
/* Free the data queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_queue
);
/* Free data format */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
base
.
data_format
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
base
.
dinput
);
This
->
base
.
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
base
.
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
/* low-level mouse hook */
/* low-level mouse hook */
static
LRESULT
CALLBACK
dinput_mouse_hook
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
static
LRESULT
CALLBACK
dinput_mouse_hook
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
{
...
@@ -738,7 +709,7 @@ static const IDirectInputDevice8AVtbl SysMouseAvt =
...
@@ -738,7 +709,7 @@ static const IDirectInputDevice8AVtbl SysMouseAvt =
{
{
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_QueryInterface
,
IDirectInputDevice2AImpl_AddRef
,
IDirectInputDevice2AImpl_AddRef
,
SysMouse
AImpl_Release
,
IDirectInputDevice2
AImpl_Release
,
SysMouseAImpl_GetCapabilities
,
SysMouseAImpl_GetCapabilities
,
IDirectInputDevice2AImpl_EnumObjects
,
IDirectInputDevice2AImpl_EnumObjects
,
SysMouseAImpl_GetProperty
,
SysMouseAImpl_GetProperty
,
...
@@ -780,7 +751,7 @@ static const IDirectInputDevice8WVtbl SysMouseWvt =
...
@@ -780,7 +751,7 @@ static const IDirectInputDevice8WVtbl SysMouseWvt =
{
{
IDirectInputDevice2WImpl_QueryInterface
,
IDirectInputDevice2WImpl_QueryInterface
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
AddRef
)
IDirectInputDevice2AImpl_AddRef
,
XCAST
(
Release
)
SysMouse
AImpl_Release
,
XCAST
(
Release
)
IDirectInputDevice2
AImpl_Release
,
XCAST
(
GetCapabilities
)
SysMouseAImpl_GetCapabilities
,
XCAST
(
GetCapabilities
)
SysMouseAImpl_GetCapabilities
,
IDirectInputDevice2WImpl_EnumObjects
,
IDirectInputDevice2WImpl_EnumObjects
,
XCAST
(
GetProperty
)
SysMouseAImpl_GetProperty
,
XCAST
(
GetProperty
)
SysMouseAImpl_GetProperty
,
...
...
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