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
1b1b6c5f
Commit
1b1b6c5f
authored
Nov 25, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
40d4fbe4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
15 deletions
+12
-15
path.c
dlls/kernelbase/path.c
+1
-1
registry.c
dlls/kernelbase/registry.c
+1
-2
path.c
dlls/kernelbase/tests/path.c
+6
-6
volume.c
dlls/kernelbase/volume.c
+4
-6
No files found.
dlls/kernelbase/path.c
View file @
1b1b6c5f
...
...
@@ -2944,7 +2944,7 @@ HRESULT WINAPI UrlUnescapeW(WCHAR *url, WCHAR *unescaped, DWORD *unescaped_len,
else
if
(
*
src
==
'%'
&&
isxdigit
(
*
(
src
+
1
))
&&
isxdigit
(
*
(
src
+
2
))
&&
!
stop_unescaping
)
{
INT
ih
;
WCHAR
buf
[
5
]
=
{
'0'
,
'x'
,
0
}
;
WCHAR
buf
[
5
]
=
L"0x"
;
memcpy
(
buf
+
2
,
src
+
1
,
2
*
sizeof
(
WCHAR
));
buf
[
4
]
=
0
;
StrToIntExW
(
buf
,
STIF_SUPPORT_HEX
,
&
ih
);
...
...
dlls/kernelbase/registry.c
View file @
1b1b6c5f
...
...
@@ -2775,7 +2775,6 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
/* Parse the value and load the string. */
{
WCHAR
*
pComma
=
wcsrchr
(
pwszExpandedBuffer
,
','
),
*
pNewBuffer
;
const
WCHAR
backslashW
[]
=
{
'\\'
,
0
};
UINT
uiStringId
;
DWORD
baseDirLen
;
int
reqChars
;
...
...
@@ -2802,7 +2801,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
if
(
baseDirLen
)
{
lstrcpyW
(
pwszTempBuffer
,
pwszBaseDir
);
if
(
pwszBaseDir
[
baseDirLen
-
1
]
!=
'\\'
)
lstrcatW
(
pwszTempBuffer
,
backslashW
);
lstrcatW
(
pwszTempBuffer
,
L"
\\
"
);
}
lstrcatW
(
pwszTempBuffer
,
pwszExpandedBuffer
+
1
);
...
...
dlls/kernelbase/tests/path.c
View file @
1b1b6c5f
...
...
@@ -546,9 +546,9 @@ static void test_PathAllocCombine(void)
static
void
test_PathCchCombine
(
void
)
{
WCHAR
expected
[
PATHCCH_MAX_CCH
]
=
{
'C'
,
':'
,
'\\'
,
'a'
,
0
}
;
WCHAR
p1
[
PATHCCH_MAX_CCH
]
=
{
'C'
,
':'
,
'\\'
,
0
}
;
WCHAR
p2
[
PATHCCH_MAX_CCH
]
=
{
'a'
,
0
}
;
WCHAR
expected
[
PATHCCH_MAX_CCH
]
=
L"C:
\\
a"
;
WCHAR
p1
[
PATHCCH_MAX_CCH
]
=
L"C:
\\
"
;
WCHAR
p2
[
PATHCCH_MAX_CCH
]
=
L"a"
;
WCHAR
output
[
PATHCCH_MAX_CCH
];
HRESULT
hr
;
INT
i
;
...
...
@@ -607,9 +607,9 @@ static void test_PathCchCombine(void)
static
void
test_PathCchCombineEx
(
void
)
{
WCHAR
expected
[
MAX_PATH
]
=
{
'C'
,
':'
,
'\\'
,
'a'
,
0
}
;
WCHAR
p1
[
MAX_PATH
]
=
{
'C'
,
':'
,
'\\'
,
0
}
;
WCHAR
p2
[
MAX_PATH
]
=
{
'a'
,
0
}
;
WCHAR
expected
[
MAX_PATH
]
=
L"C:
\\
a"
;
WCHAR
p1
[
MAX_PATH
]
=
L"C:
\\
"
;
WCHAR
p2
[
MAX_PATH
]
=
L"a"
;
WCHAR
output
[
MAX_PATH
];
HRESULT
hr
;
int
i
;
...
...
dlls/kernelbase/volume.c
View file @
1b1b6c5f
...
...
@@ -152,7 +152,6 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root )
/* get the label by reading it from a file at the root of the filesystem */
static
void
get_filesystem_label
(
const
UNICODE_STRING
*
device
,
WCHAR
*
label
,
DWORD
len
)
{
static
const
WCHAR
labelW
[]
=
{
'.'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'-'
,
'l'
,
'a'
,
'b'
,
'e'
,
'l'
,
0
};
HANDLE
handle
;
UNICODE_STRING
name
;
IO_STATUS_BLOCK
io
;
...
...
@@ -167,12 +166,12 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
name
.
MaximumLength
=
device
->
Length
+
sizeof
(
labelW
);
name
.
MaximumLength
=
device
->
Length
+
sizeof
(
L".windows-label"
);
name
.
Length
=
name
.
MaximumLength
-
sizeof
(
WCHAR
);
if
(
!
(
name
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
MaximumLength
)))
return
;
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
labelW
,
sizeof
(
labelW
)
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
L".windows-label"
,
sizeof
(
L".windows-label"
)
);
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
{
...
...
@@ -193,7 +192,6 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
/* get the serial number by reading it from a file at the root of the filesystem */
static
DWORD
get_filesystem_serial
(
const
UNICODE_STRING
*
device
)
{
static
const
WCHAR
serialW
[]
=
{
'.'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'-'
,
's'
,
'e'
,
'r'
,
'i'
,
'a'
,
'l'
,
0
};
HANDLE
handle
;
UNICODE_STRING
name
;
IO_STATUS_BLOCK
io
;
...
...
@@ -207,12 +205,12 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device )
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
name
.
MaximumLength
=
device
->
Length
+
sizeof
(
serialW
);
name
.
MaximumLength
=
device
->
Length
+
sizeof
(
L".windows-serial"
);
name
.
Length
=
name
.
MaximumLength
-
sizeof
(
WCHAR
);
if
(
!
(
name
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name
.
MaximumLength
)))
return
0
;
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
serialW
,
sizeof
(
serialW
)
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
L".windows-serial"
,
sizeof
(
L".windows-serial"
)
);
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
))
{
...
...
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