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
da87589e
Commit
da87589e
authored
Apr 09, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Rename hid_devices_* variables to rawinput_devices_*.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9e195ba9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
rawinput.c
dlls/user32/rawinput.c
+25
-24
No files found.
dlls/user32/rawinput.c
View file @
da87589e
...
...
@@ -47,17 +47,17 @@ struct device
PHIDP_PREPARSED_DATA
data
;
};
static
struct
device
*
hid
_devices
;
static
unsigned
int
hid_devices_count
,
hid
_devices_max
;
static
struct
device
*
rawinput
_devices
;
static
unsigned
int
rawinput_devices_count
,
rawinput
_devices_max
;
static
CRITICAL_SECTION
hid
_devices_cs
;
static
CRITICAL_SECTION_DEBUG
hid
_devices_cs_debug
=
static
CRITICAL_SECTION
rawinput
_devices_cs
;
static
CRITICAL_SECTION_DEBUG
rawinput
_devices_cs_debug
=
{
0
,
0
,
&
hid
_devices_cs
,
{
&
hid_devices_cs_debug
.
ProcessLocksList
,
&
hid
_devices_cs_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
":
hid
_devices_cs"
)
}
0
,
0
,
&
rawinput
_devices_cs
,
{
&
rawinput_devices_cs_debug
.
ProcessLocksList
,
&
rawinput
_devices_cs_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
":
rawinput
_devices_cs"
)
}
};
static
CRITICAL_SECTION
hid_devices_cs
=
{
&
hid
_devices_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
CRITICAL_SECTION
rawinput_devices_cs
=
{
&
rawinput
_devices_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
BOOL
array_reserve
(
void
**
elements
,
unsigned
int
*
capacity
,
unsigned
int
count
,
unsigned
int
size
)
{
...
...
@@ -127,7 +127,8 @@ static struct device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface)
return
NULL
;
}
if
(
!
array_reserve
((
void
**
)
&
hid_devices
,
&
hid_devices_max
,
hid_devices_count
+
1
,
sizeof
(
*
hid_devices
)))
if
(
!
array_reserve
((
void
**
)
&
rawinput_devices
,
&
rawinput_devices_max
,
rawinput_devices_count
+
1
,
sizeof
(
*
rawinput_devices
)))
{
ERR
(
"Failed to allocate memory.
\n
"
);
CloseHandle
(
file
);
...
...
@@ -135,14 +136,14 @@ static struct device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface)
return
NULL
;
}
device
=
&
hid_devices
[
hid
_devices_count
++
];
device
=
&
rawinput_devices
[
rawinput
_devices_count
++
];
device
->
path
=
path
;
device
->
file
=
file
;
return
device
;
}
static
void
find_
hid_
devices
(
void
)
static
void
find_devices
(
void
)
{
static
ULONGLONG
last_check
;
...
...
@@ -162,16 +163,16 @@ static void find_hid_devices(void)
set
=
SetupDiGetClassDevsW
(
&
hid_guid
,
NULL
,
NULL
,
DIGCF_DEVICEINTERFACE
|
DIGCF_PRESENT
);
EnterCriticalSection
(
&
hid
_devices_cs
);
EnterCriticalSection
(
&
rawinput
_devices_cs
);
/* destroy previous list */
for
(
idx
=
0
;
idx
<
hid
_devices_count
;
++
idx
)
for
(
idx
=
0
;
idx
<
rawinput
_devices_count
;
++
idx
)
{
CloseHandle
(
hid
_devices
[
idx
].
file
);
heap_free
(
hid
_devices
[
idx
].
path
);
CloseHandle
(
rawinput
_devices
[
idx
].
file
);
heap_free
(
rawinput
_devices
[
idx
].
path
);
}
hid
_devices_count
=
0
;
rawinput
_devices_count
=
0
;
for
(
idx
=
0
;
SetupDiEnumDeviceInterfaces
(
set
,
NULL
,
&
hid_guid
,
idx
,
&
iface
);
++
idx
)
{
if
(
!
(
device
=
add_device
(
set
,
&
iface
)))
...
...
@@ -194,7 +195,7 @@ static void find_hid_devices(void)
device
->
info
.
usUsage
=
caps
.
Usage
;
}
LeaveCriticalSection
(
&
hid
_devices_cs
);
LeaveCriticalSection
(
&
rawinput
_devices_cs
);
SetupDiDestroyDeviceInfoList
(
set
);
}
...
...
@@ -219,18 +220,18 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
return
~
0U
;
}
find_
hid_
devices
();
find_devices
();
if
(
!
devices
)
{
*
device_count
=
2
+
hid
_devices_count
;
*
device_count
=
2
+
rawinput
_devices_count
;
return
0
;
}
if
(
*
device_count
<
2
+
hid
_devices_count
)
if
(
*
device_count
<
2
+
rawinput
_devices_count
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
*
device_count
=
2
+
hid
_devices_count
;
*
device_count
=
2
+
rawinput
_devices_count
;
return
~
0U
;
}
...
...
@@ -239,13 +240,13 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
devices
[
1
].
hDevice
=
WINE_KEYBOARD_HANDLE
;
devices
[
1
].
dwType
=
RIM_TYPEKEYBOARD
;
for
(
i
=
0
;
i
<
hid
_devices_count
;
++
i
)
for
(
i
=
0
;
i
<
rawinput
_devices_count
;
++
i
)
{
devices
[
2
+
i
].
hDevice
=
&
hid
_devices
[
i
];
devices
[
2
+
i
].
hDevice
=
&
rawinput
_devices
[
i
];
devices
[
2
+
i
].
dwType
=
RIM_TYPEHID
;
}
return
2
+
hid
_devices_count
;
return
2
+
rawinput
_devices_count
;
}
/***********************************************************************
...
...
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