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
285830f5
Commit
285830f5
authored
Mar 03, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper to initialize a UNICODE_STRING on the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d565910
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
20 deletions
+14
-20
env.c
dlls/ntdll/unix/env.c
+2
-6
file.c
dlls/ntdll/unix/file.c
+3
-8
loader.c
dlls/ntdll/unix/loader.c
+1
-3
system.c
dlls/ntdll/unix/system.c
+1
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+7
-0
No files found.
dlls/ntdll/unix/env.c
View file @
285830f5
...
...
@@ -168,9 +168,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
wcscpy
(
buffer
,
type
==
NLS_SECTION_SORTKEYS
?
sortdirW
:
systemdirW
);
p
=
strrchr
(
path
,
'/'
)
+
1
;
ascii_to_unicode
(
buffer
+
wcslen
(
buffer
),
p
,
strlen
(
p
)
+
1
);
valueW
.
Buffer
=
buffer
;
valueW
.
Length
=
wcslen
(
buffer
)
*
sizeof
(
WCHAR
);
valueW
.
MaximumLength
=
sizeof
(
buffer
);
init_unicode_string
(
&
valueW
,
buffer
);
InitializeObjectAttributes
(
&
attr
,
&
valueW
,
0
,
0
,
NULL
);
status
=
open_unix_file
(
file
,
path
,
GENERIC_READ
,
&
attr
,
0
,
FILE_SHARE_READ
,
...
...
@@ -1645,9 +1643,7 @@ NTSTATUS WINAPI NtGetNlsSectionPtr( ULONG type, ULONG id, void *unknown, void **
if
((
status
=
get_nls_section_name
(
type
,
id
,
name
)))
return
status
;
nameW
.
Buffer
=
name
;
nameW
.
Length
=
wcslen
(
name
)
*
sizeof
(
WCHAR
);
nameW
.
MaximumLength
=
sizeof
(
name
);
init_unicode_string
(
&
nameW
,
name
);
InitializeObjectAttributes
(
&
attr
,
&
nameW
,
0
,
0
,
NULL
);
if
((
status
=
NtOpenSection
(
&
handle
,
SECTION_MAP_READ
,
&
attr
)))
{
...
...
dlls/ntdll/unix/file.c
View file @
285830f5
...
...
@@ -1974,8 +1974,7 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni
else
drive
->
letter
=
'a'
+
letter
;
string
.
Buffer
=
(
WCHAR
*
)
MOUNTMGR_DEVICE_NAME
;
string
.
Length
=
sizeof
(
MOUNTMGR_DEVICE_NAME
)
-
sizeof
(
WCHAR
);
init_unicode_string
(
&
string
,
MOUNTMGR_DEVICE_NAME
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
0
,
NULL
,
NULL
);
status
=
NtOpenFile
(
&
mountmgr
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
);
...
...
@@ -2750,10 +2749,8 @@ static NTSTATUS open_hkcu_key( const char *path, HANDLE *key )
len
+=
sprintf
(
buffer
+
len
,
"-%u"
,
sid
->
SubAuthority
[
i
]
);
len
+=
sprintf
(
buffer
+
len
,
"
\\
%s"
,
path
);
name
.
Buffer
=
bufferW
;
name
.
Length
=
len
*
sizeof
(
WCHAR
);
name
.
MaximumLength
=
name
.
Length
+
sizeof
(
WCHAR
);
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
);
}
...
...
@@ -2787,9 +2784,7 @@ void init_files(void)
DWORD
dummy
;
UNICODE_STRING
nameW
;
nameW
.
MaximumLength
=
sizeof
(
showdotfilesW
);
nameW
.
Length
=
nameW
.
MaximumLength
-
sizeof
(
WCHAR
);
nameW
.
Buffer
=
showdotfilesW
;
init_unicode_string
(
&
nameW
,
showdotfilesW
);
if
(
!
NtQueryValueKey
(
key
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
dummy
))
{
WCHAR
*
str
=
(
WCHAR
*
)((
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
)
->
Data
;
...
...
dlls/ntdll/unix/loader.c
View file @
285830f5
...
...
@@ -1618,9 +1618,7 @@ static void load_ntdll(void)
void
*
module
;
char
*
name
=
build_path
(
dll_dir
,
"ntdll.dll.so"
);
str
.
Buffer
=
path
;
str
.
Length
=
sizeof
(
path
)
-
sizeof
(
WCHAR
);
str
.
MaximumLength
=
sizeof
(
path
);
init_unicode_string
(
&
str
,
path
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
NULL
);
name
[
strlen
(
name
)
-
3
]
=
0
;
/* remove .so */
status
=
open_builtin_file
(
name
,
&
attr
,
&
mapping
,
&
module
,
&
info
,
&
st
,
FALSE
);
...
...
dlls/ntdll/unix/system.c
View file @
285830f5
...
...
@@ -1809,9 +1809,7 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char*
sprintf
(
buffer
,
"%u"
,
year
);
ascii_to_unicode
(
yearW
,
buffer
,
strlen
(
buffer
)
+
1
);
nameW
.
Buffer
=
(
WCHAR
*
)
Time_ZonesW
;
nameW
.
Length
=
sizeof
(
Time_ZonesW
)
-
sizeof
(
WCHAR
);
init_unicode_string
(
&
nameW
,
Time_ZonesW
);
InitializeObjectAttributes
(
&
attr
,
&
nameW
,
0
,
0
,
NULL
);
if
(
NtOpenKey
(
&
key
,
KEY_READ
,
&
attr
))
return
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
285830f5
...
...
@@ -482,4 +482,11 @@ static inline int ntdll_wcsnicmp( const WCHAR *str1, const WCHAR *str2, int n )
#define towupper(c) ntdll_towupper(c)
#define towlower(c) ntdll_towlower(c)
static
inline
void
init_unicode_string
(
UNICODE_STRING
*
str
,
const
WCHAR
*
data
)
{
str
->
Length
=
wcslen
(
data
)
*
sizeof
(
WCHAR
);
str
->
MaximumLength
=
str
->
Length
+
sizeof
(
WCHAR
);
str
->
Buffer
=
(
WCHAR
*
)
data
;
}
#endif
/* __NTDLL_UNIX_PRIVATE_H */
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