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
5294ebc9
Commit
5294ebc9
authored
Feb 11, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: No longer track devices in a list.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
76daa6b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
35 deletions
+1
-35
hid.h
dlls/hidclass.sys/hid.h
+0
-7
main.c
dlls/hidclass.sys/main.c
+0
-2
pnp.c
dlls/hidclass.sys/pnp.c
+1
-26
No files found.
dlls/hidclass.sys/hid.h
View file @
5294ebc9
...
...
@@ -72,12 +72,6 @@ void RingBuffer_Destroy(struct ReportRingBuffer *buffer) DECLSPEC_HIDDEN;
struct
ReportRingBuffer
*
RingBuffer_Create
(
UINT
buffer_size
)
DECLSPEC_HIDDEN
;
NTSTATUS
RingBuffer_SetSize
(
struct
ReportRingBuffer
*
buffer
,
UINT
size
)
DECLSPEC_HIDDEN
;
typedef
struct
_hiddevice
{
struct
list
entry
;
DEVICE_OBJECT
*
device
;
}
hid_device
;
typedef
struct
_minidriver
{
struct
list
entry
;
...
...
@@ -88,7 +82,6 @@ typedef struct _minidriver
PDRIVER_ADD_DEVICE
AddDevice
;
PDRIVER_DISPATCH
PNPDispatch
;
struct
list
device_list
;
}
minidriver
;
NTSTATUS
call_minidriver
(
ULONG
code
,
DEVICE_OBJECT
*
device
,
void
*
in_buff
,
ULONG
in_size
,
void
*
out_buff
,
ULONG
out_size
)
DECLSPEC_HIDDEN
;
...
...
dlls/hidclass.sys/main.c
View file @
5294ebc9
...
...
@@ -81,8 +81,6 @@ NTSTATUS WINAPI HidRegisterMinidriver(HID_MINIDRIVER_REGISTRATION *registration)
driver
->
minidriver
=
*
registration
;
list_add_tail
(
&
minidriver_list
,
&
driver
->
entry
);
list_init
(
&
driver
->
device_list
);
return
STATUS_SUCCESS
;
}
...
...
dlls/hidclass.sys/pnp.c
View file @
5294ebc9
...
...
@@ -72,7 +72,6 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH
NTSTATUS
WINAPI
PNP_AddDevice
(
DRIVER_OBJECT
*
driver
,
DEVICE_OBJECT
*
PDO
)
{
WCHAR
device_id
[
MAX_DEVICE_ID_LEN
],
instance_id
[
MAX_DEVICE_ID_LEN
];
hid_device
*
hiddev
;
DEVICE_OBJECT
*
device
=
NULL
;
NTSTATUS
status
;
minidriver
*
minidriver
;
...
...
@@ -97,18 +96,12 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
TRACE
(
"Adding device to PDO %p, id %s
\\
%s.
\n
"
,
PDO
,
debugstr_w
(
device_id
),
debugstr_w
(
instance_id
));
minidriver
=
find_minidriver
(
driver
);
hiddev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
hiddev
));
if
(
!
hiddev
)
return
STATUS_NO_MEMORY
;
status
=
HID_CreateDevice
(
PDO
,
&
minidriver
->
minidriver
,
&
hiddev
->
device
);
status
=
HID_CreateDevice
(
PDO
,
&
minidriver
->
minidriver
,
&
device
);
if
(
status
!=
STATUS_SUCCESS
)
{
ERR
(
"Failed to create HID object (%x)
\n
"
,
status
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
device
=
hiddev
->
device
;
ext
=
device
->
DeviceExtension
;
InitializeListHead
(
&
ext
->
irp_queue
);
...
...
@@ -120,7 +113,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
{
ERR
(
"Minidriver AddDevice failed (%x)
\n
"
,
status
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
...
...
@@ -131,7 +123,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
{
ERR
(
"Minidriver failed to get Attributes(%x)
\n
"
,
status
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
...
...
@@ -146,7 +137,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
{
ERR
(
"Cannot get Device Descriptor(%x)
\n
"
,
status
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
for
(
i
=
0
;
i
<
descriptor
.
bNumDescriptors
;
i
++
)
...
...
@@ -157,7 +147,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
{
ERR
(
"No Report Descriptor found in reply
\n
"
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
...
...
@@ -169,7 +158,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
ERR
(
"Cannot get Report Descriptor(%x)
\n
"
,
status
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
reportDescriptor
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
status
;
}
...
...
@@ -180,12 +168,9 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
{
ERR
(
"Cannot parse Report Descriptor
\n
"
);
HID_DeleteDevice
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
return
STATUS_NOT_SUPPORTED
;
}
list_add_tail
(
&
(
minidriver
->
device_list
),
&
hiddev
->
entry
);
ext
->
information
.
DescriptorSize
=
ext
->
preparseData
->
dwSize
;
lstrcpyW
(
ext
->
instance_id
,
instance_id
);
...
...
@@ -208,7 +193,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
static
NTSTATUS
remove_device
(
minidriver
*
minidriver
,
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
BASE_DEVICE_EXTENSION
*
ext
=
device
->
DeviceExtension
;
hid_device
*
hiddev
;
NTSTATUS
rc
=
STATUS_NOT_SUPPORTED
;
rc
=
IoSetDeviceInterfaceState
(
&
ext
->
link_name
,
FALSE
);
...
...
@@ -224,15 +208,6 @@ static NTSTATUS remove_device(minidriver *minidriver, DEVICE_OBJECT *device, IRP
if
(
irp
)
rc
=
minidriver
->
PNPDispatch
(
device
,
irp
);
HID_DeleteDevice
(
device
);
LIST_FOR_EACH_ENTRY
(
hiddev
,
&
minidriver
->
device_list
,
hid_device
,
entry
)
{
if
(
hiddev
->
device
==
device
)
{
list_remove
(
&
hiddev
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
hiddev
);
break
;
}
}
return
rc
;
}
...
...
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