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
f599b2cf
Commit
f599b2cf
authored
Mar 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use wcsupr() instead of toupperW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d3ba59e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
directory.c
dlls/ntdll/directory.c
+6
-7
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
No files found.
dlls/ntdll/directory.c
View file @
f599b2cf
...
@@ -1296,9 +1296,8 @@ BOOL DIR_is_hidden_file( const UNICODE_STRING *name )
...
@@ -1296,9 +1296,8 @@ BOOL DIR_is_hidden_file( const UNICODE_STRING *name )
/***********************************************************************
/***********************************************************************
* hash_short_file_name
* hash_short_file_name
*
*
* Transform a Unix file name into a hashed DOS name. If the name is a valid
* Transform a Unix file name into a hashed DOS name. If the name is not a valid
* DOS name, it is converted to upper-case; otherwise it is replaced by a
* DOS name, it is replaced by a hashed version that fits in 8.3 format.
* hashed version that fits in 8.3 format.
* 'buffer' must be at least 12 characters long.
* 'buffer' must be at least 12 characters long.
* Returns length of short name in bytes; short name is NOT null-terminated.
* Returns length of short name in bytes; short name is NOT null-terminated.
*/
*/
...
@@ -1334,7 +1333,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer )
...
@@ -1334,7 +1333,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer )
for
(
i
=
4
,
p
=
name
->
Buffer
,
dst
=
buffer
;
i
>
0
;
i
--
,
p
++
)
for
(
i
=
4
,
p
=
name
->
Buffer
,
dst
=
buffer
;
i
>
0
;
i
--
,
p
++
)
{
{
if
(
p
==
end
||
p
==
ext
)
break
;
if
(
p
==
end
||
p
==
ext
)
break
;
*
dst
++
=
is_invalid_dos_char
(
*
p
)
?
'_'
:
toupperW
(
*
p
)
;
*
dst
++
=
is_invalid_dos_char
(
*
p
)
?
'_'
:
*
p
;
}
}
/* Pad to 5 chars with '~' */
/* Pad to 5 chars with '~' */
while
(
i
--
>=
0
)
*
dst
++
=
'~'
;
while
(
i
--
>=
0
)
*
dst
++
=
'~'
;
...
@@ -1349,7 +1348,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer )
...
@@ -1349,7 +1348,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer )
{
{
*
dst
++
=
'.'
;
*
dst
++
=
'.'
;
for
(
i
=
3
,
ext
++
;
(
i
>
0
)
&&
ext
<
end
;
i
--
,
ext
++
)
for
(
i
=
3
,
ext
++
;
(
i
>
0
)
&&
ext
<
end
;
i
--
,
ext
++
)
*
dst
++
=
is_invalid_dos_char
(
*
ext
)
?
'_'
:
toupperW
(
*
ext
)
;
*
dst
++
=
is_invalid_dos_char
(
*
ext
)
?
'_'
:
*
ext
;
}
}
return
dst
-
buffer
;
return
dst
-
buffer
;
}
}
...
@@ -1446,7 +1445,7 @@ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STR
...
@@ -1446,7 +1445,7 @@ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STR
static
BOOL
append_entry
(
struct
dir_data
*
data
,
const
char
*
long_name
,
static
BOOL
append_entry
(
struct
dir_data
*
data
,
const
char
*
long_name
,
const
char
*
short_name
,
const
UNICODE_STRING
*
mask
)
const
char
*
short_name
,
const
UNICODE_STRING
*
mask
)
{
{
int
i
,
long_len
,
short_len
;
int
long_len
,
short_len
;
WCHAR
long_nameW
[
MAX_DIR_ENTRY_LEN
+
1
];
WCHAR
long_nameW
[
MAX_DIR_ENTRY_LEN
+
1
];
WCHAR
short_nameW
[
13
];
WCHAR
short_nameW
[
13
];
UNICODE_STRING
str
;
UNICODE_STRING
str
;
...
@@ -1463,7 +1462,6 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
...
@@ -1463,7 +1462,6 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
{
{
short_len
=
ntdll_umbstowcs
(
short_name
,
strlen
(
short_name
),
short_len
=
ntdll_umbstowcs
(
short_name
,
strlen
(
short_name
),
short_nameW
,
ARRAY_SIZE
(
short_nameW
)
-
1
);
short_nameW
,
ARRAY_SIZE
(
short_nameW
)
-
1
);
for
(
i
=
0
;
i
<
short_len
;
i
++
)
short_nameW
[
i
]
=
toupperW
(
short_nameW
[
i
]
);
}
}
else
/* generate a short name if necessary */
else
/* generate a short name if necessary */
{
{
...
@@ -1474,6 +1472,7 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
...
@@ -1474,6 +1472,7 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
short_len
=
hash_short_file_name
(
&
str
,
short_nameW
);
short_len
=
hash_short_file_name
(
&
str
,
short_nameW
);
}
}
short_nameW
[
short_len
]
=
0
;
short_nameW
[
short_len
]
=
0
;
wcsupr
(
short_nameW
);
TRACE
(
"long %s short %s mask %s
\n
"
,
TRACE
(
"long %s short %s mask %s
\n
"
,
debugstr_w
(
long_nameW
),
debugstr_w
(
short_nameW
),
debugstr_us
(
mask
));
debugstr_w
(
long_nameW
),
debugstr_w
(
short_nameW
),
debugstr_us
(
mask
));
...
...
dlls/ntdll/ntdll_misc.h
View file @
f599b2cf
...
@@ -298,6 +298,7 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base );
...
@@ -298,6 +298,7 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base );
#define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2)
#define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2)
#define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n)
#define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n)
#define wcsupr(s) NTDLL__wcsupr(s)
/* convert from straight ASCII to Unicode without depending on the current codepage */
/* convert from straight ASCII to Unicode without depending on the current codepage */
static
inline
void
ascii_to_unicode
(
WCHAR
*
dst
,
const
char
*
src
,
size_t
len
)
static
inline
void
ascii_to_unicode
(
WCHAR
*
dst
,
const
char
*
src
,
size_t
len
)
...
...
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