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
d6d99e59
Commit
d6d99e59
authored
Feb 12, 2021
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: ObjectName should also be used in NtUnloadKey.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
99429480
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
22 deletions
+37
-22
registry.c
dlls/kernelbase/registry.c
+3
-11
registry.c
dlls/ntdll/unix/registry.c
+7
-1
server_protocol.h
include/wine/server_protocol.h
+5
-2
protocol.def
server/protocol.def
+3
-1
registry.c
server/registry.c
+13
-4
request.h
server/request.h
+3
-2
trace.c
server/trace.c
+3
-1
No files found.
dlls/kernelbase/registry.c
View file @
d6d99e59
...
...
@@ -2349,24 +2349,16 @@ LSTATUS WINAPI RegRestoreKeyA( HKEY hkey, LPCSTR lpFile, DWORD dwFlags )
*/
LSTATUS
WINAPI
RegUnLoadKeyW
(
HKEY
hkey
,
LPCWSTR
lpSubKey
)
{
DWORD
ret
;
HKEY
shkey
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
subkey
;
TRACE
(
"(%p,%s)
\n
"
,
hkey
,
debugstr_w
(
lpSubKey
));
ret
=
RegOpenKeyExW
(
hkey
,
lpSubKey
,
0
,
MAXIMUM_ALLOWED
,
&
shkey
);
if
(
ret
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
,
0
)))
return
ERROR_INVALID_HANDLE
;
RtlInitUnicodeString
(
&
subkey
,
lpSubKey
);
InitializeObjectAttributes
(
&
attr
,
&
subkey
,
OBJ_CASE_INSENSITIVE
,
shkey
,
NULL
);
ret
=
RtlNtStatusToDosError
(
NtUnloadKey
(
&
attr
));
RegCloseKey
(
shkey
);
return
ret
;
InitializeObjectAttributes
(
&
attr
,
&
subkey
,
OBJ_CASE_INSENSITIVE
,
hkey
,
NULL
);
return
RtlNtStatusToDosError
(
NtUnloadKey
(
&
attr
)
);
}
...
...
dlls/ntdll/unix/registry.c
View file @
d6d99e59
...
...
@@ -677,9 +677,15 @@ NTSTATUS WINAPI NtUnloadKey( OBJECT_ATTRIBUTES *attr )
TRACE
(
"(%p)
\n
"
,
attr
);
if
(
!
attr
||
!
attr
->
ObjectName
)
return
STATUS_ACCESS_VIOLATION
;
if
(
attr
->
Length
!=
sizeof
(
*
attr
))
return
STATUS_INVALID_PARAMETER
;
if
(
attr
->
ObjectName
->
Length
&
1
)
return
STATUS_OBJECT_NAME_INVALID
;
SERVER_START_REQ
(
unload_registry
)
{
req
->
hkey
=
wine_server_obj_handle
(
attr
->
RootDirectory
);
req
->
parent
=
wine_server_obj_handle
(
attr
->
RootDirectory
);
req
->
attributes
=
attr
->
Attributes
;
wine_server_add_data
(
req
,
attr
->
ObjectName
->
Buffer
,
attr
->
ObjectName
->
Length
);
ret
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
...
...
include/wine/server_protocol.h
View file @
d6d99e59
...
...
@@ -2356,7 +2356,10 @@ struct load_registry_reply
struct
unload_registry_request
{
struct
request_header
__header
;
obj_handle_t
hkey
;
obj_handle_t
parent
;
unsigned
int
attributes
;
/* VARARG(name,unicode_str); */
char
__pad_20
[
4
];
};
struct
unload_registry_reply
{
...
...
@@ -6223,7 +6226,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 68
1
#define SERVER_PROTOCOL_VERSION 68
2
/* ### protocol_version end ### */
...
...
server/protocol.def
View file @
d6d99e59
...
...
@@ -1812,7 +1812,9 @@ struct process_info
/* UnLoad a registry branch from a file */
@REQ(unload_registry)
obj_handle_t hkey; /* root key to unload to */
obj_handle_t parent; /* handle to the parent key */
unsigned int attributes; /* object attributes */
VARARG(name,unicode_str); /* key name */
@END
...
...
server/registry.c
View file @
d6d99e59
...
...
@@ -2244,7 +2244,9 @@ DECL_HANDLER(load_registry)
DECL_HANDLER
(
unload_registry
)
{
struct
key
*
key
;
struct
key
*
key
,
*
parent
;
struct
unicode_str
name
;
unsigned
int
access
=
0
;
if
(
!
thread_single_check_privilege
(
current
,
&
SeRestorePrivilege
))
{
...
...
@@ -2252,10 +2254,17 @@ DECL_HANDLER(unload_registry)
return
;
}
if
((
key
=
get_hkey_obj
(
req
->
hkey
,
0
)))
if
(
!
is_wow64_thread
(
current
))
access
=
(
access
&
~
KEY_WOW64_32KEY
)
|
KEY_WOW64_64KEY
;
if
((
parent
=
get_parent_hkey_obj
(
req
->
parent
)))
{
delete_key
(
key
,
1
);
/* FIXME */
release_object
(
key
);
get_req_path
(
&
name
,
!
req
->
parent
);
if
((
key
=
open_key
(
parent
,
&
name
,
access
,
req
->
attributes
)))
{
delete_key
(
key
,
1
);
/* FIXME */
release_object
(
key
);
}
release_object
(
parent
);
}
}
...
...
server/request.h
View file @
d6d99e59
...
...
@@ -1231,8 +1231,9 @@ C_ASSERT( FIELD_OFFSET(struct delete_key_value_request, hkey) == 12 );
C_ASSERT
(
sizeof
(
struct
delete_key_value_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
load_registry_request
,
file
)
==
12
);
C_ASSERT
(
sizeof
(
struct
load_registry_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
unload_registry_request
,
hkey
)
==
12
);
C_ASSERT
(
sizeof
(
struct
unload_registry_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
unload_registry_request
,
parent
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
unload_registry_request
,
attributes
)
==
16
);
C_ASSERT
(
sizeof
(
struct
unload_registry_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
save_registry_request
,
hkey
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
save_registry_request
,
file
)
==
16
);
C_ASSERT
(
sizeof
(
struct
save_registry_request
)
==
24
);
...
...
server/trace.c
View file @
d6d99e59
...
...
@@ -2417,7 +2417,9 @@ static void dump_load_registry_request( const struct load_registry_request *req
static
void
dump_unload_registry_request
(
const
struct
unload_registry_request
*
req
)
{
fprintf
(
stderr
,
" hkey=%04x"
,
req
->
hkey
);
fprintf
(
stderr
,
" parent=%04x"
,
req
->
parent
);
fprintf
(
stderr
,
", attributes=%08x"
,
req
->
attributes
);
dump_varargs_unicode_str
(
", name="
,
cur_size
);
}
static
void
dump_save_registry_request
(
const
struct
save_registry_request
*
req
)
...
...
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