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
873e5bfe
Commit
873e5bfe
authored
Sep 17, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Sep 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use InterlockedIncrement/InterlockedDecrement for reference counting.
Fix bug in effect enumeration that crashed dxcapsviewer.
parent
f0509667
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
31 deletions
+31
-31
device.c
dlls/dinput/device.c
+6
-10
dinput_main.c
dlls/dinput/dinput_main.c
+7
-7
joystick_linux.c
dlls/dinput/joystick_linux.c
+4
-3
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+4
-3
keyboard.c
dlls/dinput/keyboard.c
+4
-3
mouse.c
dlls/dinput/mouse.c
+6
-5
No files found.
dlls/dinput/device.c
View file @
873e5bfe
...
@@ -475,11 +475,11 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
...
@@ -475,11 +475,11 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
ULONG
WINAPI
IDirectInputDevice2AImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
ULONG
WINAPI
IDirectInputDevice2AImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
{
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
This
->
ref
--
;
ULONG
ref
;
if
(
This
->
ref
)
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
return
This
->
ref
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
DI_OK
;
return
ref
;
}
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_QueryInterface
(
HRESULT
WINAPI
IDirectInputDevice2AImpl_QueryInterface
(
...
@@ -548,7 +548,7 @@ ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
...
@@ -548,7 +548,7 @@ ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
LPDIRECTINPUTDEVICE8A
iface
)
LPDIRECTINPUTDEVICE8A
iface
)
{
{
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
return
++
This
->
ref
;
return
InterlockedIncrement
(
&
(
This
->
ref
))
;
}
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumObjects
(
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumObjects
(
...
@@ -688,8 +688,6 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
...
@@ -688,8 +688,6 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
FIXME
(
"(this=%p,%p,%p,0x%08lx): stub!
\n
"
,
FIXME
(
"(this=%p,%p,%p,0x%08lx): stub!
\n
"
,
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
if
(
lpCallback
)
lpCallback
(
NULL
,
lpvRef
);
return
DI_OK
;
return
DI_OK
;
}
}
...
@@ -702,8 +700,6 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
...
@@ -702,8 +700,6 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
FIXME
(
"(this=%p,%p,%p,0x%08lx): stub!
\n
"
,
FIXME
(
"(this=%p,%p,%p,0x%08lx): stub!
\n
"
,
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
if
(
lpCallback
)
lpCallback
(
NULL
,
lpvRef
);
return
DI_OK
;
return
DI_OK
;
}
}
...
...
dlls/dinput/dinput_main.c
View file @
873e5bfe
...
@@ -291,17 +291,17 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
...
@@ -291,17 +291,17 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
static
ULONG
WINAPI
IDirectInputAImpl_AddRef
(
LPDIRECTINPUT7A
iface
)
static
ULONG
WINAPI
IDirectInputAImpl_AddRef
(
LPDIRECTINPUT7A
iface
)
{
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
((
&
This
->
ref
)
);
}
}
static
ULONG
WINAPI
IDirectInputAImpl_Release
(
LPDIRECTINPUT7A
iface
)
static
ULONG
WINAPI
IDirectInputAImpl_Release
(
LPDIRECTINPUT7A
iface
)
{
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
if
(
!
(
--
This
->
ref
))
{
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
ref
;
}
return
This
->
ref
;
}
}
static
HRESULT
WINAPI
IDirectInputAImpl_QueryInterface
(
LPDIRECTINPUT7A
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectInputAImpl_QueryInterface
(
LPDIRECTINPUT7A
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
@@ -640,13 +640,13 @@ static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOI
...
@@ -640,13 +640,13 @@ static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOI
static
ULONG
WINAPI
DICF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DICF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
(
This
->
ref
)
);
}
}
static
ULONG
WINAPI
DICF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DICF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
(
This
->
ref
)
);
}
}
static
HRESULT
WINAPI
DICF_CreateInstance
(
static
HRESULT
WINAPI
DICF_CreateInstance
(
...
...
dlls/dinput/joystick_linux.c
View file @
873e5bfe
...
@@ -662,10 +662,11 @@ DECL_GLOBAL_CONSTRUCTOR(joydev_register) { dinput_register_device(&joydev); }
...
@@ -662,10 +662,11 @@ DECL_GLOBAL_CONSTRUCTOR(joydev_register) { dinput_register_device(&joydev); }
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
This
->
ref
--
;
ref
=
InterlockedDecrement
((
&
This
->
ref
))
;
if
(
This
->
ref
)
if
(
ref
)
return
This
->
ref
;
return
ref
;
/* Free the device name */
/* Free the device name */
if
(
This
->
name
)
if
(
This
->
name
)
...
...
dlls/dinput/joystick_linuxinput.c
View file @
873e5bfe
...
@@ -332,10 +332,11 @@ DECL_GLOBAL_CONSTRUCTOR(joydev_register) { dinput_register_device(&joydev); }
...
@@ -332,10 +332,11 @@ DECL_GLOBAL_CONSTRUCTOR(joydev_register) { dinput_register_device(&joydev); }
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
static
ULONG
WINAPI
JoystickAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
))
;
if
(
This
->
ref
)
if
(
ref
)
return
This
->
ref
;
return
ref
;
/* Free the data queue */
/* Free the data queue */
if
(
This
->
data_queue
!=
NULL
)
if
(
This
->
data_queue
!=
NULL
)
...
...
dlls/dinput/keyboard.c
View file @
873e5bfe
...
@@ -303,10 +303,11 @@ DECL_GLOBAL_CONSTRUCTOR(keyboarddev_register) { dinput_register_device(&keyboard
...
@@ -303,10 +303,11 @@ DECL_GLOBAL_CONSTRUCTOR(keyboarddev_register) { dinput_register_device(&keyboard
static
ULONG
WINAPI
SysKeyboardAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
static
ULONG
WINAPI
SysKeyboardAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
ULONG
ref
;
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
))
;
if
(
This
->
ref
)
if
(
ref
)
return
This
->
ref
;
return
ref
;
EnterCriticalSection
(
&
keyboard_crit
);
EnterCriticalSection
(
&
keyboard_crit
);
if
(
!--
keyboard_users
)
{
if
(
!--
keyboard_users
)
{
...
...
dlls/dinput/mouse.c
View file @
873e5bfe
...
@@ -326,10 +326,11 @@ DECL_GLOBAL_CONSTRUCTOR(mousedev_register) { dinput_register_device(&mousedev);
...
@@ -326,10 +326,11 @@ DECL_GLOBAL_CONSTRUCTOR(mousedev_register) { dinput_register_device(&mousedev);
static
ULONG
WINAPI
SysMouseAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
static
ULONG
WINAPI
SysMouseAImpl_Release
(
LPDIRECTINPUTDEVICE8A
iface
)
{
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
ULONG
ref
;
This
->
ref
--
;
if
(
This
->
ref
)
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
return
This
->
ref
;
if
(
ref
)
return
ref
;
/* Free the data queue */
/* Free the data queue */
if
(
This
->
data_queue
!=
NULL
)
if
(
This
->
data_queue
!=
NULL
)
...
@@ -349,7 +350,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
...
@@ -349,7 +350,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
DI_OK
;
return
0
;
}
}
...
...
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