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
46d35211
Commit
46d35211
authored
Oct 11, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move device_instance_is_disabled to device.c.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7d4d3944
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
48 deletions
+49
-48
device.c
dlls/dinput/device.c
+48
-0
device_private.h
dlls/dinput/device_private.h
+1
-0
joystick.c
dlls/dinput/joystick.c
+0
-48
No files found.
dlls/dinput/device.c
View file @
46d35211
...
...
@@ -314,6 +314,54 @@ DWORD get_config_key( HKEY defkey, HKEY appkey, const WCHAR *name, WCHAR *buffer
return
ERROR_FILE_NOT_FOUND
;
}
BOOL
device_instance_is_disabled
(
DIDEVICEINSTANCEW
*
instance
,
BOOL
*
override
)
{
static
const
WCHAR
disabled_str
[]
=
{
'd'
,
'i'
,
's'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
override_str
[]
=
{
'o'
,
'v'
,
'e'
,
'r'
,
'r'
,
'i'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
joystick_key
[]
=
{
'J'
,
'o'
,
'y'
,
's'
,
't'
,
'i'
,
'c'
,
'k'
,
's'
,
0
};
WCHAR
buffer
[
MAX_PATH
];
HKEY
hkey
,
appkey
,
temp
;
BOOL
disable
=
FALSE
;
get_app_key
(
&
hkey
,
&
appkey
);
if
(
override
)
*
override
=
FALSE
;
/* Joystick settings are in the 'joysticks' subkey */
if
(
appkey
)
{
if
(
RegOpenKeyW
(
appkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
appkey
);
appkey
=
temp
;
}
if
(
hkey
)
{
if
(
RegOpenKeyW
(
hkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
hkey
);
hkey
=
temp
;
}
/* Look for the "controllername"="disabled" key */
if
(
!
get_config_key
(
hkey
,
appkey
,
instance
->
tszInstanceName
,
buffer
,
sizeof
(
buffer
)
))
{
if
(
!
strcmpW
(
disabled_str
,
buffer
))
{
TRACE
(
"Disabling joystick '%s' based on registry key.
\n
"
,
debugstr_w
(
instance
->
tszInstanceName
)
);
disable
=
TRUE
;
}
else
if
(
override
&&
!
strcmpW
(
override_str
,
buffer
))
{
TRACE
(
"Force enabling joystick '%s' based on registry key.
\n
"
,
debugstr_w
(
instance
->
tszInstanceName
)
);
*
override
=
TRUE
;
}
}
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
return
disable
;
}
/* Conversion between internal data buffer and external data buffer */
void
fill_DataFormat
(
void
*
out
,
DWORD
size
,
const
void
*
in
,
const
DataFormat
*
df
)
{
...
...
dlls/dinput/device_private.h
View file @
46d35211
...
...
@@ -98,6 +98,7 @@ extern const IDirectInputDevice8AVtbl dinput_device_a_vtbl DECLSPEC_HIDDEN;
extern
BOOL
get_app_key
(
HKEY
*
,
HKEY
*
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_config_key
(
HKEY
,
HKEY
,
const
WCHAR
*
,
WCHAR
*
,
DWORD
)
DECLSPEC_HIDDEN
;
extern
BOOL
device_instance_is_disabled
(
DIDEVICEINSTANCEW
*
instance
,
BOOL
*
override
)
DECLSPEC_HIDDEN
;
/* Routines to do DataFormat / WineFormat conversions */
extern
void
fill_DataFormat
(
void
*
out
,
DWORD
size
,
const
void
*
in
,
const
DataFormat
*
df
)
DECLSPEC_HIDDEN
;
...
...
dlls/dinput/joystick.c
View file @
46d35211
...
...
@@ -279,54 +279,6 @@ BOOL device_disabled_registry(const char* name)
return
device_instance_is_disabled
(
&
instance
,
NULL
);
}
BOOL
device_instance_is_disabled
(
DIDEVICEINSTANCEW
*
instance
,
BOOL
*
override
)
{
static
const
WCHAR
disabled_str
[]
=
{
'd'
,
'i'
,
's'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
override_str
[]
=
{
'o'
,
'v'
,
'e'
,
'r'
,
'r'
,
'i'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
joystick_key
[]
=
{
'J'
,
'o'
,
'y'
,
's'
,
't'
,
'i'
,
'c'
,
'k'
,
's'
,
0
};
WCHAR
buffer
[
MAX_PATH
];
HKEY
hkey
,
appkey
,
temp
;
BOOL
disable
=
FALSE
;
get_app_key
(
&
hkey
,
&
appkey
);
if
(
override
)
*
override
=
FALSE
;
/* Joystick settings are in the 'joysticks' subkey */
if
(
appkey
)
{
if
(
RegOpenKeyW
(
appkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
appkey
);
appkey
=
temp
;
}
if
(
hkey
)
{
if
(
RegOpenKeyW
(
hkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
hkey
);
hkey
=
temp
;
}
/* Look for the "controllername"="disabled" key */
if
(
!
get_config_key
(
hkey
,
appkey
,
instance
->
tszInstanceName
,
buffer
,
sizeof
(
buffer
)
))
{
if
(
!
strcmpW
(
disabled_str
,
buffer
))
{
TRACE
(
"Disabling joystick '%s' based on registry key.
\n
"
,
debugstr_w
(
instance
->
tszInstanceName
)
);
disable
=
TRUE
;
}
else
if
(
override
&&
!
strcmpW
(
override_str
,
buffer
))
{
TRACE
(
"Force enabling joystick '%s' based on registry key.
\n
"
,
debugstr_w
(
instance
->
tszInstanceName
)
);
*
override
=
TRUE
;
}
}
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
return
disable
;
}
BOOL
is_xinput_device
(
const
DIDEVCAPS
*
devcaps
,
WORD
vid
,
WORD
pid
)
{
int
i
;
...
...
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