Path = PathString->Buffer;
Chars = PathString->Length / sizeof(WCHAR);
+ /* Return if there are no characters */
+ if (!Chars) return RtlPathTypeUnknown;
+
/*
* The algorithm is similar to RtlDetermineDosPathNameType_U but here we
* actually check for the path length before touching the characters
/* Handle initial path type and failure case */
*PathType = RtlPathTypeUnknown;
- if (!(Size) || !(Buffer) || !(FileName) || (FileName->Buffer[0] == UNICODE_NULL)) return 0;
+ if (!(Size) || !(Buffer) || !(FileName) ||
+ !(FileName->Length) || (FileName->Buffer[0] == UNICODE_NULL)) return 0;
/* Break filename into component parts */
FileNameBuffer = FileName->Buffer;