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
2ffaaee1
Commit
2ffaaee1
authored
Jul 22, 2016
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl: Build a more intelligent and correct RegistryPath if possible.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1110ecca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+31
-2
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
2ffaaee1
...
...
@@ -817,6 +817,34 @@ PIRP WINAPI IoBuildSynchronousFsdRequest(ULONG majorfunc, PDEVICE_OBJECT device,
return
irp
;
}
static
void
build_driver_keypath
(
const
WCHAR
*
name
,
UNICODE_STRING
*
keypath
)
{
static
const
WCHAR
driverW
[]
=
{
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
servicesW
[]
=
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'\\'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
's'
,
'\\'
,
0
};
WCHAR
*
str
;
/* Check what prefix is present */
if
(
strncmpW
(
name
,
servicesW
,
strlenW
(
servicesW
)
)
==
0
)
{
FIXME
(
"Driver name %s is malformed as the keypath
\n
"
,
debugstr_w
(
name
)
);
RtlCreateUnicodeString
(
keypath
,
name
);
return
;
}
if
(
strncmpW
(
name
,
driverW
,
strlenW
(
driverW
)
)
==
0
)
name
+=
strlenW
(
driverW
);
else
FIXME
(
"Driver name %s does not properly begin with
\\
Driver
\\
"
,
debugstr_w
(
name
)
);
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
servicesW
)
+
strlenW
(
name
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
str
,
servicesW
);
lstrcatW
(
str
,
name
);
RtlInitUnicodeString
(
keypath
,
str
);
}
/***********************************************************************
* IoCreateDriver (NTOSKRNL.EXE.@)
...
...
@@ -844,9 +872,9 @@ NTSTATUS WINAPI IoCreateDriver( UNICODE_STRING *name, PDRIVER_INITIALIZE init )
driver
->
DriverInit
=
init
;
driver
->
DriverExtension
=
extension
;
extension
->
DriverObject
=
driver
;
extension
->
ServiceKeyName
=
driver
->
DriverName
;
build_driver_keypath
(
driver
->
DriverName
.
Buffer
,
&
extension
->
ServiceKeyName
)
;
status
=
driver
->
DriverInit
(
driver
,
n
ame
);
status
=
driver
->
DriverInit
(
driver
,
&
extension
->
ServiceKeyN
ame
);
if
(
status
)
{
...
...
@@ -865,6 +893,7 @@ void WINAPI IoDeleteDriver( DRIVER_OBJECT *driver )
TRACE
(
"(%p)
\n
"
,
driver
);
RtlFreeUnicodeString
(
&
driver
->
DriverName
);
RtlFreeUnicodeString
(
&
driver
->
DriverExtension
->
ServiceKeyName
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
driver
);
}
...
...
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