SHLWAPI: implement PathIsValidChar{A,W}

Juan Lang juan_lang at yahoo.com
Sun Jan 30 15:29:26 CST 2005


Hi Hans, it looks like from values 0x7e onward the character class is
always PATH_CHAR_CLASS_OTHER_VALID.  If you like, for clarity you can fill
in the value through 0x7f, but having a lookup table beyond this isn't
necessary.

Also, that means the data type can be unsigned char, not DWORD.

And, it looks like the return value isn't consistent:

+static BOOL WINAPI PathIsValidCharAW( unsigned char c, DWORD class )
+{
+    return class & SHELL_charclass[c];
+}

Here you mask class with the value in the table..

+BOOL WINAPI PathIsValidCharA( char c, DWORD class )
+{
+    return PathIsValidCharAW( (unsigned char)c, class );
+}

and again here, implicitly..

+BOOL WINAPI PathIsValidCharW( WCHAR c, DWORD class )
+{
+    if (c > 0xff) return PATH_CHAR_CLASS_OTHER_VALID;
+    return PathIsValidCharAW( (unsigned char)c, class );
+}

But for values of c greater than 0xff, you do not mask.  This may be
deliberate, I don't know, but it doesn't look correct.

--Juan

p.s. Have you added me to your spam list yet? ;)


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail



More information about the wine-devel mailing list