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
535419a2
Commit
535419a2
authored
Mar 12, 2018
by
Stefan Leichter
Committed by
Alexandre Julliard
Mar 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlCreateRegistryKey.
Signed-off-by:
Stefan Leichter
<
sle85276@gmx.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f07e8ca8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
14 deletions
+60
-14
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
reg.c
dlls/ntdll/reg.c
+57
-12
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-1
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
535419a2
...
...
@@ -509,7 +509,7 @@
@ stdcall RtlCreateProcessParameters(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stub RtlCreatePropertySet
@ stdcall RtlCreateQueryDebugBuffer(long long)
@ st
ub RtlCreateRegistryKey
@ st
dcall RtlCreateRegistryKey(long wstr)
@ stdcall RtlCreateSecurityDescriptor(ptr long)
# @ stub RtlCreateSystemVolumeInformationFolder
@ stub RtlCreateTagHeap
...
...
dlls/ntdll/reg.c
View file @
535419a2
...
...
@@ -1133,13 +1133,10 @@ static NTSTATUS RTL_ReportRegistryValue(PKEY_VALUE_FULL_INFORMATION pInfo,
}
static
NTSTATUS
RTL_
GetKeyHandle
(
ULONG
RelativeTo
,
PCWSTR
Path
,
PHANDLE
handle
)
static
NTSTATUS
RTL_
KeyHandleCreateObject
(
ULONG
RelativeTo
,
PCWSTR
Path
,
POBJECT_ATTRIBUTES
regkey
,
PUNICODE_STRING
str
)
{
UNICODE_STRING
KeyString
;
OBJECT_ATTRIBUTES
regkey
;
PCWSTR
base
;
INT
len
;
NTSTATUS
status
;
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
control
[]
=
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'\\'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
...
...
@@ -1191,17 +1188,30 @@ static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle)
}
len
=
(
strlenW
(
base
)
+
strlenW
(
Path
)
+
1
)
*
sizeof
(
WCHAR
);
KeyString
.
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
len
);
if
(
KeyString
.
Buffer
==
NULL
)
str
->
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
len
);
if
(
str
->
Buffer
==
NULL
)
return
STATUS_NO_MEMORY
;
strcpyW
(
KeyString
.
Buffer
,
base
);
strcatW
(
KeyString
.
Buffer
,
Path
);
KeyString
.
Length
=
len
-
sizeof
(
WCHAR
);
KeyString
.
MaximumLength
=
len
;
InitializeObjectAttributes
(
&
regkey
,
&
KeyString
,
OBJ_CASE_INSENSITIVE
,
NULL
,
NULL
);
strcpyW
(
str
->
Buffer
,
base
);
strcatW
(
str
->
Buffer
,
Path
);
str
->
Length
=
len
-
sizeof
(
WCHAR
);
str
->
MaximumLength
=
len
;
InitializeObjectAttributes
(
regkey
,
str
,
OBJ_CASE_INSENSITIVE
,
NULL
,
NULL
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
RTL_GetKeyHandle
(
ULONG
RelativeTo
,
PCWSTR
Path
,
PHANDLE
handle
)
{
OBJECT_ATTRIBUTES
regkey
;
UNICODE_STRING
string
;
NTSTATUS
status
;
status
=
RTL_KeyHandleCreateObject
(
RelativeTo
,
Path
,
&
regkey
,
&
string
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
status
=
NtOpenKey
(
handle
,
KEY_ALL_ACCESS
,
&
regkey
);
RtlFree
Heap
(
GetProcessHeap
(),
0
,
KeyString
.
Buffer
);
RtlFree
UnicodeString
(
&
string
);
return
status
;
}
...
...
@@ -1415,6 +1425,41 @@ NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG RelativeTo, IN PWSTR Path)
}
/*************************************************************************
* RtlCreateRegistryKey [NTDLL.@]
*
* Add a key to the registry given by absolute or relative path
*
* PARAMS
* RelativeTo [I] Registry path that Path refers to
* path [I] Path to key
*
* RETURNS
* STATUS_SUCCESS or an appropriate NTSTATUS error code.
*/
NTSTATUS
WINAPI
RtlCreateRegistryKey
(
ULONG
RelativeTo
,
PWSTR
path
)
{
OBJECT_ATTRIBUTES
regkey
;
UNICODE_STRING
string
;
HANDLE
handle
;
NTSTATUS
status
;
RelativeTo
&=
~
RTL_REGISTRY_OPTIONAL
;
if
(
!
RelativeTo
&&
(
path
==
NULL
||
path
[
0
]
==
0
))
return
STATUS_OBJECT_PATH_SYNTAX_BAD
;
if
(
RelativeTo
<=
RTL_REGISTRY_USER
&&
(
path
==
NULL
||
path
[
0
]
==
0
))
return
STATUS_SUCCESS
;
status
=
RTL_KeyHandleCreateObject
(
RelativeTo
,
path
,
&
regkey
,
&
string
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
status
=
NtCreateKey
(
&
handle
,
KEY_ALL_ACCESS
,
&
regkey
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
NULL
);
if
(
handle
)
NtClose
(
handle
);
RtlFreeUnicodeString
(
&
string
);
return
status
;
}
/*************************************************************************
* RtlDeleteRegistryValue [NTDLL.@]
*
* Query multiple registry values with a single call.
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
535419a2
...
...
@@ -976,7 +976,7 @@
@ stdcall RtlCreateAcl(ptr long long)
@ stdcall RtlCreateAtomTable(long ptr)
@ stdcall RtlCreateHeap(long ptr long long ptr ptr)
@ st
ub RtlCreateRegistryKey
@ st
dcall RtlCreateRegistryKey(long wstr)
@ stdcall RtlCreateSecurityDescriptor(ptr long)
@ stub RtlCreateSystemVolumeInformationFolder
@ stdcall RtlCreateUnicodeString(ptr wstr)
...
...
include/winternl.h
View file @
535419a2
...
...
@@ -2517,6 +2517,7 @@ NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
NTSYSAPI
void
WINAPI
RtlClearBits
(
PRTL_BITMAP
,
ULONG
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
RtlCreateActivationContext
(
HANDLE
*
,
const
void
*
);
NTSYSAPI
PDEBUG_BUFFER
WINAPI
RtlCreateQueryDebugBuffer
(
ULONG
,
BOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
RtlCreateRegistryKey
(
ULONG
,
PWSTR
);
NTSYSAPI
ULONG
WINAPI
RtlCompactHeap
(
HANDLE
,
ULONG
);
NTSYSAPI
LONG
WINAPI
RtlCompareString
(
const
STRING
*
,
const
STRING
*
,
BOOLEAN
);
NTSYSAPI
LONG
WINAPI
RtlCompareUnicodeString
(
const
UNICODE_STRING
*
,
const
UNICODE_STRING
*
,
BOOLEAN
);
...
...
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