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
448dde9b
Commit
448dde9b
authored
Jul 06, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jul 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Keep the list of all the dinput devices created for each IDIrectInput object.
parent
06d6a03d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
14 deletions
+44
-14
device.c
dlls/dinput/device.c
+4
-0
device_private.h
dlls/dinput/device_private.h
+2
-0
dinput_main.c
dlls/dinput/dinput_main.c
+31
-9
dinput_private.h
dlls/dinput/dinput_private.h
+7
-5
No files found.
dlls/dinput/device.c
View file @
448dde9b
...
@@ -688,6 +688,10 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
...
@@ -688,6 +688,10 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_format
.
wine_df
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
data_format
);
release_DataFormat
(
&
This
->
data_format
);
EnterCriticalSection
(
&
This
->
dinput
->
crit
);
list_remove
(
&
This
->
entry
);
LeaveCriticalSection
(
&
This
->
dinput
->
crit
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
dinput
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
dinput
);
This
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
This
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
crit
);
DeleteCriticalSection
(
&
This
->
crit
);
...
...
dlls/dinput/device_private.h
View file @
448dde9b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "dinput.h"
#include "dinput.h"
#include "wine/list.h"
#include "dinput_private.h"
#include "dinput_private.h"
typedef
struct
typedef
struct
...
@@ -55,6 +56,7 @@ struct IDirectInputDevice2AImpl
...
@@ -55,6 +56,7 @@ struct IDirectInputDevice2AImpl
GUID
guid
;
GUID
guid
;
CRITICAL_SECTION
crit
;
CRITICAL_SECTION
crit
;
IDirectInputImpl
*
dinput
;
IDirectInputImpl
*
dinput
;
struct
list
entry
;
/* entry into IDirectInput devices list */
HANDLE
hEvent
;
HANDLE
hEvent
;
DWORD
dwCoopLevel
;
DWORD
dwCoopLevel
;
HWND
win
;
HWND
win
;
...
...
dlls/dinput/dinput_main.c
View file @
448dde9b
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include "winuser.h"
#include "winuser.h"
#include "winerror.h"
#include "winerror.h"
#include "dinput_private.h"
#include "dinput_private.h"
#include "device_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dinput
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dinput
);
...
@@ -129,6 +130,11 @@ HRESULT WINAPI DirectInputCreateEx(
...
@@ -129,6 +130,11 @@ HRESULT WINAPI DirectInputCreateEx(
This
->
dwVersion
=
dwVersion
;
This
->
dwVersion
=
dwVersion
;
This
->
evsequence
=
1
;
This
->
evsequence
=
1
;
*
ppDI
=
This
;
*
ppDI
=
This
;
InitializeCriticalSection
(
&
This
->
crit
);
This
->
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IDirectInputImpl*->crit"
);
list_init
(
&
This
->
devices_list
);
}
}
return
res
;
return
res
;
}
}
...
@@ -254,15 +260,19 @@ static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
...
@@ -254,15 +260,19 @@ static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
static
ULONG
WINAPI
IDirectInputAImpl_Release
(
LPDIRECTINPUT7A
iface
)
static
ULONG
WINAPI
IDirectInputAImpl_Release
(
LPDIRECTINPUT7A
iface
)
{
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
ULONG
ref
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
ref
=
InterlockedDecrement
(
&
This
->
ref
);
{
if
(
ref
)
return
ref
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
release_hook_thread
();
release_hook_thread
();
}
return
ref
;
This
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
}
static
HRESULT
WINAPI
IDirectInputAImpl_QueryInterface
(
LPDIRECTINPUT7A
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
IDirectInputAImpl_QueryInterface
(
LPDIRECTINPUT7A
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
@@ -355,9 +365,15 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R
...
@@ -355,9 +365,15 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R
/* Loop on all the devices to see if anyone matches the given GUID */
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
HRESULT
ret
;
if
(
!
dinput_devices
[
i
]
->
create_deviceA
)
continue
;
if
(
!
dinput_devices
[
i
]
->
create_deviceA
)
continue
;
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceA
(
This
,
rguid
,
riid
,
(
LPDIRECTINPUTDEVICEA
*
)
pvOut
))
==
DI_OK
)
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceA
(
This
,
rguid
,
riid
,
(
LPDIRECTINPUTDEVICEA
*
)
pvOut
))
==
DI_OK
)
{
EnterCriticalSection
(
&
This
->
crit
);
list_add_tail
(
&
This
->
devices_list
,
&
(
*
(
IDirectInputDevice2AImpl
**
)
pvOut
)
->
entry
);
LeaveCriticalSection
(
&
This
->
crit
);
return
DI_OK
;
return
DI_OK
;
}
if
(
ret
==
DIERR_NOINTERFACE
)
if
(
ret
==
DIERR_NOINTERFACE
)
ret_value
=
DIERR_NOINTERFACE
;
ret_value
=
DIERR_NOINTERFACE
;
...
@@ -380,9 +396,15 @@ static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, R
...
@@ -380,9 +396,15 @@ static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx(LPDIRECTINPUT7W iface, R
/* Loop on all the devices to see if anyone matches the given GUID */
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
HRESULT
ret
;
if
(
!
dinput_devices
[
i
]
->
create_deviceW
)
continue
;
if
(
!
dinput_devices
[
i
]
->
create_deviceW
)
continue
;
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceW
(
This
,
rguid
,
riid
,
(
LPDIRECTINPUTDEVICEW
*
)
pvOut
))
==
DI_OK
)
if
((
ret
=
dinput_devices
[
i
]
->
create_deviceW
(
This
,
rguid
,
riid
,
(
LPDIRECTINPUTDEVICEW
*
)
pvOut
))
==
DI_OK
)
{
EnterCriticalSection
(
&
This
->
crit
);
list_add_tail
(
&
This
->
devices_list
,
&
(
*
(
IDirectInputDevice2AImpl
**
)
pvOut
)
->
entry
);
LeaveCriticalSection
(
&
This
->
crit
);
return
DI_OK
;
return
DI_OK
;
}
if
(
ret
==
DIERR_NOINTERFACE
)
if
(
ret
==
DIERR_NOINTERFACE
)
ret_value
=
DIERR_NOINTERFACE
;
ret_value
=
DIERR_NOINTERFACE
;
...
...
dlls/dinput/dinput_private.h
View file @
448dde9b
...
@@ -24,18 +24,20 @@
...
@@ -24,18 +24,20 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "dinput.h"
#include "dinput.h"
#include "wine/list.h"
/* Implementation specification */
/* Implementation specification */
typedef
struct
IDirectInputImpl
IDirectInputImpl
;
typedef
struct
IDirectInputImpl
IDirectInputImpl
;
struct
IDirectInputImpl
struct
IDirectInputImpl
{
{
const
void
*
lpVtbl
;
const
void
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
/* Used to have an unique sequence number for all the events */
CRITICAL_SECTION
crit
;
DWORD
evsequence
;
DWORD
dwVersion
;
DWORD
evsequence
;
/* unique sequence number for events */
DWORD
dwVersion
;
/* direct input version number */
struct
list
devices_list
;
/* list of all created dinput devices */
};
};
/* Function called by all devices that Wine supports */
/* Function called by all devices that Wine supports */
...
...
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