ntdll: rtlstr.c: Implement checking for control characters in RtlIsTextUnicode [try 4]

Zac Brown zac at zacbrown.org
Thu Jun 19 22:31:49 CDT 2008


Michael Karcher wrote:
> Am Donnerstag, den 19.06.2008, 12:52 -0700 schrieb Zac Brown:
>> - Because these tests are mutually exclusive, a single goto label suffices for 
>> breaking the loop.
> 
> As written, your tests are not mutually exclusive. It could happen that
> flags has IS_TEXT_UNICODE_CONTROLS and IS_TEXT_UNICODE_REVERSE_CONTROLS,
> set and out_flags contains IS_TEXT_UNICODE_REVERSE_SIGNATURE. (If the
> caller doesn't provide flags, both flags are set, in fact!) In that
> case, both conditions of your if statements are true.
> 
> I don't know whether that means that you need two goto targets or that
> your logic should be changed, but I suspect the latter. If you test for
> reversed control characters only I a reversed BOM was found, you should
> not test for non-reversed control characters if a reversed BOM was
> found, according to my intuition.
> 
> Regards,
>   Michael Karcher
> 
> 
> 
Hmmm this is true. Added a test in the first if statement to do something like:

if((flags & IS_TEXT_UNICODE_CONTROL) && (out_flags & IS_TEXT_UNICODE_SIGNATRUE)) 
causes a wine test to fail.

So either I need a goto at the end of the first if statement before the closing 
brace, or I need to adjust some other things in the code.

Any thoughts from anyone on the proper way to approach this ;). I'd like to get 
this one done before try 10 (haha).

-Zac



More information about the wine-devel mailing list