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
f073d9a9
Commit
f073d9a9
authored
Nov 15, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d8b26261
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
device.c
dlls/hidclass.sys/device.c
+2
-6
pnp.c
dlls/hidclass.sys/pnp.c
+5
-8
No files found.
dlls/hidclass.sys/device.c
View file @
f073d9a9
...
...
@@ -38,9 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
hid
);
WINE_DECLARE_DEBUG_CHANNEL
(
hid_report
);
static
const
WCHAR
device_name_fmtW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'H'
,
'I'
,
'D'
,
'#'
,
'%'
,
'p'
,
'&'
,
'%'
,
'p'
,
0
};
NTSTATUS
HID_CreateDevice
(
DEVICE_OBJECT
*
native_device
,
HID_MINIDRIVER_REGISTRATION
*
driver
,
DEVICE_OBJECT
**
device
)
{
WCHAR
dev_name
[
255
];
...
...
@@ -48,7 +45,7 @@ NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRAT
NTSTATUS
status
;
BASE_DEVICE_EXTENSION
*
ext
;
swprintf
(
dev_name
,
ARRAY_SIZE
(
dev_name
),
device_name_fmtW
,
driver
->
DriverObject
,
native_device
);
swprintf
(
dev_name
,
ARRAY_SIZE
(
dev_name
),
L"
\\
Device
\\
HID#%p&%p"
,
driver
->
DriverObject
,
native_device
);
RtlInitUnicodeString
(
&
nameW
,
dev_name
);
TRACE
(
"Create base hid device %s
\n
"
,
debugstr_w
(
dev_name
));
...
...
@@ -76,7 +73,6 @@ NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRAT
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
)
{
static
const
WCHAR
backslashW
[]
=
{
'\\'
,
0
};
WCHAR
device_instance_id
[
MAX_DEVICE_ID_LEN
];
SP_DEVINFO_DATA
Data
;
UNICODE_STRING
nameW
;
...
...
@@ -91,7 +87,7 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device)
RtlInitUnicodeString
(
&
nameW
,
ext
->
device_name
);
lstrcpyW
(
device_instance_id
,
ext
->
device_id
);
lstrcatW
(
device_instance_id
,
backslashW
);
lstrcatW
(
device_instance_id
,
L"
\\
"
);
lstrcatW
(
device_instance_id
,
ext
->
instance_id
);
devinfo
=
SetupDiCreateDeviceInfoList
(
&
GUID_DEVCLASS_HIDCLASS
,
NULL
);
...
...
dlls/hidclass.sys/pnp.c
View file @
f073d9a9
...
...
@@ -30,9 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
hid
);
static
const
WCHAR
device_enumeratorW
[]
=
{
'H'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
separator_W
[]
=
{
'\\'
,
0
};
static
NTSTATUS
WINAPI
internalComplete
(
DEVICE_OBJECT
*
deviceObject
,
IRP
*
irp
,
void
*
context
)
{
...
...
@@ -193,8 +190,8 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
lstrcpyW
(
ext
->
instance_id
,
instance_id
);
lstrcpyW
(
ext
->
device_id
,
device_enumeratorW
);
lstrcatW
(
ext
->
device_id
,
separator_W
);
lstrcpyW
(
ext
->
device_id
,
L"HID"
);
lstrcatW
(
ext
->
device_id
,
L"
\\
"
);
lstrcatW
(
ext
->
device_id
,
wcschr
(
device_id
,
'\\'
)
+
1
);
HID_LinkDevice
(
device
);
...
...
@@ -264,7 +261,7 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp)
/* Device instance ID */
lstrcpyW
(
ptr
,
ext
->
device_id
);
ptr
+=
lstrlenW
(
ext
->
device_id
);
lstrcpyW
(
ptr
,
separator_W
);
lstrcpyW
(
ptr
,
L"
\\
"
);
ptr
+=
1
;
lstrcpyW
(
ptr
,
ext
->
instance_id
);
ptr
+=
lstrlenW
(
ext
->
instance_id
)
+
1
;
...
...
@@ -272,8 +269,8 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp)
lstrcpyW
(
ptr
,
ext
->
device_id
);
ptr
+=
lstrlenW
(
ext
->
device_id
)
+
1
;
/* Bus ID */
lstrcpyW
(
ptr
,
device_enumeratorW
);
ptr
+=
lstrlenW
(
device_enumeratorW
)
+
1
;
lstrcpyW
(
ptr
,
L"HID"
);
ptr
+=
lstrlenW
(
L"HID"
)
+
1
;
*
ptr
=
0
;
irp
->
IoStatus
.
Information
=
(
ULONG_PTR
)
id
;
rc
=
STATUS_SUCCESS
;
...
...
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