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
a1736729
Commit
a1736729
authored
Apr 17, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Stop creating a setupapi device.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aff72f22
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
67 deletions
+20
-67
Makefile.in
dlls/hidclass.sys/Makefile.in
+0
-1
device.c
dlls/hidclass.sys/device.c
+0
-64
hid.h
dlls/hidclass.sys/hid.h
+0
-1
pnp.c
dlls/hidclass.sys/pnp.c
+20
-1
No files found.
dlls/hidclass.sys/Makefile.in
View file @
a1736729
MODULE
=
hidclass.sys
IMPORTLIB
=
hidclass
IMPORTS
=
hal ntoskrnl
DELAYIMPORTS
=
setupapi
EXTRADLLFLAGS
=
-mno-cygwin
...
...
dlls/hidclass.sys/device.c
View file @
a1736729
...
...
@@ -25,7 +25,6 @@
#include "hid.h"
#include "winreg.h"
#include "winuser.h"
#include "setupapi.h"
#include "wine/debug.h"
#include "ddk/hidsdi.h"
...
...
@@ -37,69 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
hid
);
WINE_DECLARE_DEBUG_CHANNEL
(
hid_report
);
/* user32 reserves 1 & 2 for winemouse and winekeyboard,
* keep this in sync with user_private.h */
#define WINE_MOUSE_HANDLE 1
#define WINE_KEYBOARD_HANDLE 2
static
UINT32
alloc_rawinput_handle
(
void
)
{
static
LONG
counter
=
WINE_KEYBOARD_HANDLE
+
1
;
return
InterlockedIncrement
(
&
counter
);
}
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
)
{
WCHAR
device_instance_id
[
MAX_DEVICE_ID_LEN
];
SP_DEVINFO_DATA
Data
;
HDEVINFO
devinfo
;
BASE_DEVICE_EXTENSION
*
ext
;
USAGE
usage
,
page
;
ext
=
device
->
DeviceExtension
;
page
=
ext
->
u
.
pdo
.
preparsed_data
->
caps
.
UsagePage
;
usage
=
ext
->
u
.
pdo
.
preparsed_data
->
caps
.
Usage
;
lstrcpyW
(
device_instance_id
,
ext
->
device_id
);
lstrcatW
(
device_instance_id
,
L"
\\
"
);
lstrcatW
(
device_instance_id
,
ext
->
instance_id
);
devinfo
=
SetupDiCreateDeviceInfoList
(
&
GUID_DEVCLASS_HIDCLASS
,
NULL
);
if
(
devinfo
==
INVALID_HANDLE_VALUE
)
{
FIXME
(
"failed to get ClassDevs %x
\n
"
,
GetLastError
());
return
STATUS_UNSUCCESSFUL
;
}
Data
.
cbSize
=
sizeof
(
Data
);
if
(
SetupDiCreateDeviceInfoW
(
devinfo
,
device_instance_id
,
&
GUID_DEVCLASS_HIDCLASS
,
NULL
,
NULL
,
DICD_INHERIT_CLASSDRVS
,
&
Data
))
{
if
(
!
SetupDiRegisterDeviceInfo
(
devinfo
,
&
Data
,
0
,
NULL
,
NULL
,
NULL
))
{
FIXME
(
"failed to register device info %x
\n
"
,
GetLastError
());
goto
error
;
}
}
else
if
(
GetLastError
()
!=
ERROR_DEVINST_ALREADY_EXISTS
)
{
FIXME
(
"failed to create device info %x
\n
"
,
GetLastError
());
goto
error
;
}
SetupDiDestroyDeviceInfoList
(
devinfo
);
if
(
page
==
HID_USAGE_PAGE_GENERIC
&&
usage
==
HID_USAGE_GENERIC_MOUSE
)
ext
->
u
.
pdo
.
rawinput_handle
=
WINE_MOUSE_HANDLE
;
else
if
(
page
==
HID_USAGE_PAGE_GENERIC
&&
usage
==
HID_USAGE_GENERIC_KEYBOARD
)
ext
->
u
.
pdo
.
rawinput_handle
=
WINE_KEYBOARD_HANDLE
;
else
ext
->
u
.
pdo
.
rawinput_handle
=
alloc_rawinput_handle
();
return
STATUS_SUCCESS
;
error:
SetupDiDestroyDeviceInfoList
(
devinfo
);
return
STATUS_UNSUCCESSFUL
;
}
IRP
*
pop_irp_from_queue
(
BASE_DEVICE_EXTENSION
*
ext
)
{
LIST_ENTRY
*
entry
;
...
...
dlls/hidclass.sys/hid.h
View file @
a1736729
...
...
@@ -106,7 +106,6 @@ typedef struct _minidriver
NTSTATUS
call_minidriver
(
ULONG
code
,
DEVICE_OBJECT
*
device
,
void
*
in_buff
,
ULONG
in_size
,
void
*
out_buff
,
ULONG
out_size
)
DECLSPEC_HIDDEN
;
/* Internal device functions */
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
void
HID_StartDeviceThread
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
IRP
*
pop_irp_from_queue
(
BASE_DEVICE_EXTENSION
*
ext
)
DECLSPEC_HIDDEN
;
...
...
dlls/hidclass.sys/pnp.c
View file @
a1736729
...
...
@@ -86,6 +86,17 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH
return
irp_status
.
u
.
Status
;
}
/* user32 reserves 1 & 2 for winemouse and winekeyboard,
* keep this in sync with user_private.h */
#define WINE_MOUSE_HANDLE 1
#define WINE_KEYBOARD_HANDLE 2
static
UINT32
alloc_rawinput_handle
(
void
)
{
static
LONG
counter
=
WINE_KEYBOARD_HANDLE
+
1
;
return
InterlockedIncrement
(
&
counter
);
}
static
NTSTATUS
WINAPI
driver_add_device
(
DRIVER_OBJECT
*
driver
,
DEVICE_OBJECT
*
bus_pdo
)
{
WCHAR
device_id
[
MAX_DEVICE_ID_LEN
],
instance_id
[
MAX_DEVICE_ID_LEN
],
pdo_name
[
255
];
...
...
@@ -93,6 +104,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
HID_DEVICE_ATTRIBUTES
attr
=
{
0
};
DEVICE_OBJECT
*
fdo
,
*
child_pdo
;
UNICODE_STRING
string
;
USAGE
page
,
usage
;
NTSTATUS
status
;
minidriver
*
minidriver
;
HID_DESCRIPTOR
descriptor
;
...
...
@@ -214,7 +226,14 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
HID_LinkDevice
(
child_pdo
);
page
=
pdo_ext
->
u
.
pdo
.
preparsed_data
->
caps
.
UsagePage
;
usage
=
pdo_ext
->
u
.
pdo
.
preparsed_data
->
caps
.
Usage
;
if
(
page
==
HID_USAGE_PAGE_GENERIC
&&
usage
==
HID_USAGE_GENERIC_MOUSE
)
pdo_ext
->
u
.
pdo
.
rawinput_handle
=
WINE_MOUSE_HANDLE
;
else
if
(
page
==
HID_USAGE_PAGE_GENERIC
&&
usage
==
HID_USAGE_GENERIC_KEYBOARD
)
pdo_ext
->
u
.
pdo
.
rawinput_handle
=
WINE_KEYBOARD_HANDLE
;
else
pdo_ext
->
u
.
pdo
.
rawinput_handle
=
alloc_rawinput_handle
();
pdo_ext
->
u
.
pdo
.
poll_interval
=
DEFAULT_POLL_INTERVAL
;
...
...
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