Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4aec75f0
Commit
4aec75f0
authored
Aug 20, 2003
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply only specified tests.
Implement IS_TEXT_UNICODE_REVERSE_SIGNATURE, IS_TEXT_UNICODE_STATISTICS and IS_TEXT_UNICODE_NULL_BYTES tests. Revert IS_TEXT_UNICODE_ODD_LENGTH test.
parent
00e5ccfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
rtlstr.c
dlls/ntdll/rtlstr.c
+38
-4
No files found.
dlls/ntdll/rtlstr.c
View file @
4aec75f0
...
...
@@ -1405,7 +1405,11 @@ NTSTATUS WINAPI RtlFindCharInUnicodeString(
*/
/* Tests that we currently implement */
#define ITU_IMPLEMENTED_TESTS \
(IS_TEXT_UNICODE_SIGNATURE|IS_TEXT_UNICODE_ODD_LENGTH)
(IS_TEXT_UNICODE_SIGNATURE | \
IS_TEXT_UNICODE_REVERSE_SIGNATURE | \
IS_TEXT_UNICODE_ODD_LENGTH | \
IS_TEXT_UNICODE_STATISTICS | \
IS_TEXT_UNICODE_NULL_BYTES)
/**************************************************************************
* RtlIsTextUnicode (NTDLL.@)
...
...
@@ -1443,13 +1447,43 @@ DWORD WINAPI RtlIsTextUnicode(
*/
/* Check for an odd length ... pass if even. */
if
(
!
(
len
&
1
))
if
(
(
flags
&
IS_TEXT_UNICODE_ODD_LENGTH
)
&&
(
len
&
1
))
out_flags
|=
IS_TEXT_UNICODE_ODD_LENGTH
;
/* Check for the special
unicode marker byte
. */
if
(
*
s
==
0xFEFF
)
/* Check for the special
byte order unicode marks
. */
if
(
(
flags
&
IS_TEXT_UNICODE_SIGNATURE
)
&&
*
s
==
0xFEFF
)
out_flags
|=
IS_TEXT_UNICODE_SIGNATURE
;
if
((
flags
&
IS_TEXT_UNICODE_REVERSE_SIGNATURE
)
&&
*
s
==
0xFFFE
)
out_flags
|=
IS_TEXT_UNICODE_REVERSE_SIGNATURE
;
/* apply some statistical analysis */
if
(
flags
&
IS_TEXT_UNICODE_STATISTICS
)
{
DWORD
i
,
stats
=
0
;
/* FIXME: checks only for ASCII characters in the unicode stream */
for
(
i
=
0
;
i
<
len
/
sizeof
(
WCHAR
);
i
++
)
{
if
(
s
[
i
]
<=
255
)
stats
++
;
}
if
(
stats
>
len
/
sizeof
(
WCHAR
)
/
2
)
out_flags
|=
IS_TEXT_UNICODE_STATISTICS
;
}
/* Check for unicode NULL chars */
if
(
flags
&
IS_TEXT_UNICODE_NULL_BYTES
)
{
DWORD
i
;
for
(
i
=
0
;
i
<
len
/
sizeof
(
WCHAR
);
i
++
)
{
if
(
!
s
[
i
])
{
out_flags
|=
IS_TEXT_UNICODE_NULL_BYTES
;
break
;
}
}
}
/*
* Check whether the string passed all of the tests.
*/
...
...
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