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
16b09944
Commit
16b09944
authored
Mar 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make the open_hkcu_key() helper available globally.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
285830f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
31 deletions
+30
-31
file.c
dlls/ntdll/unix/file.c
+0
-29
registry.c
dlls/ntdll/unix/registry.c
+29
-0
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-2
No files found.
dlls/ntdll/unix/file.c
View file @
16b09944
...
...
@@ -2727,35 +2727,6 @@ static int get_redirect_path( char *unix_name, int pos, const WCHAR *name, int l
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
static
NTSTATUS
open_hkcu_key
(
const
char
*
path
,
HANDLE
*
key
)
{
NTSTATUS
status
;
char
buffer
[
256
];
WCHAR
bufferW
[
256
];
DWORD_PTR
sid_data
[(
sizeof
(
TOKEN_USER
)
+
SECURITY_MAX_SID_SIZE
)
/
sizeof
(
DWORD_PTR
)];
DWORD
i
,
len
=
sizeof
(
sid_data
);
SID
*
sid
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
status
=
NtQueryInformationToken
(
GetCurrentThreadEffectiveToken
(),
TokenUser
,
sid_data
,
len
,
&
len
);
if
(
status
)
return
status
;
sid
=
((
TOKEN_USER
*
)
sid_data
)
->
User
.
Sid
;
len
=
sprintf
(
buffer
,
"
\\
Registry
\\
User
\\
S-%u-%u"
,
sid
->
Revision
,
MAKELONG
(
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
5
],
sid
->
IdentifierAuthority
.
Value
[
4
]
),
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
3
],
sid
->
IdentifierAuthority
.
Value
[
2
]
)));
for
(
i
=
0
;
i
<
sid
->
SubAuthorityCount
;
i
++
)
len
+=
sprintf
(
buffer
+
len
,
"-%u"
,
sid
->
SubAuthority
[
i
]
);
len
+=
sprintf
(
buffer
+
len
,
"
\\
%s"
,
path
);
ascii_to_unicode
(
bufferW
,
buffer
,
len
+
1
);
init_unicode_string
(
&
name
,
bufferW
);
InitializeObjectAttributes
(
&
attr
,
&
name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
return
NtCreateKey
(
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
);
}
/***********************************************************************
* init_files
*/
...
...
dlls/ntdll/unix/registry.c
View file @
16b09944
...
...
@@ -40,6 +40,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg);
#define MAX_VALUE_LENGTH (16383 * sizeof(WCHAR))
NTSTATUS
open_hkcu_key
(
const
char
*
path
,
HANDLE
*
key
)
{
NTSTATUS
status
;
char
buffer
[
256
];
WCHAR
bufferW
[
256
];
DWORD_PTR
sid_data
[(
sizeof
(
TOKEN_USER
)
+
SECURITY_MAX_SID_SIZE
)
/
sizeof
(
DWORD_PTR
)];
DWORD
i
,
len
=
sizeof
(
sid_data
);
SID
*
sid
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
status
=
NtQueryInformationToken
(
GetCurrentThreadEffectiveToken
(),
TokenUser
,
sid_data
,
len
,
&
len
);
if
(
status
)
return
status
;
sid
=
((
TOKEN_USER
*
)
sid_data
)
->
User
.
Sid
;
len
=
sprintf
(
buffer
,
"
\\
Registry
\\
User
\\
S-%u-%u"
,
sid
->
Revision
,
MAKELONG
(
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
5
],
sid
->
IdentifierAuthority
.
Value
[
4
]
),
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
3
],
sid
->
IdentifierAuthority
.
Value
[
2
]
)));
for
(
i
=
0
;
i
<
sid
->
SubAuthorityCount
;
i
++
)
len
+=
sprintf
(
buffer
+
len
,
"-%u"
,
sid
->
SubAuthority
[
i
]
);
len
+=
sprintf
(
buffer
+
len
,
"
\\
%s"
,
path
);
ascii_to_unicode
(
bufferW
,
buffer
,
len
+
1
);
init_unicode_string
(
&
name
,
bufferW
);
InitializeObjectAttributes
(
&
attr
,
&
name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
return
NtCreateKey
(
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
);
}
/******************************************************************************
* NtCreateKey (NTDLL.@)
*/
...
...
dlls/ntdll/unix/unix_private.h
View file @
16b09944
...
...
@@ -105,8 +105,6 @@ extern void CDECL virtual_release_address_space(void) DECLSPEC_HIDDEN;
extern
NTSTATUS
CDECL
unwind_builtin_dll
(
ULONG
type
,
struct
_DISPATCHER_CONTEXT
*
dispatch
,
CONTEXT
*
context
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
set_show_dot_files
(
BOOL
enable
)
DECLSPEC_HIDDEN
;
extern
const
char
*
home_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
data_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
build_dir
DECLSPEC_HIDDEN
;
...
...
@@ -215,6 +213,7 @@ extern void DECLSPEC_NORETURN exec_process( NTSTATUS status ) DECLSPEC_HIDDEN;
extern
void
__wine_syscall_dispatcher
(
void
)
DECLSPEC_HIDDEN
;
extern
void
signal_restore_full_cpu_context
(
void
)
DECLSPEC_HIDDEN
;
extern
void
fill_vm_counters
(
VM_COUNTERS_EX
*
pvmi
,
int
unix_pid
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
open_hkcu_key
(
const
char
*
path
,
HANDLE
*
key
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
cdrom_DeviceIoControl
(
HANDLE
device
,
HANDLE
event
,
PIO_APC_ROUTINE
apc
,
void
*
apc_user
,
IO_STATUS_BLOCK
*
io
,
ULONG
code
,
void
*
in_buffer
,
...
...
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