Author: pschweitzer Date: Wed Aug 20 16:21:42 2008 New Revision: 35490
URL: http://svn.reactos.org/svn/reactos?rev=35490&view=rev Log: - Added support for the lead DBCS in RtlIsNameLegalDOS8Dot3 - Don't allow it to be cut at the end of the filename (as it's done in FsRtl* functions)
Modified: branches/pierre-fsd/lib/rtl/dos8dot3.c
Modified: branches/pierre-fsd/lib/rtl/dos8dot3.c URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/lib/rtl/dos8dot3.c?re... ============================================================================== --- branches/pierre-fsd/lib/rtl/dos8dot3.c [iso-8859-1] (original) +++ branches/pierre-fsd/lib/rtl/dos8dot3.c [iso-8859-1] Wed Aug 20 16:21:42 2008 @@ -11,6 +11,11 @@
#define NDEBUG #include <debug.h> + +/* GLOBALS *******************************************************************/ + +extern BOOLEAN NlsMbOemCodePageTag; +extern PUSHORT NlsOemLeadByteInfo;
/* CONSTANTS *****************************************************************/ @@ -267,20 +272,26 @@
for (i = 0; i < AnsiName->Length; i++) { + /* First make sure the character it's not the Lead DBCS */ + if (NlsMbOemCodePageTag && NlsOemLeadByteInfo[(UCHAR)AnsiName->Buffer[i]]) + { + if (i == AnsiName->Length - 1) return FALSE; + i++; + } switch (AnsiName->Buffer[i]) { - case ' ': - /* leading/trailing spaces not allowed */ - if (!i || i == AnsiName->Length-1 || AnsiName->Buffer[i+1] == '.') return FALSE; - GotSpace = TRUE; - break; - case '.': - if (Dot != -1) return FALSE; - Dot = i; - break; - default: - if (strchr(Illegal, AnsiName->Buffer[i])) return FALSE; - break; + case ' ': + /* leading/trailing spaces not allowed */ + if (!i || i == AnsiName->Length-1 || AnsiName->Buffer[i+1] == '.') return FALSE; + GotSpace = TRUE; + break; + case '.': + if (Dot != -1) return FALSE; + Dot = i; + break; + default: + if (strchr(Illegal, AnsiName->Buffer[i])) return FALSE; + break; } } /* check file part is shorter than 8, extension shorter than 3