Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
365f162f
Commit
365f162f
authored
Jun 06, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement automatically generated device names.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9392aaa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+29
-7
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
365f162f
...
...
@@ -1466,9 +1466,12 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
ULONG
characteristics
,
BOOLEAN
exclusive
,
DEVICE_OBJECT
**
ret_device
)
{
static
const
WCHAR
auto_format
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
NTSTATUS
status
;
DEVICE_OBJECT
*
device
;
HANDLE
manager
=
get_device_manager
();
static
unsigned
int
auto_idx
=
0
;
WCHAR
autoW
[
17
];
TRACE
(
"(%p, %u, %s, %u, %x, %u, %p)
\n
"
,
driver
,
ext_size
,
debugstr_us
(
name
),
type
,
characteristics
,
exclusive
,
ret_device
);
...
...
@@ -1481,15 +1484,34 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
device
->
DeviceType
=
type
;
device
->
StackSize
=
1
;
SERVER_START_REQ
(
create_device
)
if
(
characteristics
&
FILE_AUTOGENERATED_DEVICE_NAME
)
{
req
->
rootdir
=
0
;
req
->
manager
=
wine_server_obj_handle
(
manager
);
req
->
user_ptr
=
wine_server_client_ptr
(
device
);
if
(
name
)
wine_server_add_data
(
req
,
name
->
Buffer
,
name
->
Length
);
status
=
wine_server_call
(
req
);
do
{
sprintfW
(
autoW
,
auto_format
,
auto_idx
++
);
SERVER_START_REQ
(
create_device
)
{
req
->
rootdir
=
0
;
req
->
manager
=
wine_server_obj_handle
(
manager
);
req
->
user_ptr
=
wine_server_client_ptr
(
device
);
wine_server_add_data
(
req
,
autoW
,
strlenW
(
autoW
)
*
sizeof
(
WCHAR
)
);
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
while
(
status
==
STATUS_OBJECT_NAME_COLLISION
);
}
else
{
SERVER_START_REQ
(
create_device
)
{
req
->
rootdir
=
0
;
req
->
manager
=
wine_server_obj_handle
(
manager
);
req
->
user_ptr
=
wine_server_client_ptr
(
device
);
if
(
name
)
wine_server_add_data
(
req
,
name
->
Buffer
,
name
->
Length
);
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
SERVER_END_REQ
;
if
(
status
)
{
...
...
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