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
4f640697
Commit
4f640697
authored
Jun 04, 2004
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jun 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- some new logging on device enumeration
- fix version setting in DirectInputCreate(A/W) functions
parent
667ac7ff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
31 deletions
+91
-31
dinput_main.c
dlls/dinput/dinput_main.c
+81
-26
dinput_private.h
dlls/dinput/dinput_private.h
+6
-5
joystick_linux.c
dlls/dinput/joystick_linux.c
+1
-0
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-0
keyboard.c
dlls/dinput/keyboard.c
+1
-0
mouse.c
dlls/dinput/mouse.c
+1
-0
No files found.
dlls/dinput/dinput_main.c
View file @
4f640697
...
...
@@ -162,6 +162,12 @@ HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU
This
=
(
IDirectInputImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IDirectInputImpl
));
This
->
lpVtbl
=
&
ddi7avt
;
This
->
ref
=
1
;
if
(
dwVersion
>=
0x0800
)
{
This
->
version
=
8
;
}
else
{
/* We do not differientiate between version 1, 2 and 7 */
This
->
version
=
1
;
}
*
ppDI
=
(
IDirectInputA
*
)
This
;
return
0
;
...
...
@@ -177,9 +183,50 @@ HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU
This
=
(
IDirectInputImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IDirectInputImpl
));
This
->
lpVtbl
=
&
ddi7wvt
;
This
->
ref
=
1
;
if
(
dwVersion
>=
0x0800
)
{
This
->
version
=
8
;
}
else
{
/* We do not differientiate between version 1, 2 and 7 */
This
->
version
=
1
;
}
*
ppDI
=
(
IDirectInputW
*
)
This
;
return
0
;
}
static
char
*
_dump_DIDEVTYPE_value
(
DWORD
dwDevType
)
{
switch
(
dwDevType
)
{
case
0
:
return
"All devices"
;
case
DIDEVTYPE_MOUSE
:
return
"DIDEVTYPE_MOUSE"
;
case
DIDEVTYPE_KEYBOARD
:
return
"DIDEVTYPE_KEYBOARD"
;
case
DIDEVTYPE_JOYSTICK
:
return
"DIDEVTYPE_JOYSTICK"
;
case
DIDEVTYPE_DEVICE
:
return
"DIDEVTYPE_DEVICE"
;
default:
return
"Unkown"
;
}
}
static
void
_dump_EnumDevices_dwFlags
(
DWORD
dwFlags
)
{
if
(
TRACE_ON
(
dinput
))
{
int
i
;
static
const
struct
{
DWORD
mask
;
const
char
*
name
;
}
flags
[]
=
{
#define FE(x) { x, #x}
FE
(
DIEDFL_ALLDEVICES
),
FE
(
DIEDFL_ATTACHEDONLY
),
FE
(
DIEDFL_FORCEFEEDBACK
),
FE
(
DIEDFL_INCLUDEALIASES
),
FE
(
DIEDFL_INCLUDEPHANTOMS
)
#undef FE
};
if
(
dwFlags
==
0
)
{
DPRINTF
(
"DIEDFL_ALLDEVICES"
);
return
;
}
for
(
i
=
0
;
i
<
(
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]));
i
++
)
if
(
flags
[
i
].
mask
&
dwFlags
)
DPRINTF
(
"%s "
,
flags
[
i
].
name
);
}
}
/******************************************************************************
...
...
@@ -189,21 +236,25 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices(
LPDIRECTINPUT7A
iface
,
DWORD
dwDevType
,
LPDIENUMDEVICESCALLBACKA
lpCallback
,
LPVOID
pvRef
,
DWORD
dwFlags
)
{
ICOM_THIS
(
IDirectInputImpl
,
iface
);
DIDEVICEINSTANCEA
devInstance
;
int
i
;
TRACE
(
"(this=%p,0x%04lx,%p,%p,%04lx)
\n
"
,
This
,
dwDevType
,
lpCallback
,
pvRef
,
dwFlags
);
for
(
i
=
0
;
i
<
nrof_dinput_devices
;
i
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
if
(
dinput_devices
[
i
]
->
enum_deviceA
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
version
))
{
ICOM_THIS
(
IDirectInputImpl
,
iface
);
DIDEVICEINSTANCEA
devInstance
;
int
i
;
TRACE
(
"(this=%p,0x%04lx '%s',%p,%p,%04lx)
\n
"
,
This
,
dwDevType
,
_dump_DIDEVTYPE_value
(
dwDevType
),
lpCallback
,
pvRef
,
dwFlags
);
TRACE
(
" flags: "
);
_dump_EnumDevices_dwFlags
(
dwFlags
);
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
nrof_dinput_devices
;
i
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
TRACE
(
" - checking device %d ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
if
(
dinput_devices
[
i
]
->
enum_deviceA
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
version
))
{
if
(
lpCallback
(
&
devInstance
,
pvRef
)
==
DIENUM_STOP
)
return
0
;
}
return
0
;
}
return
0
;
}
return
0
;
}
/******************************************************************************
* IDirectInputW_EnumDevices
...
...
@@ -212,21 +263,25 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
LPDIRECTINPUT7W
iface
,
DWORD
dwDevType
,
LPDIENUMDEVICESCALLBACKW
lpCallback
,
LPVOID
pvRef
,
DWORD
dwFlags
)
{
ICOM_THIS
(
IDirectInputImpl
,
iface
);
DIDEVICEINSTANCEW
devInstance
;
int
i
;
TRACE
(
"(this=%p,0x%04lx,%p,%p,%04lx)
\n
"
,
This
,
dwDevType
,
lpCallback
,
pvRef
,
dwFlags
);
for
(
i
=
0
;
i
<
nrof_dinput_devices
;
i
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
if
(
dinput_devices
[
i
]
->
enum_deviceW
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
version
))
{
ICOM_THIS
(
IDirectInputImpl
,
iface
);
DIDEVICEINSTANCEW
devInstance
;
int
i
;
TRACE
(
"(this=%p,0x%04lx '%s',%p,%p,%04lx)
\n
"
,
This
,
dwDevType
,
_dump_DIDEVTYPE_value
(
dwDevType
),
lpCallback
,
pvRef
,
dwFlags
);
TRACE
(
" flags: "
);
_dump_EnumDevices_dwFlags
(
dwFlags
);
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
nrof_dinput_devices
;
i
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
TRACE
(
" - checking device %d ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
if
(
dinput_devices
[
i
]
->
enum_deviceW
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
version
))
{
if
(
lpCallback
(
&
devInstance
,
pvRef
)
==
DIENUM_STOP
)
return
0
;
}
return
0
;
}
return
0
;
}
return
0
;
}
static
ULONG
WINAPI
IDirectInputAImpl_AddRef
(
LPDIRECTINPUT7A
iface
)
...
...
dlls/dinput/dinput_private.h
View file @
4f640697
...
...
@@ -40,11 +40,12 @@ struct IDirectInputImpl
/* Function called by all devices that Wine supports */
typedef
struct
dinput_device
{
INT
pref
;
BOOL
(
*
enum_deviceA
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
int
version
);
BOOL
(
*
enum_deviceW
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
int
version
);
HRESULT
(
*
create_deviceA
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
REFIID
riid
,
LPDIRECTINPUTDEVICEA
*
pdev
);
HRESULT
(
*
create_deviceW
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
REFIID
riid
,
LPDIRECTINPUTDEVICEW
*
pdev
);
INT
pref
;
const
char
*
name
;
BOOL
(
*
enum_deviceA
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
int
version
);
BOOL
(
*
enum_deviceW
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
int
version
);
HRESULT
(
*
create_deviceA
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
REFIID
riid
,
LPDIRECTINPUTDEVICEA
*
pdev
);
HRESULT
(
*
create_deviceW
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
REFIID
riid
,
LPDIRECTINPUTDEVICEW
*
pdev
);
}
dinput_device
;
extern
void
dinput_register_device
(
dinput_device
*
device
);
...
...
dlls/dinput/joystick_linux.c
View file @
4f640697
...
...
@@ -219,6 +219,7 @@ static HRESULT joydev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, RE
static
dinput_device
joydev
=
{
10
,
"Wine Linux joystick driver"
,
joydev_enum_deviceA
,
joydev_enum_deviceW
,
joydev_create_deviceA
,
...
...
dlls/dinput/joystick_linuxinput.c
View file @
4f640697
...
...
@@ -310,6 +310,7 @@ static HRESULT joydev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, RE
static
dinput_device
joydev
=
{
20
,
"Wine Linux-input joystick driver"
,
joydev_enum_deviceA
,
joydev_enum_deviceW
,
joydev_create_deviceA
,
...
...
dlls/dinput/keyboard.c
View file @
4f640697
...
...
@@ -285,6 +285,7 @@ static HRESULT keyboarddev_create_deviceW(IDirectInputImpl *dinput, REFGUID rgui
static
dinput_device
keyboarddev
=
{
100
,
"Wine keyboard driver"
,
keyboarddev_enum_deviceA
,
keyboarddev_enum_deviceW
,
keyboarddev_create_deviceA
,
...
...
dlls/dinput/mouse.c
View file @
4f640697
...
...
@@ -300,6 +300,7 @@ static HRESULT mousedev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid,
}
static
dinput_device
mousedev
=
{
100
,
"Wine mouse driver"
,
mousedev_enum_deviceA
,
mousedev_enum_deviceW
,
mousedev_create_deviceA
,
...
...
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